About PDF creation

About PDF creation

I want to create PDF file on button click and that PDF should contain the values inserted in Text fields of same page. how i can do this ?
Please reply me as soon as possible its urjent.
Thank You...!
Hi Pankaj,

Have you tried the Html2PDFComponent. The component it self has a sample page that could perhaps guide you in that process.


It seems that you want to generate PDF only based on information that is not stored yet. If that is your case, you should target to generate the PDF based on client-side information using a framework that is capabilty of doing it like: BytescoutPDF or jsPDF li?brary.

Paulo Garrudo
Hi Pankaj,
I'm assuming you're using the HtmlConvertToPdf extension to generate that PDF. In that case, printing the information in the text fields is no different than the rest. You just need to make sure that the URL you pass to the GeneratePDF screen has all the required info for the page you're printing to show the existing details.

It is generally a best practice to create a specific screen to handle the printing of the information. It gives you more control on the layout, and generically better wraps the printing use case as opposite to the Edit use case. That said, you can see in the attached module an example with both approaches (the espace has 2 comments). Notice that we need to add the "ContactId" parameter, and only printing after the information has been saved in the database (because the GeneratePDF happens in a different request/transaction)

Hope it helps.
Thank you all Actually i tried with  Html2PDFComponent but it converting whole page to pdf than i dont want.
will try for  BytescoutPDF and jsPDF li?brary.