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

pdfsharp "invalid predictor in array"
http://forum.pdfsharp.com/viewtopic.php?f=3&t=3713
Page 1 of 1

Author:  robberbaron [ Thu Jan 18, 2018 8:10 am ]
Post subject:  pdfsharp "invalid predictor in array"

error throws on PDFSharp.Open; occurs on both beta4 and beta5
System.ArgumentException: Invalid predictor in array
Quote:
at PdfSharp.Pdf.IO.Parser.DecodeCrossReferenceStream(Byte[] bytes, Int32 columns, Int32 predictor)
at PdfSharp.Pdf.IO.Parser.ReadXRefStream(PdfCrossReferenceTable xrefTable)
at PdfSharp.Pdf.IO.Parser.ReadXRefTableAndTrailer(PdfCrossReferenceTable xrefTable)
at PdfSharp.Pdf.IO.Parser.ReadTrailer()
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider)
at PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode)
at DocMan.DocQA.CheckSignatureData(String pathtoQAForm, Int32 QAId, String ProjId) in C:\Users\gray\Dropbox\devel\idev\BW_Forms\branches\n3\App_Code\CS\QA\DocQA.cs:line 160


Code:
           try
            {
                PdfDocument pdfQA = PdfReader.Open(pathtoQAForm,PdfDocumentOpenMode.ReadOnly);


Same code works fine on 30+ other almost identical PDFs. In the error case, the file is signed (3 fields) using both Bluebeam & Acrobat, which is unusual for us. (Generally just Bluebeam and all works fine.)
File displays correctly using Bluebeam, Edge, Win10 Reader, Chrome, PDF ExchangeEditor. Form fields (other then signatures) were filled out using PdfSharp library. (had to split to get under 250k)

Not critical as I can update database manually upon the error report.

Attachments:
File comment: part2
QA_16251-01599-002.zip [61.97 KiB]
Downloaded 862 times
File comment: zip file spilt. using 7zip
QA_16251-01599-001.zip [200 KiB]
Downloaded 817 times

Author:  Thomas Hoevel [ Thu Jan 18, 2018 9:30 am ]
Post subject:  Re: pdfsharp "invalid predictor in array"

Hi!
I cannot tell whether the file is corrupt or the implementation of PDFsharp is incomplete.
But Adobe Reader shows that there is a problem with a signature:
Attachment:
forum_18-01-18_signature-problem.png
forum_18-01-18_signature-problem.png [ 4.38 KiB | Viewed 12441 times ]


Not my area of expertise. I'll let you know when I get feedback from the experts.

Author:  robberbaron [ Sun Jan 21, 2018 10:12 pm ]
Post subject:  Re: pdfsharp "invalid predictor in array"

Thanks.

Ironically, I suspect it is the signature applied by Adobe Reader that is the problem

R

Author:  cschneider [ Mon Aug 17, 2020 7:01 pm ]
Post subject:  Re: pdfsharp "invalid predictor in array"

Is there any other update to this? The pdf I am using is not signed and getting the same error/call stack when calling XPdfForm.FromStream(). I use the same method with other pdfs without issue.
The pdf version is 1.6 (Acrobat 7.x) and the pdf producer is Bluebeam PDF Library 2017. Some of the other pdfs are at the same version but appear to not match on the same year for the producer. Is there something to be done to target a specific pdf producer?

PDFSharp version is 1.50.5147.

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