HI,

I have a test project that saves the html to pdf using the HTMLtoPDFconverter.


My current scenario is this:

I have a Signature pad, that saves the signature to a binary64. The binary64 appears then to a part of the page using 

SyntaxEditor Code Snippet

"<img src='data:image/png;base64, "+Base64_1+"' width='500'/>"


But the moment I press the save to pdf button, the signature is not present in the pdf file, i tried also to generate an image but still it does not appear. 


thanks in advance. I attached the output below

Figure 1: Signature Pad and the Signature Generated using the html tag above

Figure 2: The actual result. The signature is does not appear

Hi,


I am assuming you are saving the signature associated with a User identifier or something like that?
As the HTMLtoPDF calls the page anonymously, the page will be rendered by the server in a different Session. This means, for example, that the GetUserId() built-in function will return always 0. So when you SHOW the page (user session) the image is shown, but when the component calls the page to convert to PDF, it is not. The same thing would happen if you were storing the information in a session variable.

Also, if you are just dynamically adding the image in the page during user usage of it and then calling the converter, it will not work, as the converter will call again the page, and the image will not be there.

Well, this is just a guess.

If that's the case, you need to pass to the URL that you are providing for the convert a value that must be fetched in the other side (the page) and used to find the image in the database (you need to store it there first).

Cheers.

P.S. there is a new HTML to PDF generator in Forge that you may consider using instead of this one. It will have the same problem (you need to store the image and retrieve in the preparation of the page), of course, but it seems more friendly to use.

https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf