<?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 : DrawCapturedPage and &quot;AutoRotation&quot;</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 : General Discussion : DrawCapturedPage and &quot;AutoRotation&quot;]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 04 May 2026 11:10:00 +0000</pubDate>
  <lastBuildDate>Sun, 01 Jan 2012 20:13:19 +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=2071</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[DrawCapturedPage and &quot;AutoRotation&quot; : Hi Werner  Thank you very much...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8887.html#8887</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1774">twaldorff</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 01 Jan 12 at 8:13PM<br /><br />Hi Werner<DIV>&nbsp;</DIV><DIV>Thank you very much for the elaborate explanation, and also for&nbsp;directing me to the commands required to handle this issue in a more generic fashion.</DIV><DIV>&nbsp;</DIV><DIV>Thanks again</DIV><DIV>Thomas</DIV>]]>
   </description>
   <pubDate>Sun, 01 Jan 2012 20:13:19 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8887.html#8887</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; :  Hi Thomas,we are on the right...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8885.html#8885</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1569">edvoigt</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 01 Jan 12 at 3:55PM<br /><br />Hi Thomas,<br><br>we are on the right way. As I did guess, in the landscape-PDF is one /Rotate-command in the object, which describes the contents of the PDF.<br><br>But step by step to understand the problem. A first search for Mediabox shows:<br><br><font face="Courier New, Courier, mono">/MediaBox&#091;0 0 595.22 842&#093;<br></font><br>that is a A4-<u>portrait</u> in points. <u>Therefore the PDF is primary build as portrait.</u> To bring it in the wished landscape-orientation, there is a few bytes later this:<br><br><font face="Courier New, Courier, mono">... &gt;&gt;/Rotate </font><font face="Courier New, Courier, mono" color="#990000">90</font><font face="Courier New, Courier, mono">/Type/Page&gt;&gt;</font><br><br>If you use a good editor like notepad++ change it carefully (don't change the length of anything and beware all binarys as they are):<br><br><font face="Courier New, Courier, mono">... &gt;&gt;/Rotate </font><font face="Courier New, Courier, mono" color="#990000">00</font><font face="Courier New, Courier, mono">/Type/Page&gt;&gt;</font><br><br>Proof: In this form Adobe Reader shows it as portrait, as it really is.<br><br>Anyway there goes the rotate lost during capture, thats because subject of the rotation seems to be a page, but if we draw it as captured, it becomes to be a part of a page , what means no own rotation. Then it is drawn as constructed - portrait. So I think about this, explaining the automatic. It may be good and it may disturb, depending on the PDF-Quality.<br><br>We may bring all in correct state with a short code:<br><br><font face="Courier New, Courier, mono">var<br>&nbsp; rotation: integer;<br>...<br>&nbsp; rotation := QP.PageRotation; // the page of interest has to be selected<br>&nbsp; if (rotation&lt;&gt;0)<br>&nbsp; then begin<br>&nbsp;&nbsp;&nbsp; QP.DrawText(1,150, Format('Rotation %d',&#091;rotation&#093;)); // only to see this as test<br>&nbsp;&nbsp;&nbsp; QP.RotatePage(rotation);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // realize the defined rotation<br>&nbsp; end;<br>&nbsp; pw := QP.PageWidth;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // after capture we can't ask for this<br>&nbsp; ph := QP.PageHeight;<br>&nbsp; pid := QP.CapturePage(...&nbsp;&nbsp;&nbsp; // the now rotated sourcepage</font><br><br>With asking for the rotation we get informed about the build in rotation-statement. With RotatePage this is really performed, then we get the better formed PDF and get the correct values for pagedimensions. Read for this carefully the QP-ReferenceGuide at p. 508.<br><br>With the value of rotation and the relation between pagewith and pageheight, you should be able to handle all PDFs as you want and draw them with the right rotation-value.<br><br><br>Cheers,<br><br>Werner<br><span style="font-size:10px"><br /><br />Edited by edvoigt - 01 Jan 12 at 6:24PM</span>]]>
   </description>
   <pubDate>Sun, 01 Jan 2012 15:55:57 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8885.html#8885</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; : Hi Werner  Happy new year and...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8883.html#8883</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1774">twaldorff</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 01 Jan 12 at 12:21PM<br /><br />Hi Werner<DIV>&nbsp;</DIV><DIV>Happy new year and thanks for responding.</DIV><DIV>The behaviour you describe is the one I would have expected.</DIV><DIV>&nbsp;</DIV><DIV>Since the forum does not allow me to upload files I have stored a zip-file here</DIV><DIV><a href="http://ge.tt/9eLsxnB" target="_blank">http://ge.tt/9eLsxnB</A></DIV><DIV>The file contains main1.pdf and appe1.pdf</DIV><DIV>The files are NOT created by QuickPDF but by a PDF printer (Bluebeam) from Word and Excel respectively.</DIV><DIV>&nbsp;</DIV><DIV>They are used by the following example demonstrating my point</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>procedure superimpose;</DIV><DIV>var<BR>&nbsp;QP: TQuickPDF0813;<BR>&nbsp;UnlockResult: Integer;</DIV><DIV>&nbsp;unlockkey: String;<BR>&nbsp;FileA: integer;<BR>&nbsp;FileB: integer;<BR>&nbsp;CapturedPageID: integer;<BR>&nbsp;PageHeight: Double;<BR>&nbsp;PageWidth: Double;</DIV><DIV>begin<BR>&nbsp; qp := TQuickPDF0813.Create;<BR>&nbsp; unlockkey := 'whatever';<BR>&nbsp; try<BR>&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnlockResult := qp.UnlockKey(unlockkey);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if UnlockResult = 1 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If qp.LoadFromFile('main1.pdf', '') = 1 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileA := qp.SelectedDocument;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PageHeight := qp.PageHeight;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PageWidth := qp.PageWidth;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If qp.LoadFromFile('appe1.pdf', '') = 1 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileB := qp.SelectedDocument;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.SelectDocument(FileA);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.MergeDocument(FileB);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.SaveToFile('tmp.pdf');</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;In this file you will se the two page in portrait and landscape respectively.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CapturedPageID := qp.CapturePage(2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.SelectPage(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.DrawCapturedPage(CapturedPageID, 0, PageHeight, PageWidth, PageHeight);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qp.SaveToFile('main1_final.pdf');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<BR>&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowMessage('Invalid license key');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp;&nbsp; end;<BR>&nbsp; finally<BR>&nbsp;&nbsp;&nbsp; qp.Free;<BR>&nbsp; end;<BR>end;<BR></DIV><DIV>Please give it a try and see if you experience&nbsp;the same as I do.</DIV><DIV>&nbsp;</DIV><DIV>Thomas</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 01 Jan 2012 12:21:27 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8883.html#8883</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; : Hi Thomas,I&amp;#039;m rather sure,...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8882.html#8882</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1569">edvoigt</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 31 Dec 11 at 4:04PM<br /><br />Hi Thomas,<br><br>I'm rather sure, that there is any kind of rotate-command in one of your PDFs. Here is my test, which shows what with normal PDFs happens:<br><br><font face="Courier New, Courier, mono">var<br>&nbsp; pid: integer;<br>&nbsp; pw, ph: double;<br>begin<br>&nbsp; QP := TQuickPDF.Create;<br>&nbsp; QP.UnlockKey({$I PDFkey.inc});<br>&nbsp; QP.NewDocument;<br>&nbsp; QP.SetMeasurementUnits(1);<br>&nbsp; QP.SetOrigin(0);<br>&nbsp; QP.SetPageDimensions(210, 297);<br>&nbsp; QP.DrawText(25, 250, 'Portrait-Page');<br>&nbsp; QP.SetLineColor(0, 0, 1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // blue<br>&nbsp; QP.SetLineWidth(1);<br>&nbsp; QP.DrawBox(1, 296, 208, 295, 0);&nbsp;&nbsp;&nbsp;&nbsp; // borderline<br>&nbsp; QP.SaveToFile('PDF1_Portrait.pdf');<br><br>&nbsp; QP.NewDocument;<br>&nbsp; QP.SetMeasurementUnits(1);<br>&nbsp; QP.SetOrigin(0);<br>&nbsp; QP.SetPageDimensions(297, 210);<br>&nbsp; QP.DrawText(150, 100, 'Landscape-Page');<br>&nbsp; QP.SetLineColor(1, 0, 0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // red<br>&nbsp; QP.SetLineWidth(1);<br>&nbsp; QP.DrawBox(1, 209, 295, 208, 0);&nbsp;&nbsp;&nbsp;&nbsp; </font><font face="Courier New, Courier, mono">// borderline</font><br><font face="Courier New, Courier, mono">&nbsp; QP.SaveToFile('PDF2_Landscape.pdf');<br><br>&nbsp; QP.Free; // to forget all, no sideeffects possible<br><br>&nbsp; QP := TQuickPDF.Create;<br>&nbsp; QP.UnlockKey({$I PDFkey.inc});<br>&nbsp; QP.MergeFiles('PDF1_Portrait.pdf', 'PDF2_Landscape.pdf', 'PDF_mixed.pdf');<br><br>&nbsp; // now the imposition<br>&nbsp; QP.LoadFromFile('PDF_mixed.pdf', ''); <br>&nbsp; QP.SelectPage(2);<br>&nbsp; pw := QP.PageWidth;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // after capture we can't ask for this<br>&nbsp; ph := QP.PageHeight;<br>&nbsp; pid := QP.CapturePage(2);&nbsp;&nbsp;&nbsp; // get the landscape-page<br><br>&nbsp; QP.SelectPage(1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // the page where we want to put the captured page down<br>&nbsp; QP.DrawCapturedPage(pid, 0, ph, pw, ph); // without scaling the landscape is clipped<br>&nbsp; QP.SaveToFile('PDF_done.pdf');<br>&nbsp; QP.Free;</font><br><br>Because I was thinking in this direction, I did ask for the PDFs, you are using. In them is anything disturbing you.<br><br>More if needed next year.<br><br>Cheers,<br>Werner<br>]]>
   </description>
   <pubDate>Sat, 31 Dec 2011 16:04:00 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8882.html#8882</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; : Hi Werner  I&amp;#039;m not trying...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8881.html#8881</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1774">twaldorff</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 31 Dec 11 at 2:58PM<br /><br />Hi Werner<DIV>&nbsp;</DIV><DIV>I'm not trying achieve something beyond an explanation.</DIV><DIV>From a PDF point-of-view I'm getting what I want to get.</DIV><DIV>My "problem" is that I don't understand why I get it.</DIV><DIV>&nbsp;</DIV><DIV>You have understood the basic input OK.</DIV><DIV>First I attach the landscape PDF to the main portrait PDF. (qp.merge)</DIV><DIV>Stopping here and looking into the file, the pages show in portrait and landscape as expected.</DIV><DIV>&nbsp;</DIV><DIV>Then I capturepage/drawcapturedpage taking a landscape page and superimposing it on a portrait page. I'm not doing any scaling or rotating in this process.</DIV><DIV>&nbsp;</DIV><DIV>In this situation this is fine, the landscape page is "autorotated", but why?</DIV><DIV>&nbsp;</DIV><DIV>That is the question,</DIV><DIV>&nbsp;</DIV><DIV>Thomas</DIV>]]>
   </description>
   <pubDate>Sat, 31 Dec 2011 14:58:24 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8881.html#8881</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; : Hi Thomas,please explain what...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8856.html#8856</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1569">edvoigt</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 23 Dec 11 at 2:52PM<br /><br />Hi Thomas,<br><br>please explain what you want. I understand only, that there is a PDF1 in A4 portrait, which has pages with a free area for pages from PDF2, which are A4 landscape. What is the goal? Clear is, you want to get a Page of PDF2 in smaller size on a reserved page of PDF1. What automatism do you expect or really get?<br><br>Want you while drawing PDF2-Page onto a Page of PDF1 leave the orientation as is or not?<br><br>Please show a code snippet and the both used PDFs to answer your question.<br><br>Cheers,<br><br>Werner<br>]]>
   </description>
   <pubDate>Fri, 23 Dec 2011 14:52:18 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8856.html#8856</guid>
  </item> 
  <item>
   <title><![CDATA[DrawCapturedPage and &quot;AutoRotation&quot; : Hi I&amp;#039;m using version 8.12 I&amp;#039;m...]]></title>
   <link>http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8824.html#8824</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1774">twaldorff</a><br /><strong>Subject:</strong> 2071<br /><strong>Posted:</strong> 15 Dec 11 at 11:14AM<br /><br /><DIV>Hi</DIV><DIV>I'm using version 8.12</DIV><DIV>I'm using the CapturePage-DrawCapturedPage functions to insert pages from an other pdf in a report while preserving report header/footer.</DIV><DIV>I have got the process working OK, but there is something I don't understand:</DIV><DIV>&nbsp;</DIV><DIV>My main report is in A4 <strong>portrait</strong> and contains a number of blank pages (except for header/footer) reserved for the other pdf.&nbsp;The other report is in A4 <strong>landscape</strong>.</DIV><DIV>Using plain DrawCapturedPage works OK, where I would have expected having to use DrawCapturedPageEx to include rotation information, but that is apparently not required.</DIV><DIV>&nbsp;</DIV><DIV>Is this an "AutoRotation" feature? Or is there something else at play?</DIV><DIV>&nbsp;</DIV><DIV>Thomas</DIV>]]>
   </description>
   <pubDate>Thu, 15 Dec 2011 11:14:55 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawcapturedpage-and-autorotation_topic2071_post8824.html#8824</guid>
  </item> 
 </channel>
</rss>