We are using a separate tool (DevExpress RichEditControl) to generate documents in DOCX format, and using Aspose.Words to convert these files to XPS.
We have found that when we convert our documents, the images in those documents are replaced by white areas in the generated XPS documents. Aspose.Words can successfully convert documents with images that are created in Microsoft Word 2010, however. In an attempt to work out what was going wrong, I opened one of our generated documents in Word and resaved it. After converting the Word-saved document to XPS using Aspose.Words, the images appeared as they should.
I then began altering our original generated document to incorporate the changes that Word made. After some fiddling and several conversions, I believe I found the issue. Our generator ouputs images using the VML shape element, specifying only the style attribute. Word 2010 added several other attributes and some child elements, but only one additional attribute was needed for Aspose.Words to successfully convert the images: spt, with a value of “100”. This attribute is documented at https://docs.microsoft.com/en-us/windows/win32/vml/msdn-online-vml-spt-attribute, where it’s described as “internal use only,” so I’m a bit confused as to why Aspose.Words cannot convert images without it.
We can’t change how our exporter writes images, but the spt element doesn’t seem to be properly documented. Would it be possible for your product to convert images without it? (Our documents appear normal, with images intact, when opened in Microsoft Word.)
I have included two files that demonstrate the issue. The “broken” file is directly from our generator, and the “working” file has been modified only to add the “spt” tag. After using Aspose.Words to convert both documents to the XPS format, the image will only appear in the “Working” file.