<?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 : Drawing unicode text</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 : Drawing unicode text]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 06:16:01 +0000</pubDate>
  <lastBuildDate>Mon, 09 Jan 2012 05:25:00 +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=2090</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[Drawing unicode text : Unicode text is pretty well supported...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8915.html#8915</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 09 Jan 12 at 5:25AM<br /><br />Unicode text is pretty well supported in QPL 8.13 and above. &nbsp;Here is some C# code that adds all characters in the Arial Unicode MS font using the QP.AddTrueTypeSubsettedFont.<div><br></div><div>Currently AddTrueTypeFont only adds the first 255 characters or the character encoding that was selected such as Codepage 1250. &nbsp;We will be looking to fix this soon as is it a bit confusing.<br><div><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StringBuilder sb = new StringBuilder(65000);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sb.Length = 65000;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int i = 32; i &lt; 65000; i++)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sb&#091;i-32&#093; = (char)i;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int id = QP.AddTrueTypeSubsettedFont("Arial Unicode MS", sb.ToString(), 0);<br ="Apple-interchange-newline"></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // The line below should work just as well if you only need a subset.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //int id = QP.AddTrueTypeSubsettedFont("Arial Unicode MS", "אבגדה &nbsp; ABCDEF123456 " , 0);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SelectFont(id);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SetOrigin(1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 20, "12345 ABCDE abcde ÄæØòÿÜ£üäÆ");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 40, "안녕하세요 &nbsp; &nbsp;ABCDEF123456");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 60, "אבגדה &nbsp; ABCDEF123456 " + (char)0x05D0 + (char)0x05D1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 80, "ФЫВА &nbsp;ABCDEF123456");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 100, &nbsp;"联系电话 (Subset) Chinese");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 120, &nbsp;"これは、あなたが述べてきたように解決するために、ケビンの問題です");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 140, &nbsp;"私はこれが働くことを望んで which is \"I hope this works\" in Japanese");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 160, &nbsp;"联系电话");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.DrawText(10, 180, "И β ϖ ∝ ⊕ ≈ ⅜ ∂");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SaveToFile("out.pdf");</div><div><br></div></div></div>]]>
   </description>
   <pubDate>Mon, 09 Jan 2012 05:25:00 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8915.html#8915</guid>
  </item> 
  <item>
   <title><![CDATA[Drawing unicode text : Hi ashmid,I did a little play...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8911.html#8911</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1569">edvoigt</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 07 Jan 12 at 2:56PM<br /><br />Hi ashmid,<br><br>I did a little play with your problem. It gives you a foot in the door. First a bad news:<br><br>It seems to be, that QuickPDF (8.13, Delphi 7, Windows XP) deals with unicode fonts only ouside the ascii-range, when you set a codepage. Ommitting the codepage in the fontname brings a lot of white screen but no text.<br><br>But independend from the codepage you have sure the ascii-codes&lt;128 too.<br><br>The problem not so much inside QuickPDF, the most is around. In my example, I deal with unicodes as numbers. I did make no assumption about the real source of the text to draw. <br><br>Here the samplecode:<br><font face="Courier New, Courier, mono">var<br>&nbsp; QP: TQuickPDF;<br>&nbsp; x, tw: double;<br>&nbsp; i: integer;<br>&nbsp; w: WideString;<br>&nbsp; wc: wideChar;<br>&nbsp; id_heb: integer;<br>const // example letters from start of genesis<br><font color="#0033FF">// source: http://www.ancient-hebrew.org/14_htmlfonts.html)</font><br>&nbsp; genesis: array&#091;0..50&#093; of integer =<br>&nbsp;(1489,1468,1456,1512,1461,1513,1473,1460,1497,1514,<br>&nbsp; 1489,1468,1464,1512,1464,1488,1488,1457,1500,1465,<br>&nbsp; 1492,1460,1497,1501,1488,1461,1514,1492,1463,1513,<br>&nbsp; 1473,1468,1464,1502,1463,1497,1460,1501,1493,1456,<br>&nbsp; 1488,1461,1514,1492,1464,1488,1464,1512,1462,1509,1475);<br>&nbsp; aleph: WideChar = WideChar($05D0); // give them names if you want<br>&nbsp; holam: WideChar = WideChar($05B9);<br>begin<br>&nbsp; QP := TQuickPDF.Create;<br>&nbsp; QP.UnlockKey({$I PDFkey.inc});<br>&nbsp; QP.SetMeasurementUnits(1);<br>&nbsp; QP.SetOrigin(0);<br>&nbsp; QP.SetPageDimensions(210, 297);<br>// for me it looks as AddTrueTypeFont without codepage does not work for unicode<br>// so we need the font multiple with different codepages for different languages<br><br>&nbsp; id_heb := QP.AddTrueTypeFont('Microsoft Sans Serif <font color="#CC0000">{1255}</font>', 0); // important<br>&nbsp; QP.SelectFont(id_heb);<br>&nbsp; QP.SetTextSize(16);<br><br>&nbsp; w := '';<br>&nbsp; for i:=0 to SizeOf(genesis)-1<br>&nbsp; do w := WideChar(genesis&#091; i &#093;)+w; // make it unicode from right to left<br>&nbsp; QP.DrawText(20,270, w);<br><br>&nbsp; QP.SetTextSize(8);<br>&nbsp; QP.DrawText(20, 260, 'now we try to make it better:');<br><br>&nbsp; QP.SetTextSize(16);<br>&nbsp; x := 150; tw := 0;<br>&nbsp; for i:=0 to SizeOf(genesis)-1<br>&nbsp; do begin<br>&nbsp;&nbsp;&nbsp; wc := WideChar(genesis&#091; i &#093;);<br><font color="#990000">&nbsp;&nbsp;&nbsp; if (ord(wc)&gt;=$05D0)&nbsp; // letter or other</font><br>&nbsp;&nbsp;&nbsp; then begin<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x := x-tw;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // left by the size of last letter before<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tw := QP.GetTextWidth(wc);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QP.DrawText(x, 260, wc);<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; else begin // here is more to do: depending on correct position to the letter<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QP.DrawText(x+tw/2, 260, wc); // but I have not the knowledge for this<br>&nbsp;&nbsp;&nbsp; end;<br>&nbsp; end;<br>// show letters + (ascii-)numbers<br>&nbsp; w := '';<br>&nbsp; for i:=$05D0 to $05EA&nbsp; // hebrew letters<br>&nbsp; do begin<br>&nbsp;&nbsp;&nbsp; wc := WideChar(i);<br>&nbsp;&nbsp;&nbsp; w := wc + w;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // bring the letters in right to left order<br>&nbsp; end;<br>// and numbers too<br>&nbsp; for i:=ord('9') downto ord('0') do w := WideChar(i) + w;<br>&nbsp; QP.SelectFont(id_heb);<br>&nbsp; QP.SetTextSize(16);<br>&nbsp; QP.DrawText(180-QP.GetTextWidth(w), 250, w);<br></font><br>I don't know anything about rules for diacrytics-positions and what I really write in hebrew. You may see that I decide easy by unicode-value how to deal a single char and put the text char by char on the line. So you have a way for correct position of akcents and so on. There is something to do, but you may see it works.<br><br><br>Cheers,<br>Werner <br>]]>
   </description>
   <pubDate>Sat, 07 Jan 2012 14:56:31 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8911.html#8911</guid>
  </item> 
  <item>
   <title><![CDATA[Drawing unicode text :  Hi!It&amp;#039;s functionality from...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8907.html#8907</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 06 Jan 12 at 9:47PM<br /><br />Hi!<br><br>It's functionality from my Delphi 2007.<br>There it's encodeUtf8/decodeUtf8 ...<br>There should be something similar in any <br>other language (for utf16, too).<br>This has nothing to do with QuickPDF.<br>If you wanna search here regarding<br>your issue you should search with<br>"unicode", "codepage" or similar. Here<br>are few threads regarding asian languages, too. <br><br>Cheers, Ingo&nbsp; <br><span style="font-size:10px"><br /><br />Edited by Ingo - 06 Jan 12 at 9:49PM</span>]]>
   </description>
   <pubDate>Fri, 06 Jan 2012 21:47:39 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8907.html#8907</guid>
  </item> 
  <item>
   <title><![CDATA[Drawing unicode text : Hi Ingo,Thank you for you quick...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8905.html#8905</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1805">ashmid</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 06 Jan 12 at 10:18AM<br /><br />Hi Ingo,<br>Thank you for you quick reply.<br>I remain puzzled, though, by your use of the terms encodeUtf16 and decodeUtf16. A search for these terms in the Quickpdf documents (developer guide and function reference) does not turn up any results, nor are there any results when searching the forum for these terms (other than your message itself).<br>To what do you refer when you say "use something like encodeUtf16"?<br>(I'm using QuickPDF version 8.13. All of the strings that I am sending to DrawText are widechar Unicode16 strings).<br>]]>
   </description>
   <pubDate>Fri, 06 Jan 2012 10:18:39 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8905.html#8905</guid>
  </item> 
  <item>
   <title><![CDATA[Drawing unicode text : Hi!Internally strings will be...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8903.html#8903</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 06 Jan 12 at 9:48AM<br /><br />Hi!<br><br>Internally strings will be handled as unicode.<br>Up to library version 7.26 they were encoded as utf8.<br>Starting from 8.xx version they are encoded with utf16.<br>So if you wanna handle with unicode before input you <br>should use something like encodeUtf16 or for output<br>decodeUtf16.<br>Sorry... a pretty common answer but i think in this direction<br>you should search...<br>BTW: The searchfunction is here at the top right... <br>Give it a try ;-)<br><br>Cheers and welcome here,<br>Ingo<br><br>]]>
   </description>
   <pubDate>Fri, 06 Jan 2012 09:48:53 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8903.html#8903</guid>
  </item> 
  <item>
   <title><![CDATA[Drawing unicode text : I am currently evaluating the...]]></title>
   <link>http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8902.html#8902</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1805">ashmid</a><br /><strong>Subject:</strong> 2090<br /><strong>Posted:</strong> 06 Jan 12 at 9:20AM<br /><br />I am currently evaluating the quickpdf library for purchase. Our primary work involves Hebrew texts, hence I began by experimenting with Quickpdf's ability to write Hebrew text within a PDF document. However, here I ran into a problem.<br>If I simply start by opening a file and calling DrawText with a Hebrew string, the string is not properly written to the file: viewing the file in Acrobat shows a blank screen. If I DrawText a string that is partially numbers and partially Hebrew letters, the numbers how but the Hebrew characters do not.<br>I tried adding a call to AddTrueTypeFont(), to specify the "Arial Unicode MS" font, which contains a fairly complete set of Hebrew codepoints. However, even with that call, and a subsequent call to select the font (both of which returned success), the Hebrew characters are still missing in the resulting PDF.<br>I did manage to successfully output Hebrew text by calling AddTrueTypeSubsettedFont(), and by providing it with the full Hebrew alphabet in quotes. However, I was then limited to that specific set of characters, and none of punctuation marks or numbers were output correctly. However, I don't want to be limited a specific set of characters; I want to be able to write out any unicode character. <br>I'm looking for a way to simply include a truetype font with all its relevant unicode codepoints (without necessarily embedding the font), and to then be able to write unicode text freely without having to create a font subset for each DrawText.&nbsp; (I did try to feed AddTrueTypeSubsettedFont() a subset that included all ASCII characters and all characters in the Hebrew code page, but that didn't work either).<br>Any ideas?<br><br>]]>
   </description>
   <pubDate>Fri, 06 Jan 2012 09:20:22 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawing-unicode-text_topic2090_post8902.html#8902</guid>
  </item> 
 </channel>
</rss>