Doc->HTML: Raster export for EMF/WMF not working

Dear Aspose Team

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)?

Thanks in advance,
Peter

Hello

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?

Many thanks,

Hello

Thank you for additional information. I think you can try using the approach suggested in the following thread:
https://forum.aspose.com/t/worddocument-has-display-issues-after-saving-to-pdf-with-aspose-words/67330/2
Regarding the license, please ask this question in the Aspose.Purchase forum:
https://forum.aspose.com/c/purchase/6
Best regards,

The issues you have found earlier (filed as WORDSJAVA-34) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.