EvotecIT / PSWritePDF

PowerShell Module to create, edit, split, merge PDF files on Windows / Linux and MacOS
GNU Affero General Public License v3.0
195 stars 21 forks source link

PdfReader updated for SetUnethicalReading switch #29

Closed mccbryan3 closed 3 years ago

mccbryan3 commented 3 years ago

Updated Devops test Images and added switch parameter to PdfReader for SetUnethicalReading capabilties

PrzemyslawKlys commented 3 years ago

Except for 2 comments - rest looks amazing ;) Thank you

PrzemyslawKlys commented 3 years ago

I guess this will fix https://github.com/EvotecIT/PSWritePDF/issues/26

PrzemyslawKlys commented 3 years ago

Any reason why you're closing this one?

PrzemyslawKlys commented 3 years ago

Are you going to reopen this or should I treat this as you changed your mind on contributing?

mccbryan3 commented 3 years ago

Are you going to reopen this or should I treat this as you changed your mind on contributing?

The SetUnethicalReading setting doesn't quite do what I expect. This does not seem to be able to read all password protected files so it seems misleading. The current version of PSWritePDF gives me errors about password protected files on some files that I have that are not actually password protected and this setting seems to remedy that. I am still trying to figure out what exactly is different with these PDFs . This seems native to the iText7 so I am tyring to figure that out when I have time.

So.. This is a valid fix for me but not a "IgnorePasswordProtection" cover I think at the moment. The code as requested is complete and ready for the PR but there are these items mentioned.. Any thoughts on this?

Also I could not convert the PR to a draft so I closed it with the thought of reopening.

davisdan commented 2 years ago

@mccbryan3 the SetUnethicalReading switch doesn't allow reading of PDF files that are "user password" encrypted (i.e. you cannot open them without the password) but will allow reading of PDF files that are "owner password" encrypted for protection/security (e.g. preventing copying of text, printing etc). The terms are somewhat confusing and obviously in most cases it won't be any use trying to process encrypted PDF files that require a user password in a batch anyhow. It would be good if your changes were merged into the master as it would massively improve the ability for PsWritePDF to process automated batches of PDF's. Maybe the switch needs to be named IgnoreProtection without the word 'password' in it to reduce confusion.

https://kb.itextpdf.com/home/it7kb/faq/how-to-decrypt-a-pdf-document-with-the-owner-password

PrzemyslawKlys commented 2 years ago

Added and updated docs https://github.com/EvotecIT/PSWritePDF/commit/13b66fb932bbe5927d9a99b07c1c1588c53035e3

Added other stuff as well

PrzemyslawKlys commented 2 years ago

Thank you @mccbryan3 for your work! Appreciate it