Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Codepage |
Post Reply |
Author | |
eborger
Team Player Joined: 29 Apr 09 Location: Brazil Status: Offline Points: 33 |
Post Options
Thanks(0)
Posted: 15 Apr 20 at 4:46PM |
Hello,
I am trying to use baltic codepage (CP1257), and I cannot get all characters I need, I made a test program printing all characters from 00 to 255, and several characters that are special to baltic language do not show in the resulting pdf. I used AddTrueTypeFont "Arial {1257}" (and other code pages as well) but did not get the whole table. Can you help ? Thanks, Edgar Edited by eborger - 15 Apr 20 at 4:53PM |
|
eborger
Team Player Joined: 29 Apr 09 Location: Brazil Status: Offline Points: 33 |
Post Options
Thanks(0)
|
runing the same program with V.7 works fine, with V.10 not
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Edgar,
what do you mean with V.7 and V.10? Windows 7 and Windows 10? Or QuickPDF-version 7.xx and version 10.xx? You'll know that'snot enough to embed the font - you have to select it, too. Did you check that the font is embedded successfully? Perhaps it has to do with how you're working with the strings? You'll know that QuickPDF-strings are unicode strings? Your relevant code could be very useful to help... |
|
Cheers,
Ingo |
|
eborger
Team Player Joined: 29 Apr 09 Location: Brazil Status: Offline Points: 33 |
Post Options
Thanks(0)
|
Hi Ingo,
I meant the quick pdf library version, V7.26 and V10.16. Windows is 10 (the same machine). and yes, I selected the font, as I said, the same program works for v7 and v10 of QPDF lib, the only difference is the strings that are unicode for V10 and ANSI for V7. I can send you both files if you wish, just give me an email. Thanks for your help, and regards, Edgar |
|
eborger
Team Player Joined: 29 Apr 09 Location: Brazil Status: Offline Points: 33 |
Post Options
Thanks(0)
|
regarding the code, it is in Xbase++, bellow is a prototype of the code I use:
fn := pdf:qCall("AddTrueTypeFont", pdf:oPdf, cszansi2wide('Arial {1257}'), 0 ) load font Arial with codepage 1257 oFont := pdf:qCall( "SelectFont", pdf:oPdf, fn ) select loaded font ok := pdf:qCall( "SetTextSize", pdf:oPdf, Dbl(8) ) set size to 8 (font = 8.Arial x = 32 l = 6 for i = 2 to 15 for j = 0 to 15 pdf:qCall("DrawText", pdf:oPdf, dbl(l), dbl(8.5+(j*3)) , cSzAnsi2Wide(chr(x)) ) draw text x = x + 1 next j l = l + 2 next i I hope you can understand the coding, let me know if you have any questions
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Edgar,
if i read "ansi2wide" i think in this direction you should search further more. You should use more control cause you don't know what's wrong. After each function call don't work with the returning value but first check if this value is a valid one. After each function call you can use a LastErrorCode to check if it's all okay. If you want you can send me your pdf files to check them by myself (i've sent you an email). This i've written in a past thread: "...nternally strings will be handled as unicode. Up to library version 7.26 they were encoded as utf8. Starting from 8.xx version they are encoded with utf16. So if you wanna handle with unicode before input you should use something like encodeUtf16 or for output decodeUtf16...." If you'll search in the online references of Debenu/Foxit you'll find many similar issues... Reading the content of the three links below willgive you an idea what i mean: http://www.quickpdf.org/forum/dplsetformfieldvaluebytitlea-and-utf8_topic3632.html http://www.quickpdf.org/forum/getpagetext4-returns-cryptic-characters_topic1914.html https://www.debenu.com/docs/pdf_library_reference/SetAnsiMode.php |
|
Cheers,
Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
In the developer guide you should read the chapter:
Unicode, UTF-8 and the DLL and Delphi Editions |
|
Cheers,
Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Edgar,
if i look inside both pdf-files i can see that they were made with the same dev-code-syntax. On the other side string handling was changed (directly after 7.26)
from utf-8 to utf-16 to make it easier creating really global apps. Now you'll need string to unicode conversion. Your "cszansi2wide" seems to be a bit older? It'll work with utf-8 but obviously not with utf-16.
Cheers, Ingo |
|
Cheers,
Ingo |
|
eborger
Team Player Joined: 29 Apr 09 Location: Brazil Status: Offline Points: 33 |
Post Options
Thanks(0)
|
Thanks Ingo for pointing my in the right direction, the difference is UTF-16 instead of UTF-8, so I am converting from ANSI now using MultiByteToWideChar(), and the tricky part is that you have to use the correct codepage as one (the first) of the parameters in this function.
using MultiByteToWideChar(1257, etc, etc ) works fine. Thank you and stay safe.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store