gm
gm copied to clipboard
Appending Images and converting to multi page pdf
I want to append multiple png files and convert them to pdf, each png image on one page in pdf.
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.