PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
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 16010 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed May 17, 2023 6:05 am 
Offline

Joined: Wed May 17, 2023 6:02 am
Posts: 1
same error happened on my api .net core 5 and this lib version 1.50.5147


Top
 Profile  
Reply with quote  
PostPosted: Wed May 17, 2023 6:39 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
chameleon wrote:
same error happened on my api .net core 5 and this lib version 1.50.5147
If you are able to replicate the issue with the latest preview of PDFsharp 6.0.0, please use the Issue Submission Template to let us investigate it.
https://docs.pdfsharp.net/General/IssueReporting.html

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 50 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