boazsegev / combine_pdf

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

CombinePDF.encrypted? #176

Closed leviwilson closed 4 years ago

leviwilson commented 4 years ago

In using CombinePDF, we have a need to understand whether or not a PDF is encrypted with a password or not.

Given that CombinePDF will silently fail in this event, we don't really have a recourse for testing if it is or is not encrypted. Furthermore, we also have scenarios where we have password protected PDFs and we get a https://github.com/boazsegev/combine_pdf/issues/155 issue (Zlib::DataError).

What We Did

leviwilson commented 4 years ago

I'm going to close this for now and try to move this into the PDF class. I'll re-open after we switch things around, thanks @boazsegev

leviwilson commented 4 years ago

@boazsegev please provide feedback on https://github.com/boazsegev/combine_pdf/pull/177 that we just opened. This should avoid the double-parsing of the PDF object and allow for the user to opt into throwing a CombinePDF::EncryptionError in the event that the PDF is encrypted.

reiz commented 3 years ago

@boazsegev CombinePDF.encrypted? would be very useful to provide feedback to the user.