jjwilly16 / node-pdftk

A wrapper for PDF Toolkit with streams and promises.
MIT License
139 stars 33 forks source link

Insert Images #14

Closed ahermundson closed 5 years ago

ahermundson commented 6 years ago

Is your feature request related to a problem? Please describe. I was wondering if it would be possible to insert images.

Describe the solution you'd like Pass a dataUri or ArrayBuffer on the data object and insert the image.

Thanks for all your work on this library. It works great!

jjwilly16 commented 6 years ago

Sorry, this is out of scope for this project. This is just a wrapper around PdfTk. If someone showed me that this was possible to do with this tool, I'd be happy to look into it, but I'm pretty sure it's not.

There are ways to stamp an image onto a PDF, but it's a little more involved. You can create a transparent PDF with your image pre-placed on it then stamp it onto the source PDF - or create this stamp file dynamically with something like pdfkit.

I'll create an example and post a link here - I'll keep this issue open for now.

ahermundson commented 6 years ago

No apologies necessary. Thanks for the information. I will look into pdfkit. Thanks.