Convert HTML to DOCX

Hi,


I’m trying to convert HTML file to DOCX using this code:

LoadOptions options = new LoadOptions();
options.setLoadFormat(LoadFormat.HTML);
Document doc = new Document(MyDir + “html.html” , options);
doc.save(MyDir + “out.docx” , LoadFormat.DOCX);


The conversion is pretty good but not perfect. Looks like some CSS styles are not supported.

What can I do about it?

You can see the input and output files in the attachment.
Thanks,
Hi,

Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14753. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

@ronshimoni2,

Thanks for being patient. Regarding WORDSNET-14753, our product team has completed the work on your issue and has come to a conclusion that they will not be able to implement the fix to your issue. Your issue (WORDSNET-14753) will be closed with ‘Won’t Fix’ resolution.

Your HTML document relies on the following CSS features:

  1. ‘background-image’ on text-level elements.
  2. <div> elements with ‘background-color’

These features are not supported, because there are no couter-parts for them in our document model. We apologize for your inconvenience.

A post was split to a new topic: javax.xml.stream.util.XMLEventAllocator not found by Aspose_Word