We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Floating image is lost in outputted document

Hello,
I’m using Aspose.Words to update custom document properties in an existing document. The existing document has a floating image (in front of text), but the outputted file doesn’t have an image at all. It also does not contain a shape object which could/should contain the image. So the image is just completely lost (This error is easily reproduced by creating a document with a floating image and then ‘asposing’ the document).
When I change the image to ‘in line with text’ so that it’s not floating anymore, the image does not get lost in the outputted document. I read some articles in the programmers guide about working with images and it says you can insert floating images, and you can extract them from a file, so I guess floating images are supported by Aspose? I could not find any more information about working with images.
Anyway the question is: How can I make sure that the image is correctly displayed in the outputted document and that it keeps the correct properties? I hope I don’t have to do it manually, as in: extract the image from the source file, save it’s data/properties, save the image in a temp directory, and insert the image into the ‘new’ document (with the correct data/properties)?
I hope you can help me out, thanks in advance.
Greetings,
Jip

Hi
Thanks for your inquiry. Could you please attach your document for testing? I will investigate the problem and provide you more information.
Best regards.

I have attached a simple file which contains just one floating image, it also produces the error here.
Then another question about outputting to PDF… When I do
pdf.Save(dir + “/saves/document.pdf”);
it works and I can open the file from my harddrive without troubles, but when I do
pdf.Save(“document.pdf”, Aspose.Pdf.SaveType.OpenInBrowser, Response);
it says it cannot open the file because it is damaged. How can I open it in browser?

Hi

Thank you for more information. It seems to be a known issue #6011 in our defect database. I will notify you as soon as it is fixed.
Regarding the second question, you should ask it in Aspose.Pdf forum.
https://forum.aspose.com/c/pdf/10
Aspose.Pdf team will answer you shortly.
Best regards.

Thanks for your response.
I just found out something related to this problem.
When I use a .doc with a floating image as existing input document, the images does NOT get lost in the outputted document.
When I use a .docx with a floating image as existing input document, the images DOES get lost in the outputted document.
So I’d advise this as a workaround for people with the same problem…
My PDF problem has also been fixed by adding Reponse.End() to the end of the PDF-generating-code.

Hi
Thanks for your request. Yes, this occurs only with floating DrawingML in DOCX documents. In all other formats floating shapes should work fine.
Best regards.

We are happy to tell you that we released new version of Aspose.Words. This version includes fix of issue you found earlier (issue # 6011). Aspose.Words 6.0 supports the full set of DrawingML used by Microsoft Word 2007. You can download new version from here:
https://releases.aspose.com/words/net
Best regards.