PDF not generation properly using PDFGenerationAPI

Hrishabh Kumar
Giga Guru

I am working with 

PDFGenerationAPI api.

I am trying to use 

convertToPDF(String html, String targetTable, String targetTableSysId, String pdfName) function.

 

PDF is getting generated but with the HTML text, I need the outcome of the HTML to be generated as PDF.

 

I have elaborated the scenario below.

 

After Business rule to created and attach pdf on user table.

It is working properly.

cert1.PNG

cert2.PNG

 

u_pdf_templates table form.

cert3.PNG

 

 

The generated PDF contains the html text present in the "u_certificate" field but I want the output of the HTLM to be generated as PDF.

 

PDF should look like this below.

currently the pdf is getting generated with the HTML text.

cert4.PNG

 

1 ACCEPTED SOLUTION

Nick Parsons
Mega Sage

Hi @Hrishabh Kumar,

From your screenshot, it appears that in your Pdf Template record you have added your HTML as plain text, which will result it it being escaped. Instead, try adding via the HTML code editor by clicking the code <> button and pasting your HTML string into the popup instead:

NickParsons_0-1690358787026.png

 


 

View solution in original post

3 REPLIES 3

Nick Parsons
Mega Sage

Hi @Hrishabh Kumar,

From your screenshot, it appears that in your Pdf Template record you have added your HTML as plain text, which will result it it being escaped. Instead, try adding via the HTML code editor by clicking the code <> button and pasting your HTML string into the popup instead:

NickParsons_0-1690358787026.png

 


 

Thanks for the solution. @Nick Parsons 

yasseeer-b
Tera Contributor

Hi, did this code work for you ? i tried the same thing but the pdf is not being attached to the record.