Page 1 of 1
GetPagesCount Error
Posted: Mon Oct 24, 2011 7:03 pm
by glima
I am using the PXCp_GetPagesCount function and on some PDF's it returns an error PS_ERR_REQUIRED_PROP_NOT_SET.
If I let the process continue I get DPro_Err_WrongPageNumber from the PXCp_PageGetBox for the MediaBox ID.
Re: GetPagesCount Error
Posted: Mon Oct 24, 2011 7:50 pm
by John - Tracker Supp
Hi - can you post a couple of example files and sample code snippet used so we can check please?
Thanks
Re: GetPagesCount Error
Posted: Sat Oct 29, 2011 2:23 am
by glima
The code does this.
if (PXCp_Init(&hFileHandle, PFXGLO_SerialKey4, PFXGLO_DevCode4) == 0)
{
if (PXCp_ReadDocumentW(hFileHandle, FileNameW, 0) == 0)
{
if ((err = PXCp_GetPagesCount(hFileHandle, &lDocumentPages)) != 0 )
printf("ProcessFiles - Get Pages Count = %d",&err);
I have attached a test_a.zip file that returns an error.
Re: GetPagesCount Error
Posted: Mon Oct 31, 2011 9:40 am
by Lzcat - Tracker Supp
Hi,
This file is broken (the xref table is incorrect) and I am afraid that the xcpro40.dll library can work only with in tact files - correctly formatted.
I assume this is a one of file - if you have multiple files such as this you may want to contact the source and advise them - also opening in our Viewer 'may' allow in some cases such files to be re-saved and the issue corrected - the next major releases of our libraries will also include similar functionality - though it is far from possible to correct all problems in all files - so please dont expect a 'panacea' for all problem files.
Re: GetPagesCount Error
Posted: Thu Oct 04, 2018 1:29 pm
by igor_p
Hello,
I have exactly the same problem as described in this topic. Could you, please, check attached PDF file and tell me what is wrong with it? I thought that it simply does not contain a "/Count" property, but it is available:
Code: Select all
<<
/Type /Pages
/Kids [ 3 0 R 7 0 R 10 0 R 13 0 R 16 0 R]
/Count 5
>>
I'm trying to set up a document scanner which will produce PDF documents compatible with your software, but without success so far. Any suggestions will be much appreciated.
Regards,
Igor Paszewski
Re: GetPagesCount Error
Posted: Thu Oct 04, 2018 3:12 pm
by Lzcat - Tracker Supp
Hi Igor.
Yes, this file contains exactly same error -
Incorrect XRef table.
Code: Select all
xref
1 19
0000000000 65535 f
0000000009 00000 n
0000450623 00000 n
0000450720 00000 n
0002714178 00000 n
0000450907 00000 n
0000984635 00000 n
0000984732 00000 n
0000984919 00000 n
0001503370 00000 n
0001503467 00000 n
0001503655 00000 n
0002018134 00000 n
0002018232 00000 n
0002018422 00000 n
0002713890 00000 n
0002713988 00000 n
0002714263 00000 n
0002714315 00000 n
trailer
<<
/Size 19
/Root 17 0 R
/Info 18 0 R
>>
Error is in string
- it should be
If you read PDF specification you will see that objects numbers in xref are shifted by 1 regarding to real. This is known issue of some software that scan to PDF.
All we can help with this is advise to switch from old SDK to new one -
Core API SDK or
Editor SDK, depending on you needs. Both of them are more powerful and handle most kinds of broken files, same as end user Editor.
HTH.