Broken documents: read/get problems info (IPXS_Document's BrokenFlags)  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by zarkogajic »

Hi Support,

When opening a broken document (things like "xref chunks not found" or "misaligned object" etc) the "Broken Document" info will get displayed in the info bar.

How to read/retrieve/get the "bad document" string details? (which get displayed when clicking on "Show Problem Details...").

image.png

More info:
For one document, the pxvControl states "xhref chunks not found", and yes, IPXS_Document's Get_BrokenFlags has the SVF_XRefChunkNotFound set - so that's ok.

For another, I'm receiving 0 for nFlags ("SVF_Valid") while the pxvControl displays "misaligned object", so an issue with it? I've done a few more testst and it seems if the only issue is "misaligned object" (SVF_MissalignedObj) the BrokenFlags would always return "0" (SVF_Valid).

Also, why is "SVF_Corrected" flag set in most such broken documents (what does it actually mean)?


-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by Sasha - Tracker Dev Team »

Hello žarko,

To get the BrokenFlags for the document, this property should be used. I've also updated the description for the https://sdkhelp.pdf-xchange.com/vi ... ationFlags enumeration.
As for the strings that are used

Code: Select all

	{
		{ SVF_XRefChunkNotFound,				loc_msg_docInfo_broken_xrefChunkNotFound },
		{ SVF_ErrorsInXRef,						loc_msg_docInfo_broken_errorsInXRef },
		{ SVF_InvalidObjRef,					loc_msg_docInfo_broken_invalidObjRef },
		{ SVF_BrokenObj,						loc_msg_docInfo_broken_obj },
		{ SVF_MissalignedObj,					loc_msg_docInfo_broken_misalignedObj },
		{ SVF_BrokenObjStream,					loc_msg_docInfo_broken_objStream },
		{ SVF_ErrorsInTrailer,					loc_msg_docInfo_broken_errorsInTrailer },
		{ SVF_UnrecoveredErrorsInTrailer,		loc_msg_docInfo_broken_unrecoveredErrorsInTrailer },
		{ SVF_LargerFileNotTruncated,			loc_msg_docInfo_broken_largeFileNotTruncated },
		{ SVF_WarnFutureObjRef,					loc_msg_docInfo_broken_warnFutureObjRef },
	};
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by zarkogajic »

Hi Alex,

Thanks.

Btw, can you double check internally? As : for a document(s) having only "misaligned object" the pxvControl will display the warning - while the BrokenFlags would return 0 (SVF_Valid).

I have a few such documents but cannot send here publicly.


Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by Sasha - Tracker Dev Team »

Hello žarko,

Please send one of those files to the support@pdf-xchange.com with the link to this topic - we'll look into it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by zarkogajic »

Hi Alex,

Done.

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by Sasha - Tracker Dev Team »

Hello žarko,

I've modified the FullDemo project a little, so that the Pages Count field would show the Broken Flags:
image.png
Everything looks OK - the 64 == SVF_MissalignedObj flag.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by zarkogajic »

Hi Alex,

Yes, I see this.

I'm receiving the same when testing with ipxv_document (resulting in SVF_MissalignedObj).

Please try opening as IPXC_Document via op.openDoc (IAFS_Name as input) -> BrokenFlags returns 0.

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)  SOLVED

Post by Sasha - Tracker Dev Team »

Hello žarko,

Not all of the errors are detected when the document is being just opened. To initialize all of the procedures, you should do:

Code: Select all

uint nCnt = doc.Pages.Count;
This will trigger reading of the pages' dictionaries and checking the structure for integrity.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by zarkogajic »

Hi Alex,

Thanks, that does it.

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Broken documents: read/get problems info (IPXS_Document's BrokenFlags)

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply