Free Support Forum - aspose.com

Docx to Html Conversion is not perfect like original file...formatting is disturbed with even new version

I am not able to get HTML output of docx file with correct format
code is as follow…

Document doc = new Document(’…path…’);
doc.save(‘output.html’,SaveFormat.HTML);

@shreyb2,

Thanks for your inquiry. Please ZIP and upload your input Word document and Aspose.Words generated output HTML file showing the undesired behavior here for testing. Please also create a comparison screenshot highlighting (encircle) the problematic areas in output HTML and attach it here for our reference. We will investigate the issue on our end and provide you more information.

Here i am sending code…and screenshot(comparison.png) containing comparison of original and html converted file…with original docx file inside the folder.

@awais.hafeez

I have uploaded the zip file are you able to see it…because I am not able to see file uploaded or not!

@shreyb2,

I am afraid, I do not see any attachments in this thread either.

You can also upload the ZIP file to Dropbox and share the download link here for testing.

@awais.hafeez

I am so sorry awaiz I am not allowed to share code with my network…that’s the reason i am not able to upload the code

I can explain you the issue i am facing…

if document has no images and shapes then its perfect, working fine but,
if document contains images and shapes then they are overlapping with each other…they are not aligned as per document format

can you help me on this

Aspose_01.zip (4.4 MB)

Here is the attachment which contains text file of my main class, original docx and png showing comparison after conversion…one request for you is to please convert App.text into App.Java for your testing

I am using 18.6 Aspose.Words jar in my project and comparison.png is the output of that version…

@shreyb2,

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. The ID of this issue is WORDSNET-17063. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

any updates?

@shreyb2,

Unfortunately, your issue (WORDSNET-17063) is not resolved yet. This issue is currently pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Hi @awais.hafeez …my temporary license is going to expire in a week can you please solve this issue with a priority…so that i can decide to buy full stack version…

@shreyb2,

I am afraid, there is no further news about this issue. In the meantime while you are waiting for a fix, you may also want to take a look at the HtmlFixed format. For example, please try the following code:

Document doc = new Document("D:\\Temp\\4. Balfour Beatty Blueprint v3.0.docx");
HtmlFixedSaveOptions opts = new HtmlFixedSaveOptions();
opts.setPrettyFormat(true);
// specify other options
doc.save("D:\\Temp\\18.6.html", opts);

We will inform you via this thread as soon as this issue (WORDSNET-17063) is resolved. We apologize for any inconvenience.

Thanks @awais.hafeez HTMLFixed is working fine

But new issue is with html fixed i am not able to get doc from same html in correct format which i was getting with HtmlSaveOptions

@shreyb2,

I am afraid, you cannot reload HtmlFixed document back into Aspose.Words DOM. This is output only format.

output I got from HTMLFixed is perfect…is there any way to convert that html file back to doc/docx???

or from HtmlSave to get perfect html output like HtmlFixed?

@shreyb2,

I am afraid, HtmlFixed is output only format and you cannot convert it back to Word formats.

We will inform you via this thread as soon as this issue (WORDSNET-17063) is resolved.