<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : LinkToFile Destination ID / Zoom</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : I need help - I can help : LinkToFile Destination ID / Zoom]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 17:08:20 +0000</pubDate>
  <lastBuildDate>Tue, 17 Apr 2012 08:01:40 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=2143</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[LinkToFile Destination ID / Zoom : One way to achieve this is to...]]></title>
   <link>http://www.quickpdf.org/forum/linktofile-destination-id-zoom_topic2143_post9503.html#9503</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1921">kevindebenu</a><br /><strong>Subject:</strong> 2143<br /><strong>Posted:</strong> 17 Apr 12 at 8:01AM<br /><br /><div>One way to achieve this is to first add a link using the <b>AddLinkToFile</b> function, then use the <b>GetAnnotActionID</b>&nbsp;and <b>GetActionDest</b>&nbsp;functions to obtain a DestID. Then the <b>SetDestProperties</b>&nbsp;function can be used to change the link annotation to a different type.</div><div><br></div><div>It's not possible to link to a particular area and set the zoom too. But you can link to an area using the FitR destination type, and you can link to a left/top/zoom using the XYZ destination type.</div><div><br></div><div>Here's an example:</div><div><br></div><div><font face="Arial, Helvetica, sans-serif"><br></font></div><div><font face="'Courier New', Courier, mono">string SourceFile = "source.pdf";</font></div><div><font face="'Courier New', Courier, mono">string TargetFile = "target.pdf";</font></div><div><font face="'Courier New', Courier, mono">int DestPage = 2;</font></div><div><font face="'Courier New', Courier, mono">int DestZoom = 500;</font></div><div><font face="'Courier New', Courier, mono">double DestBoxLeft = 300;</font></div><div><font face="'Courier New', Courier, mono">double DestBoxTop = 500;</font></div><div><font face="'Courier New', Courier, mono">double DestBoxWidth = 200;</font></div><div><font face="'Courier New', Courier, mono">double DestBoxHeight = 150;</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Create a target document containing two pages</font></div><div><font face="'Courier New', Courier, mono">QP.DrawText(100, 700, "Target Page 1");</font></div><div><font face="'Courier New', Courier, mono">QP.NewPage();</font></div><div><font face="'Courier New', Courier, mono">QP.DrawText(100, 700, "Target Page 2");</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// On the second page, draw a box and add some text to</font></div><div><font face="'Courier New', Courier, mono">// the top left corner of the box</font></div><div><font face="'Courier New', Courier, mono">QP.DrawBox(DestBoxLeft, DestBoxTop, DestBoxWidth, DestBoxHeight, 0);</font></div><div><font face="'Courier New', Courier, mono">QP.DrawText(DestBoxLeft + 5, 500 - QP.GetTextHeight() - 5, "Box is here");</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Save the target file</font></div><div><font face="'Courier New', Courier, mono">QP.SaveToFile(TargetFile);</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Create a source document</font></div><div><font face="'Courier New', Courier, mono">QP.NewDocument();</font></div><div><font face="'Courier New', Courier, mono">QP.SetTextAlign(1);</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Draw a label for the first hotspot and add a link to any position</font></div><div><font face="'Courier New', Courier, mono">// on the target page (123 is used here, it will be discarded later)</font></div><div><font face="'Courier New', Courier, mono">QP.DrawTextBox(100, 700, 100, 20, "Open Target (FitR)", 0);</font></div><div><font face="'Courier New', Courier, mono">QP.AddLinkToFile(100, 700, 100, 20, TargetFile, DestPage, 123, 1, 1);</font></div><div><font face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</font></div><div><font face="'Courier New', Courier, mono">// Get the new annotation's action, and the destination of that action,&nbsp;</font></div><div><font face="'Courier New', Courier, mono">// then use the DestID to change the destination properties to "FitR",</font></div><div><font face="'Courier New', Courier, mono">// supplying the Left, Top, Right and Bottom values. Zoom is set to</font></div><div><font face="'Courier New', Courier, mono">// zero, it will be ignored for "FitR"</font></div><div><font face="'Courier New', Courier, mono">int ActionID = QP.GetAnnotActionID(QP.AnnotationCount());</font></div><div><font face="'Courier New', Courier, mono">int DestID = QP.GetActionDest(ActionID);</font></div><div><font face="'Courier New', Courier, mono">int DestType = 5; // FitR</font></div><div><font face="'Courier New', Courier, mono">QP.SetDestProperties(DestID, 0, DestType, DestBoxLeft, DestBoxTop, DestBoxLeft + DestBoxWidth, DestBoxTop - DestBoxHeight);</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Draw a label for the second hotspot and add a link to any position</font></div><div><font face="'Courier New', Courier, mono">// on the target page (123 is used here, it will be discarded later)</font></div><div><font face="'Courier New', Courier, mono">QP.DrawTextBox(100, 650, 100, 20, "Open Target (XYZ)", 0);</font></div><div><font face="'Courier New', Courier, mono">QP.AddLinkToFile(100, 650, 100, 20, TargetFile, DestPage, 123, 1, 1);</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">// Get the DestID as before, but use XYZ for this one. The</font></div><div><font face="'Courier New', Courier, mono">// Right and Bottom parameters are ignored</font></div><div><font face="'Courier New', Courier, mono">ActionID = QP.GetAnnotActionID(QP.AnnotationCount());</font></div><div><font face="'Courier New', Courier, mono">DestID = QP.GetActionDest(ActionID);</font></div><div><font face="'Courier New', Courier, mono">DestType = 1; // XYZ</font></div><div><font face="'Courier New', Courier, mono">QP.SetDestProperties(DestID, DestZoom, DestType, DestBoxLeft, DestBoxTop, 0, 0);</font></div><div><font face="'Courier New', Courier, mono"><br></font></div><div><font face="'Courier New', Courier, mono">QP.SaveToFile(SourceFile);</font></div>]]>
   </description>
   <pubDate>Tue, 17 Apr 2012 08:01:40 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/linktofile-destination-id-zoom_topic2143_post9503.html#9503</guid>
  </item> 
  <item>
   <title><![CDATA[LinkToFile Destination ID / Zoom : Is there an API available to link...]]></title>
   <link>http://www.quickpdf.org/forum/linktofile-destination-id-zoom_topic2143_post9094.html#9094</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1852">samuelms</a><br /><strong>Subject:</strong> 2143<br /><strong>Posted:</strong> 10 Feb 12 at 4:34PM<br /><br />Is there an API available to link to a local file and set a destination id to load within that file?<div><br></div><div>Here is the API I'm aware of to link to a page within another file:</div><div><a href="http://www.quickpdflibrary.com/help/quickpdf/AddLinkToFile.php" target="_blank">http://www.quickpdflibrary.com/help/quickpdf/AddLinkToFile.php</a></div><div><br></div><div>However, I'd like to:</div><div>&nbsp; &nbsp; 1.) Link to a destination id&nbsp;</div><div>&nbsp; &nbsp; OR&nbsp;</div><div>&nbsp; &nbsp; 2.) Link to a page at a specific X,Y location with a specific bounding box Width, Height with a specific zoom</div><div><br></div><div>At the moment I do not believe this is possible. &nbsp;:( &nbsp;Is this something we can expect soon (really soon?)</div><div><br></div><div>Also, this may be possible using javascript :: see&nbsp;<a href="http://www.adobe.com/c&#111;ntent/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf" target="_blank">http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf</a>&nbsp;page 133 openDoc method's cDest argument. &nbsp;Note that the cDest argument says &nbsp;"(optional, Acrobat 8.0)". &nbsp;So.. &nbsp;I'm not sure how many pdf viewers 1.) support javascript and 2.) would support that method argument.</div><div><br></div><div>I may try the javascript route... &nbsp;but I'd REALLY love to find a non-javascript route as I don't know that javascript has wide support. &nbsp;See&nbsp;<a href="http://stackoverflow.com/questi&#111;ns/9219807/using-java&#115;cript-inside-a-pdf" target="_blank">http://stackoverflow.com/questions/9219807/using-javascript-inside-a-pdf</a></div>]]>
   </description>
   <pubDate>Fri, 10 Feb 2012 16:34:29 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/linktofile-destination-id-zoom_topic2143_post9094.html#9094</guid>
  </item> 
 </channel>
</rss>