CGPDFObject gets identifier

How can I get the identifier of a CGPDFOb object?

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 get with:

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

Now I know CGPDFDictionaryApplyFunction to get key / value pairs inside a dictionary. But how can I get my own object identifier and generation number? (In this case, 3 and 0).

EDIT: Why do I need this information? I am trying to add text annotations to a file. In my opinion, there is no โ€œhigh levelโ€ way in iOS. You must manually add a new section (xref table, overridden objects, trailer, etc.). Therefore, it is inevitable to get the identifiers and generation numbers of the objects that I want to override, and for those referenced by the objects that I redefine (for example. / Resources, / Contents on the redefined page).

+4
source share

All Articles