I am converting a Docx to PDF, but when I call the BindXML method of the pdf, I get the following :
C:\Documents and Settings\Geoff\LOCALS~1\Temp\Aspose.Words.e5734e43-78cd-46ca-ba45-bacbb1bb156b.001.png' is not a valid virtual path.
The png file exists in the specified directory.
Code that is a problem is as follows:
'Save to Memory Stream as XML Dim stream As New System.IO.MemoryStream doc.Save(stream, Aspose.Words.SaveFormat.AsposePdf) 'Position Stream to begining stream.Seek(0, IO.SeekOrigin.Begin)
Dim pdf As New Aspose.Pdf.Pdf pdf.IsImagesInXmlDeleteNeeded = True pdf.BindXML(stream, Nothing) ---------> Error pdf.Save(TargetFile)
I found the reason of this problem and we will cooperate with the Aspose.Words team to resolve this problem. As a workaround you can create a folder in your server and save the xml into that folder and then bind it.
When you stream, the images that extracted by Aspose.Words are also saved onto disk. By default they are saved to the temp folder (C:\Documents and Settings\Geoff\LOCALS~1\Temp) which causes this problem. I found there is a property doc.SaveOptions.ExportImagesFolder in Aspose.Words. I think this property can help you.