<?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 : SetPageSize - Why so slow?</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 : SetPageSize - Why so slow?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 18:26:19 +0000</pubDate>
  <lastBuildDate>Thu, 17 Jul 2008 07:06:17 +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=917</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[SetPageSize - Why so slow? : Wow! What a difference.     Using...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4380.html#4380</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=882">DaveH</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 17 Jul 08 at 7:06AM<br /><br /><strong>Wow!&nbsp; What a difference.</strong><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Using your technique, I allocate 100 pages, draw on each keeping track of where I am and allocate another 100 pages when I run out and finally adjust the page count at the end by deleting unused pages.</DIV><DIV>&nbsp;</DIV><DIV>This 154MB PDF with just under 18,000 pages went from 6 hours to 10 minutes to produce.</DIV><DIV>&nbsp;</DIV><DIV>Kind of makes it obvious why the original developer included a "NewPages" method.</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>DaveH</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 17 Jul 2008 07:06:17 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4380.html#4380</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : I actually realized I did not...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4378.html#4378</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=872">waynefulcher</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 16 Jul 08 at 9:31AM<br /><br />I actually realized I did not need to call SetPageSize but once also and that alone seemed to fix my problem. But you are correct in it relocating memory everytime you call NewPage. So to help with that I calculated a number based on the size of my text file so for a larger files this number may be somewhere around 500. Then instead of calling NewPage 20,000 times.&nbsp;I will call NewPages(500)&nbsp;and add them in blocks of 500 pages. So I only&nbsp;need to call it about 40 times using your example. I keep up with an actual CurrentPageIndex to select the next actual page needed. Once I have used the next 500 I will add another 500 and so on. Then when I am done I delete the number of unused pages. What would be interesting is if you commented all of your API calls except for NewPage even though you know your output may be wrong, just to see if one of those lines are slowing it down or not. If you happen to do that test let me know your results.]]>
   </description>
   <pubDate>Wed, 16 Jul 2008 09:31:38 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4378.html#4378</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : Wayne  I&amp;#039;m using an old...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4376.html#4376</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=882">DaveH</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 15 Jul 08 at 11:10PM<br /><br />Wayne<DIV>&nbsp;</DIV><DIV>I'm using an old version (4.26 I think)&nbsp; and I&nbsp;only&nbsp;call SetPageSize once at the beginning.&nbsp; Here is my loop structure...</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; Pdf.Permissions(1,1,0,0,0,1,0,1);<BR>&nbsp;&nbsp;&nbsp; Pdf.SetPageSize('Letter Landscape');<BR>&nbsp;&nbsp;&nbsp; Pdf.SetOrigin(1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //top left<BR>&nbsp;&nbsp;&nbsp; Pdf.SetMeasurementUnits(2);&nbsp;&nbsp;&nbsp;&nbsp; //inches<BR>&nbsp;&nbsp;&nbsp; Pdf.SetTextColor(0, 0, 0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //black<BR>&nbsp;&nbsp;&nbsp; Pdf.SetFillColor(0, 0, 0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //black<BR>&nbsp;&nbsp;&nbsp; Pdf.SelectFont(Pdf.FontID(1));&nbsp; //courier new<BR>&nbsp;&nbsp;&nbsp; Pdf.SetTextAlign(0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //left align<BR>&nbsp;&nbsp;&nbsp; Pdf.SetTextSize(FontSize);<BR>...</DIV><DIV>&nbsp;&nbsp;&nbsp; while&nbsp;(not Quit) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (Pos(#12, S) &lt;&gt; 0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pdf.NewPage;&nbsp; //you have to reset the following 3 items every page<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pdf.SelectFont(Pdf.FontID(1));&nbsp; //courier new<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pdf.SetTextAlign(0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //left<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pdf.SetTextSize(FontSize);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VPos:= TopMargin;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</DIV><DIV>&nbsp;&nbsp;&nbsp; ...</DIV><DIV>&nbsp;&nbsp;&nbsp; end;&nbsp; //while&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>However, I too experience a significant slow down as the PDF document gets larger.</DIV><DIV>&nbsp;</DIV><DIV>I auto convert a bunch of text reports to PDF.&nbsp; One is 20,000 pages and takes over 5 hours to run.</DIV><DIV>&nbsp;</DIV><DIV>I only have a basic license so no source code to debug but it has to be in the lines above or DrawText because those are the only API calls I make in the loop.&nbsp; Maybe that will help point to the real problem.</DIV><DIV>&nbsp;</DIV><DIV>I suspect that it is reallocating memory with every new page and copying the entire document to the new memory space.</DIV><DIV>&nbsp;</DIV><DIV>DaveH</DIV><DIV><DIV>&nbsp;</DIV></DIV>]]>
   </description>
   <pubDate>Tue, 15 Jul 2008 23:10:11 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4376.html#4376</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : Hi!  So have a try with 6.03...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4363.html#4363</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 04 Jul 08 at 9:11AM<br /><br />Hi!<DIV>&nbsp;</DIV><DIV>So have a try with 6.03 from the source-section.</DIV><DIV>...Or wait for a week and we will begin with the new compiled versions.</DIV><DIV>&nbsp;</DIV><DIV>Best regards,</DIV><DIV>Ingo</DIV>]]>
   </description>
   <pubDate>Fri, 04 Jul 2008 09:11:27 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4363.html#4363</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : I am using version 5.21, which...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4362.html#4362</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=872">waynefulcher</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 03 Jul 08 at 9:19AM<br /><br />I am using version 5.21, which I thought was the latest version. I found if I know that all pages will be the same for the entire document then I only need to call that method once up front and all pages added after that will be the same as the first one. Is there a newer version available? Where can I download it?<DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>Wayne</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 03 Jul 2008 09:19:14 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4362.html#4362</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : Wayne,which version of QuickPDf...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4361.html#4361</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=370">ukobsa</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 03 Jul 08 at 9:03AM<br /><br />Wayne,<br><br>which version of QuickPDf you are using? The new version 6 have some speed improvements for large files in it. <br><br>The problem is that the code for SetPageSize inside QuickPDF is somewhat strange: is loops always over 49 paper size types regardless if it finds the type to be the first. This in combination with accessing the object structure in a linear way in version 5 can slow down the process on documents with a lot of pages. And it will get even slower as more pages are added (new entries are added at the end).<br><br>HTH,<br>Ulrich<br>]]>
   </description>
   <pubDate>Thu, 03 Jul 2008 09:03:11 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4361.html#4361</guid>
  </item> 
  <item>
   <title><![CDATA[SetPageSize - Why so slow? : I have a simple routine which...]]></title>
   <link>http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4357.html#4357</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=872">waynefulcher</a><br /><strong>Subject:</strong> 917<br /><strong>Posted:</strong> 01 Jul 08 at 12:16PM<br /><br /><DIV>I have a simple routine which will take a text file and convert it to a PDF.</DIV><DIV>One of my text files works out to be around 3,500 pages.</DIV><DIV>My logic was taking about 5 minutes to convert this file. I displayed a pagecount as it was converting and I noticed the more pages that were added the slower the next page would take.&nbsp;So I researched to find out&nbsp;what was slowing down the more pages that were being created. What I found was if I remove a single line of code which was PDF.SetPageSize(ReportPageSize) then it only took about 10 seconds to convert the text file. The actual PageSize needed is passed in as a parameter. Below is a simplified code snipit to get across what I am doing.</DIV><DIV>&nbsp;</DIV><DIV>...</DIV><DIV>while not end of text file....</DIV><DIV>&nbsp; &#091;read a pages worth of data from the text file.&#093;</DIV><DIV>&nbsp; PDF.NewPage ;<BR>&nbsp; PDF.SelectPage(PDF.PageCount) ;<BR>&nbsp; PDF.SetPageSize(ReportPageSize) ;&nbsp; &lt;- This line is the&nbsp;problem<BR>&nbsp; &#091;write the text data to the currently selected page.&#093;</DIV><DIV>end of while loop</DIV><DIV>PDF.SaveToFile(SomeFileName) ;</DIV><DIV>&nbsp;</DIV><DIV>My question is: Is there a way to tell the PDF document up front that I want all my pages to be "Some Size" so I do not have to make that call for each page? Or can someone with source code see if they can make that method call more efficent?</DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance.</DIV><DIV>Wayne</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 01 Jul 2008 12:16:18 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/setpagesize-why-so-slow_topic917_post4357.html#4357</guid>
  </item> 
 </channel>
</rss>