Hi zyx,
 
thanks a lot for sharing your code. It´s working fine.
 
I modified it a little bit because I want to extract a file with a specified name, so I get the index with "GetStringIndex" and the object with "&(names[index+1])".
 
-------------------------
...
const PdfArray &names = namesKey->GetArray();
size_t index = names.GetStringIndex(ATTACHED_FILENAME);

 
// the filename we are looking for cannot be
// on the last index, thats why we use "-1"
// (array items alternate between "filename" and
// "object reference", starting with a filename)
if(index < (names.GetSize() - 1))
{
    obj = &(names[index+1]); // get the object reference (not the filename)
    if( obj->IsReference() )
        obj = document->GetObjects().GetObject(obj->GetReference());
...
-------------------------
 
Have a nice day
Sebastian
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to