0% found this document useful (0 votes)
59 views

Create PDF With Random Content and Variable Size - R - Learnpython

The user asked what library is suited for creating PDFs of variable length with some text and/or pictures. Another user responded that using HTML/CSS with the browser's print to PDF function through PagedJS is the easiest and free way to do this. They suggested using a templating system like Jinja if doing it from a machine or sending templated HTML and data to a headless Chrome instance using a JS library like Handlebars for a single API call.

Uploaded by

asifhaidertg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Create PDF With Random Content and Variable Size - R - Learnpython

The user asked what library is suited for creating PDFs of variable length with some text and/or pictures. Another user responded that using HTML/CSS with the browser's print to PDF function through PagedJS is the easiest and free way to do this. They suggested using a templating system like Jinja if doing it from a machine or sending templated HTML and data to a headless Chrome instance using a JS library like Handlebars for a single API call.

Uploaded by

asifhaidertg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

3/1/24, 8:14 PM Create PDF with random content and variable size : r/learnpython

Skip to main content


r/learnpython Search in r/learnpython Log In

r/learnpython • 8 mo. ago


InternetSea8293

Create PDF with random content and variable size


I want to code a programm that can create PDFs of Variable lenght with some text and/or pictures.

What library is suited for this?

1 1 Share

u/grabthegamespr • Promoted

Summon your Guardians and get into the minds of the cursed villagers in Thyria.

store.steampowered.com Learn More

Sort by: Best

Add a Comment

vidoardes • 8mo ago

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 Share

More posts you may like

r/learnprogramming

How to create PDFs with a web application?


2 upvotes · 3 comments

https://www.reddit.com/r/learnpython/comments/14jcy6w/create_pdf_with_random_content_and_variable_size/ 1/3
3/1/24, 8:14 PM Create PDF with random content and variable size : r/learnpython

r/Wordpress
Skip to main content
Log In
Sync a locally created HTML file with Wordpress
7 upvotes · 18 comments

r/Wordpress

[Making PDF that includes search results of a custom post type]Can you just guide me to the way of doing
the following?
2 upvotes · 1 comment

r/webdev

Added a function to save a webpage as PDF file, but it saves in two pages instead of one
2 comments

r/salesforce

Exporting SF Flow Data Table to Excel or CSV systematically


2 upvotes · 5 comments

r/Wordpress

Display and edit a subset of custom fields on a page?


1 upvote · 5 comments

r/software

Quickly fill multiple pdf forms just with 1 variable input


1 upvote · 1 comment

r/neovim

How to store a set of macros into a file?


2 upvotes · 6 comments

r/godot

How to create an .import file for an uploaded image?


3 comments

r/FigmaDesign

Can I create a template? I can't find a straight answer on Google or chatGPT, so asking here.
5 upvotes · 7 comments

r/Wordpress

https://www.reddit.com/r/learnpython/comments/14jcy6w/create_pdf_with_random_content_and_variable_size/ 2/3
3/1/24, 8:14 PM Create PDF with random content and variable size : r/learnpython

How can I add theeejs to a WordPress website?


Log In
1 upvote · 2 comments

r/PrintedCircuitBoard

Creating a pick and place file with only gerbers and BOM, possible?
1 upvote · 3 comments

r/techsupport

How Do I Open And Modify .DLL Files?


16 comments

TOP POSTS

Reddit

reReddit: Top posts of June 26, 2023

Reddit

reReddit: Top posts of June 2023

Reddit

reReddit: Top posts of 2023

https://www.reddit.com/r/learnpython/comments/14jcy6w/create_pdf_with_random_content_and_variable_size/ 3/3

You might also like