Generate and control PDF file size with JS

Asked

Viewed 78 times

0

Good night, you guys!

I wanted to know how to work with PDF through javascript!

My idea is relatively simple:

I want the user to upload images that will generate a PDF, and if the PDF has more than 5MB, it will split the PDF.

Imagine that the user uploaded 100 images that would generate a PDF of 15MB. In case the algorithm would generate 3 Pdfs with 5MB each.

Does anyone have any idea where I should start?

  • if the user uploaded the images, then they must be on the server, so it makes no sense to generate the pdf using javascript, unless the code is in nodejs

  • vdd! I didn’t mind this detail! But how would I do if it were in nodejs?

  • has several examples on the internet, has this stackoverflow in English that does what you need, I think it will help: https://stackoverflow.com/questions/51054745/convert-multiple-images-into-single-pdf-using-nodejs

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.