Rich text image to show in generated PDF

4
Hi, I have a header for a PDF that I'm generating. The header is created in the Rich text editor. In the rich text editor I also upload an image. For as far as I know it is not possible to generate a PDF from the rich text, where the image is included. My only work-around that I can think of is to have a separate image uploader and put a dynamic image viewer on the template. I don't really like this, because then the creation of the header will not be very flexible anymore for the user. Is there a better work-around? Thanks!
asked
1 answers
3

You could potentially base64 encode the image? So if the image is a link to a src like: "url/picture.png" download the image and the base 64 encode it into a string then repleace the src with the encoded string.

So you would need to create an on change or on the save microflow button that would find all tags and replace the src=" " part with something like: So convert

<img src="image location"></img>

to something like:

 <img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/
/ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcpp
V0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7" 
width="16" height="14" alt="embedded folder icon"></img>
answered