-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Allow password at constructor #910
Conversation
Codecov Report
@@ Coverage Diff @@
## main #910 +/- ##
==========================================
+ Coverage 77.81% 77.96% +0.15%
==========================================
Files 16 16
Lines 4327 4321 -6
Branches 812 815 +3
==========================================
+ Hits 3367 3369 +2
+ Misses 788 780 -8
Partials 172 172
Continue to review full report at Codecov.
|
Thank you for the PR ❤️ I can see where you're coming from / why you added it. I thought about this a couple of times myself as well. I'm torn between two philosophies here:
Looking at similar libraries:
What is your opinion @MasterOdin ? |
@MartinThoma pikepdf offers a I'm guessing that most people will always want to decrypt a PDF that's being read in before doing any other operations, I feel like baking it into the constructor makes sense. |
This is a convenience change. You can still call `reader = PdfReader("encrypted.pdf"); reader.decrypt(password)`. Full credit to pubpub-zz; I just made stylistic changes. Closes #910 Co-authored-by: pubpub-zz <[email protected]>
adding new optional parameter at PdfReader