#1 2013-03-25 09:36:32

tracy108
Member
Registered: 2013-02-15
Posts: 3

Pdf font encode

How to set the font encode using unicode (UTF8) instead of Ansi?

Offline

#2 2013-03-25 10:54:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Pdf font encode

Which class are you using?
TPDFCanvas, or the VCL TCanvas class?

You have Unicode methods in TPDFCanvas.
For the VCL TCanvas, you can use directly the Windows Unicode APIs, just like with any VCL drawing.

Offline

#3 2013-03-25 15:51:38

tracy108
Member
Registered: 2013-02-15
Posts: 3

Re: Pdf font encode

I use the following :

pdfDoc.Canvas.SetFont('Arial', 10,[]);
pdfDoc.Canvas.TextOutW(10, 10, 'abc');

Thanks!

Offline

#4 2013-03-25 19:53:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Pdf font encode

TextOutW() will use Unicode, and encode them as expected.

Offline

Board footer

Powered by FluxBB