Example of creating a PDF using Python script
- Updated: 2024/10/16
Example of creating a PDF using Python script
Build an automation that runs Python script from a file and generates a PDF. Python is used in automation, data generation, and conversion to various formats, including the widely used PDF.
PDFs are a portable format, making them ideal for viewing data across different devices and platforms. Python offers a diverse range of libraries for PDF generation, each with its unique features and capabilities. For example, FPDF, ReportLab, Pyppeteer, and Pdfkit.
Prerequisites
- To run Python script from Automation 360, you must already have the latest version of Python 3.x installed on your device.
- This example uses the FPDF library to generate the PDF. FPDF, a python library that
has been ported from PHP, is a powerful tool for generating PDFs. It offers a range
of functionalities, from generating PDFs from text files to writing your data formats
to generate PDFs. Therefore, install it before you start building this automation by
copying and pasting the following line in the Windows command
prompt:
See FPDF project page.pip install fpdf