I have troubles to visualize some images when I export html content to doc.Attahced you will find the html content and the output for 2 tests I did. In both images appear like red square. No error messages or any exception. Java version is jdk 1.4 and I tested on Websphere server version 6.0.2.15. Also I have installed Office 2007 but I save my document with doc extension not docx.
Here the code I run:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHtml(htmlContent);
fileName= documentPath + System.currentTimeMillis() + ".doc";
builder.getDocument().save(fileName,SaveFormat.DOC);
Thanks for your inquiry. The problem occurs because Aspose.Words cannot access these pictures. Most likely, you should have authorized access to the site where these pictures are located.
<IMG src="https://wachoviasec1/manager/1ppamanager/mgrstatic/attach/embimages/HT27245New Image for Test.GIF" border=0>
Export works ok , the URL https://wachoviasec1/manager/1ppamanager/mgrstatic/attach/embimages/HT27245New%20Image%20for%20Test.GIF is totally visible from my pc, I tried with several address that I have full access and the same happens, images are not showed.
Is it a kind of issue if images are in a different network address?
Thank you for additional information. I think the problem occurs because you should specify network credentials to access this web site. Currently, there is no way to set network credentials of Document. I linked your request to the appropriate issue.
Maybe, as a workaround, you can parse your HTML, create locale copies of each image in the HTML document and use local path instead URI.
There is no credential access required to access https site, and even I tested on single http URI and the same issue happens, So Im really sure that it is not the root cause of issue. My client is not able to write into any local drive so we have to find other way to do. Please tell me your comments as soon as you can,
Thank you for additional information. Actually, urls cannot contain whitespaces. Whitespaces in urls should be escaped with %20. See the following example:
// Create docuemnt and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
//Insert HTML
builder.insertHtml("<IMG src='http://www.software112.com/images/Development/Oldies/Screenshots/3634%20aspose%20word.gif' align=left border=0>");
// Save output document
doc.save("C:\\Temp\\out.doc")
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.