"Invalid xref table" using PXCp_ReadDocumentW

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools Version 4

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

Post Reply
Max SAG
User
Posts: 30
Joined: Thu Oct 30, 2014 8:54 am

"Invalid xref table" using PXCp_ReadDocumentW

Post by Max SAG » Thu Apr 14, 2016 3:10 pm

Hi,

We are using the PDF-Tools SDK and one of our customer encounters an issue with the XCPro40 library (4.0.311.0) in a WPF project (C#/XAML, .Net 4.0, x86) with one of our application.

We can not reproduce the issue on our side with the same PDF files our customer uses. But it happens every time on his Microsoft Surface Pro 3.0. Here his the methods the application uses:

Code: Select all

public static extern int PXCp_Init(out int pObject, string Key, string DevCode);
public static extern int PXCp_ReadDocumentW(int pObject, [MarshalAs(UnmanagedType.LPWStr)] string pwFileName, int iFlags);
After the initialization, the application tries to read the document but encounters the following error:
PS_ERR_WrongXRef 0x820f27b1 Invalid reference table (xref)
On an other file, an other error happens when trying to get the page count:

Code: Select all

public static extern int PXCp_Init(out int pObject, string Key, string DevCode);
public static extern int PXCp_ReadDocumentW(int pObject, [MarshalAs(UnmanagedType.LPWStr)] string pwFileName, int iFlags);
public static extern int PXCp_GetPagesCount(int pDocument, out int count);
After the initialization and the reading, the application tries to get the page count and encounters the following error:
PS_ERR_InvlaidObjStruct 0x820f27ab Invalid object structure
As I said, we can not reproduce those issues on our side (with the same documents) but it happens each time we try on his side.
Do you have any idea what can cause those problems (memory size, Windows version, etc.)? I don't think it comes from the PDF documents because they work well on our side with the same code.

Best regards,

Max

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

Re: "Invalid xref table" using PXCp_ReadDocumentW

Post by Tracker Supp-Stefan » Thu Apr 14, 2016 3:46 pm

Hello Max,

When you say "with the same documents" - is that actually with copies of the same files, or the same type of file - but actually different ones? It could be that the files on his machine are corrupted, and the Tools SDK does not have the correction tools needed - so whenever it encounters a broken PDF file it will show an error, even if e.g. our Editor displays that file OK as the Editor can correct the file on the fly before displaying it.

Regards,
Stefan

Max SAG
User
Posts: 30
Joined: Thu Oct 30, 2014 8:54 am

Re: "Invalid xref table" using PXCp_ReadDocumentW

Post by Max SAG » Thu Apr 14, 2016 4:59 pm

Hi Stefan,

Thanks for your reply. Indeed, we tried to reproduce the problem with copies of the same files. But I doubt that copying and sending us the files could have "corrected" them. But I'll check with him if the files could have been corrupted on his tablet only (due to the Antivirus, a failed copy, etc.).

Best regards,

Max

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

Re: "Invalid xref table" using PXCp_ReadDocumentW

Post by Tracker Supp-Stefan » Fri Apr 15, 2016 10:00 am

Hi Max,

Yes - it could be something specific to that device that corrupted the files. Copying them from a third source to both his device and a PC without issues would indicate that something happens with the files at the moment of copying them to that tablet.

Regards,
Stefan

Max SAG
User
Posts: 30
Joined: Thu Oct 30, 2014 8:54 am

Re: "Invalid xref table" using PXCp_ReadDocumentW

Post by Max SAG » Fri Apr 15, 2016 4:36 pm

Hi Stefan,

Indeed, our customer did not send us copies of the same files he uses. They must have been corrupted on his side.
My apologies for wasting your time.

Best regards,

Max

User avatar
Will - Tracker Supp
Site Admin
Posts: 6660
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: "Invalid xref table" using PXCp_ReadDocumentW

Post by Will - Tracker Supp » Fri Apr 15, 2016 5:09 pm

Hi Max,

No worries, glad that you've located wherein the issue lies.

Have a great day :)
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