Sign In  Sign Up Live-Chat

Illegal Characters in Path

Last post 05-13-2008, 5:22 PM by Klepus. 1 replies.
Sort Posts: Previous Next
  •  05-13-2008, 4:54 PM 126782

    Illegal Characters in Path

    Attachment: Present (inaccessible)

    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;

    }

    }

     
  •  05-13-2008, 5:22 PM 126783 in reply to 126782

    Re: Illegal Characters in Path

    Hello!

     

    Thank you for reporting this.

     

    I was unable to reproduce the issue. When you are saving this document to a stream only one supplementary file is created with this conversion since the document has one image. Names of images are synthesized programmatically. They are guaranteed to be unique and valid. Moreover synthesized names don’t depend on anything in the source document but image numbers.

     

    Please check whether this issue occurs intermittently or permanently. You can also experiment with default or altered ExportImagesFolder. If it is empty then Aspose.Words outputs images to temporary directory. Provide any other information that can give us a clue.

     

    Regards,
    Viktor Sazhaev
    Software Engineer, Aspose Auckland Team
     
View as RSS news feed in XML