5

How can I obtain the ID of a CGPDFObject?

I have this dictionary in my PDF:

3 0 obj
<< /Type /Pages /MediaBox [0 0 612 792] /Count 5 /Kids [ 2 0 R 9 0 R 15 0 R
21 0 R 27 0 R ] >>
endobj

which I obtain using:

CGPDFDictionaryRef pdfPagesObjectRef;
CGPDFDictionaryGetDictionary(pdfCatalogueRef, "Pages", &pdfPagesObjectRef);

Now I am aware of the CGPDFDictionaryApplyFunctionto get the key/value pairs inside the dictionary. But how can I get the own object ID and generation Number? (In this case 3 and 0).

EDIT: Why I need these information? I am trying to add text annotations to the file. In my understanding, there is no "high level" way to do this in iOS. You have to append a new section (xref table, overridden objects, trailer etc.) by hand. Therefore it is inevitable to get the IDs and generation numbers of the objects I want to override, and for those referenced in objects I override (eg. /Resources, /Contents in an overridden page).

Hasib Samad
  • 1,081
  • 1
  • 20
  • 39

0 Answers0