PXCp_GetPagesCount

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

PXCp_GetPagesCount

Post by jeffp »

I can open the attached file with PXCp_ReadDocumentW, but I get an exception when I try to check it's page count using PXCp_GetPagesCount. Is there something wrong with this file?

It opens and displays the pages fine in the ViewerAX.

Note: This file was create with an HP scanner using the default HP software that came with it.
Attachments
Test Scans for Unstacking.zip
(138.49 KiB) Downloaded 349 times
User avatar
Lzcat - Tracker Supp
Site Admin
Posts: 677
Joined: Thu Jun 28, 2007 8:42 am

Re: PXCp_GetPagesCount

Post by Lzcat - Tracker Supp »

Your file contains an incorrect xref table (actually there is one error with an incorrect first object number - it should be 0 instead of 1), and all object offsets are wrong (shifted).
xcpro cannot handle such files correctly and returns an error. When you say "get an exception" you mean that xcpro return error or it really crash? If it crash - which build are you using?
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: PXCp_GetPagesCount

Post by jeffp »

No crash. It just doesn't return 0 for success.

What does ViewerAX handle this just fine?

Is there nothing that can be done here or do the DLL controls just assume it's going to be right? Strange that this was created by HP software. You'd think they would get it right.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PXCp_GetPagesCount

Post by Tracker Supp-Stefan »

Hello jeffp,

The Viewer has a few more error correction features - and that's why it does handle the file fine, while the xcpro doesn't. I doubt anything can be done in v4 with v5 so close to release. So let's see if such error corrections will be present in ver5 of our SDKs, and if not - I will make the necessary ticket.

Best,
Stefan
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_GetPagesCount

Post by John - Tracker Supp »

When the Version 3 viewer and Version 5 libraries and drivers are released they will share the same common code set rather than being indepedant libraries and codes sets etc - so once done - all such features where appropriate will be present in all products as a matter of their 'DNA' - what works in one will work in the other etc...

Hope that helps
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: PXCp_GetPagesCount

Post by jeffp »

Can you download and test the follow:

http://www.lucion.com/files/PageCount.zip

Is it the same issue?

This file was created by an HP scanner.

Is it possible to fix the DLL to make this work. I'm starting to get more of these. Strange the HP won't create a good PDF file.

--Jeff
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_GetPagesCount

Post by John - Tracker Supp »

Hi Jeff,

Yes it does appear to be the same problem - we are not keen on modifying the existing libraries to encompass these changes - or any of a major nature as we are extremly committed to working on the overdue version releases as you know.

I will discuss with my colleagues how much work is required - if trivial we will try and do - but if as I suspect substantial changes are required then I must tell you in advance - this will not be possible and you will either need to use the Viewer SDK which can already re-save these files and correct such errors or await the new libraries.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: PXCp_GetPagesCount

Post by jeffp »

If it's going to be fixed in the new major release of the DLLs coming up in a few months, then I can just wait. I just would like to know for sure that it will work in the future.

You mentioned that in the new major release there will still be a set of SDK DLLs as well as the ActiveX viewer. Will these be running off the same code base? That is, things in the DLL should behave like the viewer and vice versa?
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_GetPagesCount

Post by John - Tracker Supp »

Hi Jeff,

Thanks for your understanding ... There is also one thing that may help you in the interim - if the HP scanner can create a 1.4 or 1.5 PDF version file - then this would most likely include all the required XREF info ...

With regards the V5 dll's and Viewer revisions - yes these all work off a common code base - its a single 'layered' set of libraries with the benefit that the XCPRO40 and PXCLIB40 dll's become a common library - so if a function is available when you modify a PDF - it will also be available for the most part when you create one - some functionality currently requires you save the file (with PXCLIB40) when creating and reopen after creation to allow manipulation with the XCPRO40 lib - this will no longer be required for the majority of such cases.

cheers
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: PXCp_GetPagesCount

Post by jeffp »

Looking forward to the new release. Is end of June still your target?
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: PXCp_GetPagesCount

Post by jeffp »

And don't forget the Delphi wrappers for the new DLLs :-)
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PXCp_GetPagesCount

Post by John - Tracker Supp »

Absolutley :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: PXCp_GetPagesCount

Post by Dorwol »

Hi,

Meanwhil 1 year later, I have the same problems.

PXCp_GetPagesCount still doesn't work properly! :(

Any solution meanwhile?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: PXCp_GetPagesCount

Post by Ivan - Tracker Software »

With the same document?
xcpro library has a quite limited ability to recover damaged PDF files and for such files it might not work properly.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: PXCp_GetPagesCount

Post by Dorwol »

Ivan - Tracker Software wrote:With the same document?
xcpro library has a quite limited ability to recover damaged PDF files and for such files it might not work properly.
No, not with the same document. With some documents from our customers. If I use your AX-Viewer, the viewer will tell the correct PagesCount. But I need this information with PXCp_GetPagesCount and not with the viewer.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PXCp_GetPagesCount

Post by Tracker Supp-Stefan »

Hi Dorwol,

Can you please provide the problematic sample file? If sensitive please send it to support@tracker-software with a link back to this topic.

Regards,
Stefan
prosozial_schmitt
User
Posts: 49
Joined: Tue Dec 28, 2004 9:49 am

Re: PXCp_GetPagesCount

Post by prosozial_schmitt »

Hello Stefan and Dorwol,

we had the same problem with some pdf-documents which were generated by HP Scanner Software. The property "pagesCount" could not be read by PdfTools.

For us, the problem is fixed with version 4.0.313.1 of Pdf Pro Library (xcpro40.dll). We can read the property without problems now. Even the simple viewer (pxcview.dll) can process the documents.

Greetings
Hans-Peter
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17822
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PXCp_GetPagesCount

Post by Tracker Supp-Stefan »

Hello Hans-Peter,

Many thanks for your input!
I hope Dorwool can also sort his issue by updating to 313.1.

Regards,
Stefan
Dorwol
User
Posts: 275
Joined: Mon Aug 04, 2008 5:04 pm

Re: PXCp_GetPagesCount

Post by Dorwol »

Thank you, will check it!
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: PXCp_GetPagesCount

Post by Will - Tracker Supp »

:)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply