PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon May 06, 2024 4:42 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: Mon Feb 09, 2009 12:28 pm 
Offline

Joined: Mon Feb 09, 2009 12:21 pm
Posts: 2
I have written a command-line based app that simply iterates around a directory of PDFs and gets their page count using :

Code:
 try
            {
                PdfDocument pdf = PdfReader.Open(file, PdfDocumentOpenMode.ReadOnly);
                int ret = pdf.Pages.Count;
                pdf.Dispose();
                return ret;
            }
            catch
            {
                return -2;
            }


Occasionaly, a PDF cannot be opened and the built in error message pops up. Is there anyway to supress this message and allow my error trapping to be used?

Thanks.

Bev


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 09, 2009 1:55 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
This is open source, so the answer is: Yes! :wink:

But seriously:
Are you using a DEBUG build? To get rid of Debug.Assert messages, simply use a RELEASE build.

If you're seeing MessageBoxes not caused by Debug.Assert then please let me know.
AFAIK there shouldn't be MessageBoxes popping up (except some Debug.Asserts).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Feb 10, 2009 12:37 pm 
Offline

Joined: Mon Feb 09, 2009 12:21 pm
Posts: 2
I have downloaded the newest version and the PDF that was having a problem is not anymore, so not sure wether the old version I had was a debug version, or the new version has a bug fix in it for the specific problem my PDF has!

Anyway, thanks for the reply :)


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 76 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