Error inserting PNG

Last post 01-08-2012, 2:52 AM by imran.rafique. 2 replies.
Sort Posts: Previous Next
  •  01-08-2012, 2:03 AM 353664

    Error inserting PNG .NET

    Hi

    We are using the Aspose.Words library within a .NET winforms application.  We are having a problem inserting images when the image is a png.  The version of the library is v10.8.0.0.  I have searched for this error and believed it to have been resolved in this version of the library so apologies if I should be looking elsewhere.

    The code we are using (and which works correctly) is:

     Dim Builder As New DocumentBuilder(awDoc)                 Builder.MoveToBookmark(MyBookMark.Name)
     Builder.InsertImage("C:\image.jpg")

    However if we try and replace the image with "C:\image.png" and insert as follows we get an "Unable to read beyond the end of the stream" exception.

    Any help would be much appreciated.

    Ed

    Filed under: .Net 3.5;.png;Aspose.words
     
  •  01-08-2012, 2:31 AM 353666 in reply to 353664

    Re: Error inserting PNG

    Hi Ed,

    Thanks for your inquiry.

    Could you please attach the problem PNG image here for testing? We will take a look into this for you and provide you with some feedback.

    Thanks,

    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  01-08-2012, 2:52 AM 353668 in reply to 353664

    Re: Error inserting PNG

    Attachment: Present (inaccessible)
    Hi,

    Thanks for your inquiry. While inserting png image, i don't observe any problem. 
    (i am using Aspose.Words 10.8)

    //New document object
    Document doc = new Document();

    //New Document Builder object
    DocumentBuilder builder = new DocumentBuilder(doc);

    //Insert png type image
    builder.InsertImage("d:/test/image.png");

    //Save it 
    doc.Save("d:/insertpngimage.docx");

    In case of any ambiguity, please feel free to share along with attachments.
     
    I have attached the Word Document.


    Best Regards,
    Imran Rafique
    Support Developer
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML