PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Sep 22, 2020 5:13 pm

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: Thu May 07, 2020 11:09 pm 
Offline

Joined: Mon Jul 17, 2017 6:00 am
Posts: 3
Hi,
when I do pdfreader.open:
===========
Try
InputDocument = PdfReader.Open(PercorsoFileFormulari, PdfDocumentOpenMode.Import)
Catch ex As Exception
===========
(where PercorsoFileFormulari is the full path PDF location - sorry for the Italian) on a particular PDF file (2 pages), I miss the first page.

I develop in VB/VS2019. I never had this issue before (as far as I know..) by years that I am using my code (from VS2015 to VS2017 and 2019) as well as PDFReader. So this appears to be a very very special case.

Could someone please help me?
Thanks


Top
 Profile  
Reply with quote  
PostPosted: Fri May 08, 2020 8:00 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 567
Location: CCAA
Most likely a corrupt PDF file.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 08, 2020 11:02 pm 
Offline

Joined: Mon Jul 17, 2017 6:00 am
Posts: 3
Quote:
Most likely a corrupt PDF file.


You right. After your suggestion I verified it is a corrupt file. I also verified that other PDF readers read the pages number correctly, i.e. 2.

This is a serious problem. I use PDFSharp in an application that create 1 PDF file from *each* page of incoming PDF. In this moment I don't know what the real number of pages number for that file is.
It means I can't take any countermeasure or rely on any workaround, which instead is the case for corrupted PDF file I already met (in this case I open+save that PDF in another reader and after that use PDFSharp).
So missing the correct numer of pages means that I loose documents, and I will never know it existed. This is a serious issue for using PFSharp in an application.

Is there a way to overcome this problem?


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: No registered users and 8 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