Opening Blank PDFs

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

jeffp
User
Posts: 923
Joined: Wed Sep 30, 2009 6:53 pm

Opening Blank PDFs

Post by jeffp »

In prior builds, the ViewerAX allowed me to open a blank PDF, that is a PDF with no pages. In build 189, when I try to open such a PDF I get a message that says:

Error opening document
"FileName":
Error [Application]: Document has no pages

The reason I open a blank PDF with no pages is during my scan processes. When I initiate my scan process (which is separate from the one built in to the Viewer), I load a blank PDF with no pages, then I build and show each page in the viewer as in comes in from the scanner.

Was this an oversight or will I need to update my code to delete the first blank page once the first page of the scan comes in.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Opening Blank PDFs

Post by Vasyl - PDF-XChange »

Hi, jeffp.
In build 189, when I try to open such a PDF I get a message that says:
Error opening document
"FileName":
Error [Application]: Document has no pages
Yes, it is normal behavior. This fix was added in build 189 because some end-users tried opening some pdfs without any pages - which can produce some strange result in our PDF-Viewer.
Was this an oversight or will I need to update my code to delete the first blank page once the first page of the scan comes in.
Yes, please update your code to delete the first stub-page, note - after inserting other new pages. Thanks.

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.