<?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 : FitTextBox</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 : Sample Code : FitTextBox]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 07 Mar 2026 09:18:46 +0000</pubDate>
  <lastBuildDate>Sat, 18 Jun 2016 09:07:12 +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=3347</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[FitTextBox : a sample code from &amp;#034;rweetch&amp;#034;.How...]]></title>
   <link>http://www.quickpdf.org/forum/fittextbox_topic3347_post13314.html#13314</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 3347<br /><strong>Posted:</strong> 18 Jun 16 at 9:07AM<br /><br />a sample code from "rweetch".<div>How to reduce fontsize to fit into the area of a fix textbox:</div><div><br></div><span style="line-height: 16.8px; : rgb251, 251, 253;">I couldn't see how to do this using the methods, so rolled my own and added it to my TDebenuPDF</span><span style="line-height: 16.8px; : rgb251, 251, 253;">Library</span><span style="line-height: 16.8px; : rgb251, 251, 253;">&nbsp;Helper. Here's the code if you are interested:</span><br style="line-height: 16.8px; : rgb251, 251, 253;"><br style="line-height: 16.8px; : rgb251, 251, 253;"><br style="line-height: 16.8px; : rgb251, 251, 253;"><span style="line-height: 16.8px; : rgb251, 251, 253;">procedure TsmDebenuPDFLibraryHelper.DrawDownScaledText(const aText: string; const X, Y aWidth, aHeight: Double);</span><div style="line-height: 16.8px; : rgb251, 251, 253;"><div>var lTextSize, lStartSize: Double;</div><div>begin</div><div><br></div><div>&nbsp; lStartSize := GetTextSize;</div><div>&nbsp; lTextSize := lStartSize;</div><div><br></div><div>&nbsp; if&nbsp;<span style="line-height: 16.8px;">GetWrappedTextHeight(aWidth, aText)</span>&nbsp;&gt; aHeight then</div><div>&nbsp; begin</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp;lTextSize := lStartSize;</div><div><br></div><div>&nbsp; &nbsp; repeat</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;lTextSize := lTextSize * 0.95;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;SetTextSize(lTextSize);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp;<span style="line-height: 1.4;">until (</span><span style="line-height: 16.8px;">GetWrappedTextHeight(aWidth, aText)</span><span style="line-height: 1.4;">&nbsp;&lt;= aHeight);</span></div><div><br></div><div>&nbsp; end;</div><div><br></div><div>&nbsp; DrawWrappedText(X, Y, aWidth, aText);</div><div><br></div><div>&nbsp; &nbsp;if lTextSize &lt; lStartSize then</div><div>&nbsp; &nbsp; &nbsp; SetTextSize(lStartSize);</div></div><div style="line-height: 16.8px; : rgb251, 251, 253;"><br></div><div><span style="line-height: 16.8px; : rgb251, 251, 253;">end;</span>&nbsp;</div>]]>
   </description>
   <pubDate>Sat, 18 Jun 2016 09:07:12 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/fittextbox_topic3347_post13314.html#13314</guid>
  </item> 
 </channel>
</rss>