PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:30 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Dec 08, 2022 4:46 pm 
Offline

Joined: Thu Dec 08, 2022 3:40 pm
Posts: 1
Hi,
PDFSharp Version : PDFsharp v1.5 beta 5
Tried to modify metadata of protected pdf file below but an exception thrown "Header checksum illegal".
Code:
        private void UpdateDefaultMetadeta_Click(string path, string password)
        {
            string path = filePathTextBox.Text;
            if(!File.Exists(path)) return;
            PdfDocument document = PdfReader.Open(path, password, PdfDocumentOpenMode.Modify, PdfPasswordProvider);//PdfReader.Open(path,PdfDocumentOpenMode.Modify, PdfPasswordProvider);
            document.Info.Author = "Sharp 1";
            document.Info.Creator = "Sharp 2";
            document.Info.Title = "Sharp 3";
            document.Info.CreationDate = DateTime.Today;
            document.Info.Keywords = "Sharp 4";
            document.Info.ModificationDate = DateTime.Today;
            document.Info.Subject = "Sharp 5";
            //document.Info.Producer = "Sharp 6";
            //document.Save("Result");
            document.Save(path);
        }

Exception stack Trace detail:
at PdfSharp.SharpZipLib.Zip.Compression.Inflater.DecodeHeader() in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\SharpZipLib\Zip\Compression\Inflater.cs:line 255
at PdfSharp.SharpZipLib.Zip.Compression.Inflater.Decode() in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\SharpZipLib\Zip\Compression\Inflater.cs:line 465
at PdfSharp.SharpZipLib.Zip.Compression.Inflater.Inflate(Byte[] buffer, Int32 offset, Int32 count) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\SharpZipLib\Zip\Compression\Inflater.cs:line 813
at PdfSharp.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\SharpZipLib\Zip\Compression\Streams\InflaterInputStream.cs:line 743
at PdfSharp.Pdf.Filters.FlateDecode.Decode(Byte[] data, FilterParms parms) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf.Filters\FlateDecode.cs:line 196
at PdfSharp.Pdf.Filters.Filter.Decode(Byte[] data) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf.Filters\Filter.cs:line 73
at PdfSharp.Pdf.Filters.Filtering.Decode(Byte[] data, PdfItem filterItem) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf.Filters\Filtering.cs:line 208
at PdfSharp.Pdf.PdfDictionary.PdfStream.TryUnfilter() in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf\PdfDictionary.cs:line 1738
at PdfSharp.Pdf.Advanced.PdfObjectStream..ctor(PdfDictionary dict) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf.Advanced\PdfObjectStream.cs:line 67
at PdfSharp.Pdf.IO.Parser.ReadIRefsFromCompressedObject(PdfObjectID objectID) in d:\SD_Codes\PDFSharp\PDFsharp-POC\PDFsharp\src\PdfSharp\Pdf.IO\Parser.cs:line 840
----------------------------------------------------------------
We used password protected pdf file, encryption type: RC4 (128 bit).
Kindly help to improve this issue.

Thank in advance.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 08, 2022 4:54 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 339
Hi!
qsaddam wrote:
We used password protected pdf file, encryption type: RC4 (128 bit).
We don't have that PDF.

We have created Issue Submission Templates for both PDFsharp and MigraDoc.
See also:
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 123 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group