Convert html to word,if images use absolute position,images in generated word files can not be displayed

convert html to word,if images use absolute position,images in generated word files can not be displayed.
if use windows operating system, no problem. If you use debian, you’ll have this problem.
I use Aspose.word 20.11,jre 1.8,debian 10
Document WordDoc = new Document("/www/1744.htm");
WordDoc.save("/www/1744.docx");

1744.zip (782 Bytes)

thanks

@hlgao,

You have attached only a “1744.htm” file which seems to be generated by using Aspose.Words on your end. The Image “001.png” was also not found in “1744.zip”. Please ZIP and attach source HTML file and Aspose.Words generated DOCX file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

when I use Aspose.word 19.5 , the result is correct.
when I use Aspose.word 20.11, if the picture address in the html code is relative address, debian operating system is correct

1744.zip (18.4 KB)

@hlgao,

I have extracted the files from “1744.zip” into a folder on disk. When I opened “1744.htm” with web browser, the image is not visible. Aspose.Words 20.12 will render a red cross in place of image in output Word document as the image path src="/www/images/001.png" does not resolve correctly. After that I edited the img path like this: src="www/images/001.png, created a www folder and moved the images folder inside www folder (see modified folder structure.zip (1.6 KB)). Then executing the following simple Java code displays the image in output DOCX (awjava-20.12.zip (7.8 KB)).

Document doc = new Document("C:\\temp\\1744\\1744.htm");
doc.save("C:\\temp\\1744\\awjava-20.12.docx");

Please also check the HtmlLoadOptions.BaseUri property:

@awais.hafeez
Thank you for your patience, but this is not the result I want.
If you opened “1744.htm” with web browser, the image is not visible. because you should operate in a debian system,not windows OS. And put the files in the root folder /www. just like windows c:\wwww
The Aspose.word Version 19 can work,but Version 20 not.

@hlgao,

We have logged this problem in our issue tracking system. Your ticket number is WORDSNET-21536. We will further look into the details of this problem and will keep you updated on the status of the linked issue. We apologize for any inconvenience.

@hlgao,

Regarding WORDSNET-21536, we suggest you to please use the the following code:

HtmlLoadOptions options = new HtmlLoadOptions();
options.setBaseUri("/");
Document WordDoc = new Document("/www/1744.htm", options);
WordDoc.save("/www/1744.docx");