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!
Write Unicode character in the table |
Post Reply |
Author | |
sjnam07
Beginner Joined: 25 Dec 18 Status: Offline Points: 12 |
Post Options
Thanks(0)
Posted: 25 Dec 18 at 1:51PM |
Hello,
I'm trying to write Unicode character in the table like this. (I'm using DLL version of QP) DPL.SetOrigin(1); DPL.AddCJKFont(5);//Try to use Korean character DPL.SetPageSize(L"A4"); DPL.SetMeasurementUnits(1); DPL.SetTextSize(20); DPL.DrawTextBox(10, 280, 190, 10, L"안녕하세요", 0); //It works int id = DPL.CreateTable(6, 5); DPL.SetTableBorderColor(id, 0, 0, 0, 0); DPL.SetTableBorderWidth(id, 0, 0.2); DPL.SetTableRowHeight(id, 1, 6, 10); DPL.SetTableColumnWidth(id, 1, 5, 35); DPL.SetTableCellAlignment(id, 1, 1, 6, 5, 4); DPL.SetTableCellTextSize(id, 1, 1, 6, 5, 5); DPL.SetTableCellTextColor(id, 1, 1, 6, 5, 0, 0, 0); DPL.SetTableCellContent(id, 1, 1, L"1a가"); DPL.SetTableCellContent(id, 2, 1, L"2b나"); DPL.SetTableCellContent(id, 3, 1, L"3c다"); DPL.SetTableCellContent(id, 4, 1, L"4d라"); DPL.SetTableCellContent(id, 5, 1, L"5e마"); DPL.SetTableCellContent(id, 6, 1, L"6f바"); DPL.DrawTableRows(id, 10, 30, 100, 1, 6); //It shows only alphabet and number character, not Korean How can I write Unicode character in the table? Thank you in advance.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi sjnam07,
if you look into the online reference you'll see that content is handled as unicode (wchar): https://www.debenu.com/docs/pdf_library_reference/SetTableCellContent.php So you don't have to do any special things - strings are handled as unicode. The only thing you have to put an eye on is to select a font which is able to represent characters in unicode format. A problem can be your development environment. If it's an older vb6 for example you have to convert thr strings to unicode first. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
sjnam07
Beginner Joined: 25 Dec 18 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Hello Ingo,
Thank you for fast reply. I wonder what DPL.DrawTextBox() with Korean works, but SetTableCellContent() doesn't work. Both are in the same source code file encoded to unicode. I'm using Visual Studio 2017 with MFC. Do you have other clues? Thank you Sangjae
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Like i've written:
Perhaps it's a korean font - not able to show unicode characters? |
|
Cheers,
Ingo |
|
sjnam07
Beginner Joined: 25 Dec 18 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Hello,
No, Korean characters, which are unicode, are not shown only in the table. Without table, Korean characters can be shown well.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(1)
|
i've tried the enhanced search function here on the page for you ;-)
Please have a look on the sample (regarding unicode) from AndrewC (R.I.P.): http://www.quickpdf.org/forum/tables-and-columns_topic2058_post9631.html?KW=unicode+table#9631 Here's a second thread could be worth to have an eye on it: http://www.quickpdf.org/forum/forum_posts.asp?TID=3133&KW=unicode+table&PID=12541&title=gettablecelldblproperty#12541 Here's a third thread could be worth to have an eye on it: http://www.quickpdf.org/forum/forum_posts.asp?TID=3581&KW=unicode+table&PID=14271&title=printing-chinese-is-a-random-code#14271 |
|
Cheers,
Ingo |
|
sjnam07
Beginner Joined: 25 Dec 18 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Hello,
I finally found the solution from one of your link! - http://www.quickpdf.org/forum/tables-and-columns_topic2058_post9631.html?KW=unicode+table#9631 When I write Unicode text in the table, I need to call SetHTMLNormalFont(). Because in the API document, table uses html text. Thank you very much.
|
|
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