PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

PDF document could not be decrypted
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4316
Page 1 of 1

Author:  sandro.knapp [ Wed Jan 19, 2022 7:28 am ]
Post subject:  PDF document could not be decrypted

Good morning,

My name is Sandro Knapp and this is my first post in the forum :)

we are using the pdfsharp library on C# projects to adapt PDF files.
In some cases we run into errors.

May a short summary, what the programm is doing:
a PDF document is sent by mail to specific address. The programm takes the attachment from the mail.
A header page is added to the document and further saved to specific path.

In some cases we receive following error messages:
PdfSharp.Pdf.IO.PdfReaderException: Das PDF-Dokument ist mit einer von PDFsharp nicht unterstützten Verschlüsselung geschützt.
bei PdfSharp.Pdf.Security.PdfStandardSecurityHandler.ValidatePassword(String inputPassword)
bei PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
bei PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider)
bei PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode)
bei SRDII.doc.merge_pdfs_isharp(String targetPath, String pdf_one, String pdf_two) in C:\Program Files (x86)\Rethink Fintech\SRDII\SRDII\doc.cs:Zeile 110.

It seems that those documents have an unsupoorted encryption.
Those documents are sent by several external partners.

Unfortunately I am not able to attach an example, as the size of the document is too big (700 KB, max size 256 KB).
Compression an zipping even not big.

Do you have any ideas, how we are able to solve our issue?

If you need further information, please don't hesitate to ask.

Thank you for your assistance

Regards
Sandro

Author:  sandro.knapp [ Fri Feb 04, 2022 1:08 pm ]
Post subject:  Re: PDF document could not be decrypted

Dear Support team,

does anyone has a feedback or idea for me regarding that topic?

Thank you for your assistance

Regards
Sandro

Author:  (void) [ Sat Feb 05, 2022 8:55 am ]
Post subject:  Re: PDF document could not be decrypted

Haven't worked on it for a while, but i once forked the Library to add some features (like adding support for additional encryptions).

https://github.com/packdat/PDFsharp/tree/AcroForms

Note this fork also contains code to enhance AcroFields, which may not be what you want. (as it is in an "experimental" state)
I suggest you fork the official version and merge only the changes you need for encryption.
(look into the PdfSharp.Security Namspace)

Author:  sandro.knapp [ Wed Feb 09, 2022 10:00 am ]
Post subject:  Re: PDF document could not be decrypted

Thank you for this feedback.
We are going to try with this solution and come back, if it is not working

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/