Dynamic PDF
In this video tutorial you will understand how to generate dynamic PDF using your collection data such as invoices, receipts, reports and much more.
Intro
Dynamic PDFs in a web app involve generating personalized PDF documents in real-time, typically from database-driven content like invoices or reports, and dynamically embedding data into predefined templates for user-specific information.
Let's look at the usecase below for a better understanding.
1. Create PDF snippet
Go to Snippets, choose Add Snippet. Then choose the PDF Template option. Choose the Collection for the PDF and click Create Snippet.
2. Bind a Collection to PDF Snippet
Open the Snippet and choose a collection to bind to the snippet from which you can download data.
3. Create Event to Generate PDF
Go to Events and choose Add Event. Here choose Snippet > Generate PDF from Snippet.
4. Drop Page Component
Drop any Components, say, Data Table. Open its Settings and bind the collection to the page component (Data Table).
5. Bind Event to the Component
Open the Settings of the Button and choose the event to bind to it; so, whenever you click it it will run the event to generate PDF.
6. Download PDF
Now that the settings are in place you can use the Preview or the Publish options to generate and download the PDF.
Conclusion
When you automate the process of generating PDF documents based on dynamic data, you streamline repetitive tasks that would otherwise be time-consuming and error-prone if done manually.