PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Dec 12, 2017 4:45 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Apr 07, 2017 12:06 pm 
Offline

Joined: Fri Apr 07, 2017 11:37 am
Posts: 1
Hi Team,

We are using PdfSharp 1.3 version, while processing the PDF file we are getting error "Non-negative number required".
So to check the issue we have downloaded the latest version 1.5 beta 3 and checking in debug mode.

I am getting this issue while reading the below code when it tries to read the indirect objects from the PDF file.
File Name: PdfReader.cs

PdfReference[] irefs = document._irefTable.AllReferences

PdfReference iref = irefs[idx];
if (iref.Value == null)

Getting the below error message:

Exception message: Non-negative number required.
Parameter name: value

Observation while debugging the source code, I found in the below section of

// 3rd: Create iRefs for all compressed objects.
PdfCrossReferenceStream.CrossReferenceStreamEntry item = xrefStream.Entries[idx2];

// Is type xref to compressed object?
if (item.Type == 2)
{
// Here it is adding the null value in the dictionary object named "objectStreams"
}

Please find below stack trace details:

at System.IO.FileStream.set_Position(Int64 value)
at PdfSharp.Pdf.IO.Lexer.set_Position(Int32 value) in ..\PDFsharp\src\PdfSharp\Pdf.IO\Lexer.cs:line 71
at PdfSharp.Pdf.IO.Parser.MoveToObject(PdfObjectID objectID) in ..\PDFsharp\src\PdfSharp\Pdf.IO\Parser.cs:line 80
at PdfSharp.Pdf.IO.Parser.ReadObject(PdfObject pdfObject, PdfObjectID objectID, Boolean includeReferences, Boolean fromObjecStream) in ..\PDFsharp\src\PdfSharp\Pdf.IO\Parser.cs:line 121
at PdfSharp.Pdf.IO.Parser.GetStreamLength(PdfDictionary dict) in ..\PDFsharp\src\PdfSharp\Pdf.IO\Parser.cs:line 333
at PdfSharp.Pdf.IO.Parser.ReadObject(PdfObject pdfObject, PdfObjectID objectID, Boolean includeReferences, Boolean fromObjecStream) in ..\PDFsharp\src\PdfSharp\Pdf.IO\Parser.cs:line 263
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) in ..\PDFsharp\src\PdfSharp\Pdf.IO\PdfReader.cs:line 430

Please find attached file for More Information.

Please help to sort out the issue with the PDFsharp 1.5 beta version.

Thanks & Regards,
Suresh


Attachments:
File comment: Source File Name: Parser.cs
PdfObjectStream Error.png
PdfObjectStream Error.png [ 75.44 KiB | Viewed 817 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group