Create PDF With Random Content and Variable Size - R - Learnpython
Create PDF With Random Content and Variable Size - R - Learnpython
2 1 Share
Add a comment
vidoardes • 1y ago •
vidoardes
You don't need python to do this, easiest and free way is to use HTML/CSS and PagedJS. Use the browsers
print to PDF function to create PDF files from HTML, and HTML is infinitely template-able.
There is little information about how you want to do this - will this be from your machine, or from a
website?
Depending on your use case you could use Python to craft a template with something like Jinja, or send
your template HTML and a data file (JSON) to a headless instance of Chrome, use a JS library like
Handlebars to do the templating and download the PDF (have done with with AWS lambda) in a single
API call.
2 Reply
1 de 1 15/11/2024, 23:31