Code:
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfRef, pageNum);
CGPDFDictionaryRef pageDictionary = CGPDFPageGetDictionary(pdfPage);
CGPDFArrayRef outputArray;
if(CGPDFDictionaryGetArray(pageDictionary, "Annots", &outputArray))
{
int arrayCount = 0;
arrayCount = CGPDFArrayGetCount(outputArray );
if(arrayCount>0)
{
for( int j = 0; j < arrayCount; ++j )
{
CGPDFObjectRef aDictObj;
if(CGPDFArrayGetObject(outputArray, j, &aDictObj))
{
CGPDFDictionaryRef annotDict;
if(CGPDFObjectGetValue(aDictObj, kCGPDFObjectTypeDictionary, &annotDict))
{
CGPDFDictionaryRef aDict;
if(CGPDFDictionaryGetDictionary(annotDict, "A", &aDict))//page 1 returns here
{
CGPDFArrayRef dArray;
if(CGPDFDictionaryGetArray(aDict, "D", &dArray))
{
CGPDFObjectRef dObj;
if(CGPDFArrayGetObject(dArray, 0, &dObj)){
CGPDFDictionaryRef annotDict;
if(CGPDFObjectGetValue(dObj, kCGPDFObjectTypeDictionary, &annotDict))
{
}
}
}
}
}
}
}
}
}
I read Pdf32000_2008.pdf, it write
A destination defines a particular view of a document, consisting of the following items:
•The page of the document that shall be displayed
•The location of the document window on that page
•The magnification (zoom) factor
Example: [page /XYZ left top zoom]
But in my code
CGPDFArrayGetObject(dArray, 0, &dObj)
is a CGPDFDictionaryRef.
93 0 obj << /Type /Annot
/Subtype /Link
/Rect [71 717 190 734]
/Border [16 16 1]
/A <<
/Type /Action
/S /GoTo
/D [3 0 R /FitR –4 399 199 533]
> > endobj
How can I get like /D [3 0 R ...]
How can I get a indirect reference to a page object.
I'm very very very very hope an answer, thank you very very very much.