<?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 : DrawHTMLTextBox and text height</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 : DrawHTMLTextBox and text height]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 19:57:16 +0000</pubDate>
  <lastBuildDate>Mon, 19 Mar 2012 12:26:37 +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=2190</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[DrawHTMLTextBox and text height : I found, that value returned by...]]></title>
   <link>http://www.quickpdf.org/forum/drawhtmltextbox-and-text-height_topic2190_post9342.html#9342</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1320">Jan</a><br /><strong>Subject:</strong> 2190<br /><strong>Posted:</strong> 19 Mar 12 at 12:26PM<br /><br />I found, that value returned by GetHTMLTextHeight depends on value spacing parameter HTML text. Same single-line HTML text, same font, different spacing and different text height:<DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> iFontID = qp.AddTrueTypeFont(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Times New Roman"</FONT></FONT><FONT size=2>, 0);</FONT></DIV><DIV><FONT size=2>qp.SetHTMLNormalFont(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Times New Roman"</FONT></FONT><FONT size=2>, iFontID);</FONT></DIV><DIV><FONT size=2><FONT color=#0000ff>string</FONT><FONT size=2>&nbsp;</FONT>&nbsp;textHTML = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"&lt;p spacing=\"-2pt\" align=\"left\"&gt;&lt;font size=\"11pt\"&gt;Test text test text&lt;/font&gt;&lt;/p&gt;"</FONT></FONT><FONT size=2>;</FONT></DIV><DIV><FONT size=2>qp.DrawHTMLTextBox(10, 350, 300, 200, textHTML);</FONT></DIV><DIV><FONT size=2><FONT color=#0000ff>double</FONT><FONT size=2>&nbsp;height</FONT> = qp.GetHTMLTextHeight(300, textHTML);</FONT></DIV><DIV><FONT size=2>textHTML = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"&lt;p spacing=\"2pt\" align=\"left\"&gt;&lt;font size=\"11pt\"&gt;Test text test text&lt;/font&gt;&lt;/p&gt;"</FONT></FONT><FONT size=2>;</FONT></DIV><DIV><FONT size=2>qp.DrawHTMLTextBox(10, 400, 300, 200, textHTML);</FONT></DIV><DIV><FONT size=2>height = qp.GetHTMLTextHeight(300, textHTML);</DIV></FONT>]]>
   </description>
   <pubDate>Mon, 19 Mar 2012 12:26:37 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawhtmltextbox-and-text-height_topic2190_post9342.html#9342</guid>
  </item> 
  <item>
   <title><![CDATA[DrawHTMLTextBox and text height : Hi, I have a file in XSL-FO format...]]></title>
   <link>http://www.quickpdf.org/forum/drawhtmltextbox-and-text-height_topic2190_post9328.html#9328</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1320">Jan</a><br /><strong>Subject:</strong> 2190<br /><strong>Posted:</strong> 14 Mar 12 at 9:10AM<br /><br /><P>Hi, I have a file in XSL-FO format and I want convert it into PDF.<BR>And I have problem with difference of text height calculated at drawing/printing via C# <BR>and at insert in PDF file.<BR>In both environment I use 'pt' units.</P><P>Example XSL-FO:<BR>&lt;fo:block line-height="14.399999999999999pt" top="11.0pt" left="41.0pt" height="15.0pt" width="434.0pt" font-family="Times New Roman" font-size="12.0pt"&gt;Test text, test text, test text .... &lt;/fo:block&gt;</P><P>Inserting into PDF:</P><P>pdf.SetMeasurementUnits(0);&nbsp;&nbsp;&nbsp;&nbsp; // 0 = 1/72 inch "per unit" <BR>pdf.SetOrigin(1);</P><P>int idFont = pdf.AddTrueTypeFont("Times New Roman", 0);<BR>pdf.SetHTMLNormalFont("Times New Roman", idFont);</P><P>string textHTML = "&lt;p&gt;&lt;font size=\"12pt\"&gt;Test text, test text, test text .... &lt;/font&gt;&lt;/p&gt;";<BR>pdf.DrawHTMLTextBox(10, 10, 434, 15, textHTML);</P><P>int _height = pdf.GetHTMLTextHeight(434, textHTML);</P><P>Height of text at C# drawing/printing is lower than 15 pt, <BR>at inserting into PDF (variable _height) is higher than 15 pt (15,768 exactly).</P><P>Difference in this case is about 6%.<BR>Solution may be reduce font size at PDF creating by 6% and round down to integer, <BR>but I do not consider this the best solution.</P><P>Can you help me?<BR>Thanks&nbsp; <BR></P>]]>
   </description>
   <pubDate>Wed, 14 Mar 2012 09:10:06 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawhtmltextbox-and-text-height_topic2190_post9328.html#9328</guid>
  </item> 
 </channel>
</rss>