Concerns: Word Doc -> HTML export Problem: Metafile image (WMF/EMF) rasterization not working
When exporting a Word document which contains EMF and/or WMF images with the option to export metafiles as raster set to true, Aspose.Words creates image files with the suffix .png, only that they’re not PNG files but EMF/WMF files with a .png ending. Browsers other than IE will thus be unable to display the images, and report them as corrupt png files instead.
Example code to reproduce the problem (the example document containing a WMF and EMF image is attached):
File file = new File(pathToTestDocument);
InputStream in = new FileInputStream(file);
Document doc = new Document(in);
File exportFile = new File(file.getParent(), "converted.html");
// just for clarity, this option is already ‘true’ by default
doc.getSaveOptions().setHtmlExportMetafileAsRaster(true);
doc.save(exportFile.getAbsolutePath(), SaveFormat.HTML);
The files generated are:
converted.html (HTML file)
converted.001.png (the WMF image, not rasterized)
converted.002.png (the EMF image, not rasterized)
Environment:
Windows 7 (no local admin rights, if that matters)
Java 1.6.0_20
aspose-words-jdk16-4.0.2-beta.jar
Is this a known issue? Are any workarounds known, other than not rasterizing the metafile images (which is no option for us, as we can’t restrict our user base to use IE only)?
Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
As I can see this problem does not occur in .NET version of Aspose.Words. Currently we are working on synchronizing Java and .NET versions of Aspose.Words. Once we finish this work all functionality which is supported in, NET version will be supported in Java version, including this fix. You will be notified.
Best regards,
Thanks for investigating this issue. As far as I see, there’s no satisfying workaroud for us and our customers other than post-converting the EMF/WMF files after the document has been exported to HTML until this problem is fixed in an upcoming Aspose.Words for Java version.
We’re currently using a Site OEM Enterprise license for Aspose.Words for Java. Could you provide us a similar license for Aspose Metafiles for Java at no extra cost to allow us implement a workaround until the issue is fixed in a newer Aspose.Words for Java version?