I'm using C#
Ok so i have used the low level API to navigate all the way down to /Annots on the page without any issue and get
Dictionary (7061184) \Pages\Kids[3]\Kids[7] :- Type(PVT_NAME = 'Page' ), Annots(PVT_OBJREF = 'Is Dictionary' ), Parent(PVT_OBJREF = 'Is Dictionary' ), Rotate(PVT_INT = '0' ), CropBox(PVT_ARRAY), Contents(PVT_OBJREF = 'Is Dictionary' ), MediaBox(PVT_ARRAY), Resources(PVT_OBJREF = 'Is Dictionary' )
then using the Annots as the variant
XcPro40Defs.DPDFVariant_Type nefvType;
result =XcPro40Defs.PXCp_VariantGetType(variant, out nefvType);
if (nefvType.Equals(XcPro40Defs.DPDFVariant_Type.PVT_OBJREF)){
int pxcObject;
int subDictionary;
result = XcPro40Defs.PXCp_VariantGetObject(variant, out pxcObject);
result = XcPro40Defs.PXCp_ObjectGetDictionary(pxcObject, out subDictionary); <--- This returns 0 for sub directory?
}
the PXCp_VariantGetObject returns a result of 0 and the pxcObject = 511035452
but PXCp_ObjectGetDictionary returns a result of 0 which is success but the subDictionary= 0
I am using xcpro40.dll version 4.0.316.1 from release Version 5.5.315.0 of PDF-XChange PRO SDK
This only happens to the /Annots Dictionary on the page every other Dictionary works fine can tacker not deal with /annots.
The ultimate goal is to get to the /FS underneath it to extract the file stream.
Please Can You help!
Unable to read \Annots to get file attachment from page
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
- Lzcat - Tracker Supp
- Site Admin
- Posts: 677
- Joined: Thu Jun 28, 2007 8:42 am
Re: Unable to read \Annots to get file attachment from page
Hi.
You should take a closer look at PDF specification when using low-level API - Annots is array, not dictionary.
HTH.
You should take a closer look at PDF specification when using low-level API - Annots is array, not dictionary.
HTH.
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.
Tracker Software
Project manager
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Unable to read \Annots to get file attachment from page
i would agree but tracker says it is object
result =XcPro40Defs.PXCp_VariantGetType(variant, out nefvType);
nefvType = PVT_OBJREF not PVT_ARRAY
so have to do XcPro40Defs.PXCp_VariantGetObject(variant, out pxcObject);
and there is no PXCp_ObjectGetArray(pxcObject, out array);
only PXCp_ObjectGetDictionary or PXCp_ObjectGetStream
I even tried result = XcPro40Defs.PXCp_VariantGetArray(variant, out pxcArray); but this throws and error
result =XcPro40Defs.PXCp_VariantGetType(variant, out nefvType);
nefvType = PVT_OBJREF not PVT_ARRAY
so have to do XcPro40Defs.PXCp_VariantGetObject(variant, out pxcObject);
and there is no PXCp_ObjectGetArray(pxcObject, out array);
only PXCp_ObjectGetDictionary or PXCp_ObjectGetStream
I even tried result = XcPro40Defs.PXCp_VariantGetArray(variant, out pxcArray); but this throws and error
- Lzcat - Tracker Supp
- Site Admin
- Posts: 677
- Joined: Thu Jun 28, 2007 8:42 am
Re: Unable to read \Annots to get file attachment from page
Sure, because in your case Annots array is indirect variant.truane wrote:i would agree but tracker says it is object
result =XcPro40Defs.PXCp_VariantGetType(variant, out nefvType);
nefvType = PVT_OBJREF not PVT_ARRAY
But you missed function PXCp_ObjectGetBody, so correct sequence for indirect array is PXCp_VariantGetObject > PXCp_ObjectGetBody > PXCp_VariantGetArray.truane wrote:so have to do XcPro40Defs.PXCp_VariantGetObject(variant, out pxcObject);
and there is no PXCp_ObjectGetArray(pxcObject, out array);
only PXCp_ObjectGetDictionary or PXCp_ObjectGetStream
I even tried result = XcPro40Defs.PXCp_VariantGetArray(variant, out pxcArray); but this throws and error
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.
Tracker Software
Project manager
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Unable to read \Annots to get file attachment from page
Yes after my last message I went back to documentation and noticed PXCp_ObjectGetBody tired it and it works.
if PXCp_ObjectGetDictionary returns 0 for dictionary ref then call PXCp_ObjectGetBody?
Sorry for wasting your time I got so involved in implementing i didn't have time to write back and tell you i found it
if PXCp_ObjectGetDictionary returns 0 for dictionary ref then call PXCp_ObjectGetBody?
Sorry for wasting your time I got so involved in implementing i didn't have time to write back and tell you i found it
- Lzcat - Tracker Supp
- Site Admin
- Posts: 677
- Joined: Thu Jun 28, 2007 8:42 am
Re: Unable to read \Annots to get file attachment from page
You asking why PXCp_ObjectGetDictionary return 0 when object does not contain dictionary? It was not good design in old SDK which is no longer developed, so this behavior will be not changed. But you always can use PXCp_ObjectGetBody and then PXCp_VariantGetType to check what is in object.truane wrote:if PXCp_ObjectGetDictionary returns 0 for dictionary ref then call PXCp_ObjectGetBody?
HTH.
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.
Tracker Software
Project manager
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.