Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get indirect reference to a page object with CGPDF?
    primarykey
    data
    text
    <p>According to Adobe's <em>"Document management - Portable Document Format - Part 1: PDF 1.7"</em> (<a href="http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf" rel="nofollow">Pdf32000_2008.pdf</a>), section 12.3.2.1 states:</p> <blockquote> <p>A destination defines a particular view of a document, consisting of the following items:</p> <ul> <li><p>The page of the document that shall be displayed</p></li> <li><p>The location of the document window on that page</p></li> <li><p>The magnification (zoom) factor</p></li> </ul> </blockquote> <p>Example:</p> <p><code>[page /XYZ left top zoom]</code></p> <p>But in my code </p> <pre><code>CGPDFArrayGetObject(dArray, 0, &amp;dObj) </code></pre> <p>is a <code>CGPDFDictionaryRef</code>.</p> <pre><code>93 0 obj &lt;&lt; /Type /Annot /Subtype /Link /Rect [71 717 190 734] /Border [16 16 1] /A &lt;&lt; /Type /Action /S /GoTo /D [3 0 R /FitR –4 399 199 533] &gt;&gt; &gt;&gt; endobj </code></pre> <p>How can I obtain <code>3 0 R</code> from <code>/D [3 0 R /FitR –4 399 199 533]</code>?</p> <p>How can I get an indirect reference to a page object like <code>[page /XYZ left top zoom]</code>'s page object?</p> <p>Here is my code:</p> <pre><code>CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfRef, pageNum); CGPDFDictionaryRef pageDictionary = CGPDFPageGetDictionary(pdfPage); CGPDFArrayRef outputArray; if(CGPDFDictionaryGetArray(pageDictionary, "Annots", &amp;outputArray)) { int arrayCount = 0; arrayCount = CGPDFArrayGetCount(outputArray ); if(arrayCount&gt;0) { for( int j = 0; j &lt; arrayCount; ++j ) { CGPDFObjectRef aDictObj; if(CGPDFArrayGetObject(outputArray, j, &amp;aDictObj)) { CGPDFDictionaryRef annotDict; if(CGPDFObjectGetValue(aDictObj, kCGPDFObjectTypeDictionary, &amp;annotDict)) { CGPDFDictionaryRef aDict; if(CGPDFDictionaryGetDictionary(annotDict, "A", &amp;aDict))//page 1 returns here { CGPDFArrayRef dArray; if(CGPDFDictionaryGetArray(aDict, "D", &amp;dArray)) { CGPDFObjectRef dObj; if(CGPDFArrayGetObject(dArray, 0, &amp;dObj)){ CGPDFDictionaryRef annotDict; if(CGPDFObjectGetValue(dObj, kCGPDFObjectTypeDictionary, &amp;annotDict)) { } } } } } } } } } </code></pre> <hr> <p>thank you very much for you replay~ but i have a question where can I know this object number is 3? </p> <pre><code>CGPDFArrayGetObject(dArray, 0, &amp;dObj) </code></pre> <p>get a CGPDFDictionaryRef, but I didn't find field is "3 0 R"</p> <p>and another question, If I know is "3 0 R"</p> <p>where can I find by searching your PDF for 3 0 obj</p> <p>thank you reply, thank you very very very much ... I hope get your answer agian!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload