Generating PDF from file with template including logo

So I'm trying include my logo in the PDF output. I've converted it to base64.The text is 5000 characters, so I'm storing it an a separate list, due to the 256 character limitation. I put the base64 in a dictionary and use Render Text Template. This is not working. Am I on the wrong track?

Thanks

Hi @bnunweiler,

Is it a PDF where you're trying to add an image? Probably it's better to use * Convert HTML to PDF in that case and save an HTML template with an image included directly to the PDF?

Best regards,
Petr
Plumsail team

Yes, I'm using the render Text before Convert HTML to PDF.

I'm trying to replicate this article:

https://plumsail.com/docs/workflow-actions-pack/how-to/generate%20pdf%20file%20from%20template.html

FYI the linked examples in this article 404 out. I'm trying to fill in the blanks.

Hi @bnunweiler,

We'll review the article and correct the links as well. I'll post here some results later.

Best regards,
Petr
Plumsail team

Hi @bnunweiler,

Could you share your HTML template, the PDF result sample and screenshots with your flow, please?

Best regards,
Petr
Plumsail team

So I'm using Plumsail forms and workflow action pack to generate a PO pdf. Which almost works except the image. I call Render Text Template with:
htmlcode
And then convert HTML to PDF and Save as Attachment. I just can't figure how to add the image logo.

Hi @bnunweiler,

To insert an image the HTML code should have an img tag: like

<img src="the base64 code">

You can also use an URL but in that case the image be publicly anonymously available (no authentication).

To isolate the issue try to add the img tag (just a static base64 value, not a variable) to your HTML and then generate a PDF.

Also you can try to open the HTML code in the browser and check if it shows the picture. If it works then the WAP action also should be able to insert the image.

Best regards,
Petr
Plumsail team

Yeah, my original post was how to get around the 256 character string length limit. My base64 character is about 5000. I was asking how you folks got around that. It's not clear from the article (which still isn't fixed). How do include a string in the img src base64 that's larger then the character length limit?

Hi @bnunweiler,

You can keep the base64 code value in a multiple lines of text column. There is a discussion in the MS forum, please check this.

Best regards,
Petr
Plumsail team

I have this working. I store the base64 in a separate list. Then the workflow loads it into a multiline field in the item. <img src="data:image/png;base64, [%Current Item:Logo%] />.

Thanks!

1 Like