gm icon indicating copy to clipboard operation
gm copied to clipboard

Appending Images and converting to multi page pdf

Open SafouraBahrami opened this issue 6 years ago • 1 comments

I want to append multiple png files and convert them to pdf, each png image on one page in pdf.

SafouraBahrami avatar Jun 25 '18 16:06 SafouraBahrami

Might be too late for this but my solution for this was using another library for making PDFs called pdf-kit

I took every instance of images and saved them into an array, then looping through them i inserted each image as a base64 into each page (since pdf-kit accepts base64 as images)

Granted i did have to wrap the function to change it to base 64 so it's much more readable when using async/await, since you have to use async/await to get the base64 image.

Ledslash avatar Jul 02 '19 18:07 Ledslash