<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote type="cite"
cite="mid:alpine.DEB.2.20.1903190948540.13821@home.telenet.be">
<br>
<blockquote type="cite">Hi,
<br>
<br>
I am trying work with fpPDF. I can create PDF document, but
character out of ASCII range are displayed wrong (in PDF file
they are stored as UTF8).
<br>
Probably it is because I use standard Courier font, which is
expecting only "Latin characters" ? I use:
<br>
<br>
FontIndex := PDF.AddFont('Courier'); // --> test1.pdf
<br>
<br>
When I want to use TTF font:
<br>
<br>
FontIndex := PDF.AddFont('cour.ttf','CourierNew'); // -->
test2.pdf
<br>
(nothing else this line has changed)
<br>
<br>
I get strange PDF file (I can open it but content is wrong)
<br>
<br>
What I am doing wrong? Is there way how to get correct PDF with
characters from Latin2 code page?
<br>
</blockquote>
<br>
Not to my knowledge. You must use unicode for characters outside
the ASCII range.
<br>
</blockquote>
<p>Seems, that Adobe in
<a class="moz-txt-link-freetext" href="https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf">https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf</a>
in Annex D2: "<span style="left: 92.9324px; top: 107.896px;
font-size: 15.7513px; font-family: sans-serif; transform:
scaleX(1.05906);">Latin Character Set and Encodings</span>"
specifies exactly which characters are supported (by standard 14
fonts). Characters not listed there are simply replaced by "X" in
Adobe Acrobat Reader. But Foxit reader displays them correctly (so
I can use full range of characters from CP1250 when I specify
appropriate <</Type /Encoding /BaseEncoding /WinAnsiEncoding
/Differences [...] ...<br>
</p>
<p>Seems that in case when standard fonts are used fpPDF does not
convert Utf8String on input of WriteText() function CP1252 ...?<br>
<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:alpine.DEB.2.20.1903190948540.13821@home.telenet.be">
<br>
<blockquote type="cite">Is there way how to get correct PDF file
WITHOUT embedding full Courier font?
<br>
</blockquote>
<br>
You can embed only the needed characters for every font ?
<br>
</blockquote>
Probably yes, but fpPDF will not handle this automatically? AFAIK I
can not control this.<br>
<p>But why I get unreadable characters? What I am doing wrong ?</p>
<p>-Laco.</p>
<br>
</body>
</html>