-
Notifications
You must be signed in to change notification settings - Fork 13
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
Null Reference exception when Encrypting a PDF document #7
Comments
This is probably an issue, since I didn't try this before. I have no idea if this is implemented properly. Will look into it withing the next couple of weeks. |
Actually someone pretty much copied this project XD. |
I have a working solution (although I'm not involved in the spinned-off Didstopia project).
Before saving the generated document, you should set some properties like the following:
|
Well, not enough... For me is working by commenting those lines out:
|
I'm not familiar with that part of the code - feel free to send a pull request if you have a good solution. |
PfdSharpCore throws a SystemNullReferenceException when I try to render a document that has had encryption enabled via the PdfSecuritySettings.DocumentSecurityLevel setting.
Stack trace points at
PdfSharpCore.Pdf.Security.PdfStandardSecurityHandler.ComputeOwnerKey(Byte[] userPad, Byte[] ownerPad, Boolean strongEncryption)
for 128 bit encryption, andPdfSharpCore.Pdf.Security.PdfStandardSecurityHandler.PrepareRC4Key(Byte[] key, Int32 offset, Int32 length)
for 40 bit encryption (1 level deeper).Project is a UWP application targeting Windows 10.
Is there any pre-configuration that is required (similar to Fonts) for document encryption, or is this an issue that merits investigation?
Thanks.
The text was updated successfully, but these errors were encountered: