boazsegev / combine_pdf

A Pure ruby library to merge PDF files, number pages and maybe more...
MIT License
733 stars 154 forks source link

Enable setting all document information dictionary entries #194

Open conorom opened 3 years ago

conorom commented 3 years ago

In one of my projects we've been using CombinePDF for some time to add watermarks to PDFs prior to download. Thanks for maintaining this very useful gem!

Recently we decided to edit the Keywords info dict entry at the same time, but CombinePDF doesn't allow this out of the box. I found it was easy to add a line to this area in a class_eval to set the Keywords value.

Is there a reason why all of the information dictionary entries shouldn't be added there?

Thanks again for your time.

FriscoTony commented 2 years ago

+1 I might try to take a stab at a pull request for this as I'm facing a similar issue. Super grateful for all the work that's gone into this library. My specific case is that I'm merging some PDFs and want to preserve the CreationDate of the original PDF.

But right now, this field gets explicitly deleted after parsing, and then it's also set explicitly to match the modification date when saving.

I'd like to:

If I manage to get a pull request created for this, I'll update.

Thanks again!