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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Write Unicode character in the table
  FAQ FAQ  Forum Search   Register Register  Login Login

Write Unicode character in the table

 Post Reply Post Reply
Author
Message
sjnam07 View Drop Down
Beginner
Beginner


Joined: 25 Dec 18
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote sjnam07 Quote  Post ReplyReply Direct Link To This Post Topic: Write Unicode character in the table
    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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 25 Dec 18 at 6:43PM
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

Back to Top
sjnam07 View Drop Down
Beginner
Beginner


Joined: 25 Dec 18
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote sjnam07 Quote  Post ReplyReply Direct Link To This Post Posted: 26 Dec 18 at 2:17PM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 26 Dec 18 at 3:50PM
Like i've written:
Perhaps it's a korean font - not able to show unicode characters?
Cheers,
Ingo

Back to Top
sjnam07 View Drop Down
Beginner
Beginner


Joined: 25 Dec 18
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote sjnam07 Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 18 at 8:32AM
Hello,

No, Korean characters, which are unicode, are not shown only in the table. Without table, Korean characters can be shown well.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (1) Thanks(1)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Dec 18 at 6:23PM
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

Back to Top
sjnam07 View Drop Down
Beginner
Beginner


Joined: 25 Dec 18
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote sjnam07 Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jan 19 at 2:05PM
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store