Greetings,
I'm using the function below to perform word to pdf conversion. It usually works fine, but I have one document that throws an Illegal Characters in Path error on srcDoc.Save(xmlDoc, Aspose.Words.SaveFormat.AsposePdf);
Do you have any idea what could cause this? I have attached the document.
private MemoryStream ConvertWordDoc(byte[] wordDoc)
{
try
{
MemoryStream memStream = new MemoryStream(wordDoc);
Aspose.Words.
Document srcDoc = new Aspose.Words.Document(memStream);
srcDoc.SaveOptions.ExportImagesFolder =
"d:\temp";
// Save the DOC file as Aspose.Pdf.Xml in memory.
MemoryStream xmlDoc = new MemoryStream();
srcDoc.Save(xmlDoc, Aspose.Words.
SaveFormat.AsposePdf);
xmlDoc.Position = 0;
// Read the document into Aspose.Pdf.
Aspose.Pdf.
Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(xmlDoc,
null);
MemoryStream outputStream = new MemoryStream(100);
pdf.Save(outputStream);
// Instruct Aspose.Pdf to delete temporary image files.
pdf.IsImagesInXmlDeleteNeeded =
true;
return outputStream;
}
catch (Exception Ex)
{
EventLogger(Ex);
return null;
}
}