According to Adobe's "Document management - Portable Document Format - Part 1: PDF 1.7" (Pdf32000_2008.pdf), section 12.3.2.1 states:
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 obtain 3 0 R
from /D [3 0 R /FitR –4 399 199 533]
?
How can I get an indirect reference to a page object like [page /XYZ left top zoom]
's page object?
Here is my 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))
{
}
}
}
}
}
}
}
}
}
thank you very much for you replay~ but i have a question where can I know this object number is 3?
CGPDFArrayGetObject(dArray, 0, &dObj)
get a CGPDFDictionaryRef, but I didn't find field is "3 0 R"
and another question, If I know is "3 0 R"
where can I find by searching your PDF for 3 0 obj
thank you reply, thank you very very very much ... I hope get your answer agian!