12
Views
3
Comments
Solved
[Html2Doc] It does not work for image
html2doc
Reactive icon
Forge asset by Nuno Ricardo Rodrigues
Application Type
Reactive

Hi there,

this component cannot render image.

regards

2025-01-09 14-56-57
IQ78
Solution

updated after setting the MS Word, not to show the popup, need to update for security.

https://thrivenextgen.com/turn-off-enable-editing-in-microsoft-office-2010/




regards

2019-01-07 16-04-16
Siya
 
MVP

Within this component, specifically in the html2doc block, you'll find code  as follows:

var header = "" + documentTitle + "";

var footer = "";

var sourceHTML = header + document.getElementById($parameters.elementId).innerHTML + footer;

var source = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(sourceHTML);

This script constructs a Word document by appending a header and footer to the content of a specified element, identified by $parameters.elementId. The final HTML string is converted into a data URL formatted for Word documents.

I think for images to display properly in the generated document, fully qualified URLs should be used in your HTML.


2025-01-09 14-56-57
IQ78

thank Sir,

what do you mean by these;

var header = "" + documentTitle + "";

var footer = "";

var sourceHTML = header + document.getElementById($parameters.elementId).innerHTML + footer;

var source = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(sourceHTML);

Do i need to add them to render the image?

Actually i have use the completepath:

<img src='https://demo.blabla.com/uploads/docs-repo/MTA2Mg==/1681279082_24042211821681279081358.jpg' width='993' height='661'>

and it is shown in the OS page when i inject that code. Unfortunately, the HTML2DOC cannot.

regards and thanks

2025-01-09 14-56-57
IQ78
Solution

updated after setting the MS Word, not to show the popup, need to update for security.

https://thrivenextgen.com/turn-off-enable-editing-in-microsoft-office-2010/




regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.