When do you think, unicode support will be available in wPDF?
cu Christian
When do you think, unicode support will be available in wPDF?
cu Christian
This year, in wPDF 3.
Sounds good, but when is version 3 to be expected?
We have urgent needs for this functionality and may have to switch to another PDF library to be able to deliver.
Maybe we can join your beta program?
Urgent feedback much appreciated.
/Jani
Hi,
I have already started with that but it does not work yet. A beta will be available when that works. It is the most important part of V3
Julian
Little Tip for anyone wanting to use unicode now rather than later.
This code works fine when you want to write Chinese in wpdf 2, but should work with any language by changing font.
var
ws : widestring;
begin
ws := 'Some Chinese Text, from a unicode control, remember source code editor is not unicode enabled';
ws := tntedit1.text;
pdf.filename := 'c:\test.pdf';
pdf.BeginDoc;
pdf.StartPage(Round(8.3 * Screen.PixelsPerInch),Round(11.67 * Screen.PixelsPerInch),Screen.PixelsPerInch,Screen.PixelsPerInch,0);
with pdf.Canvas do begin
Font.Name := '@SimHei';
Font.Charset := GB2312_CHARSET;
font.size := 26;
TextOutW(Handle,xPix*62,yPix*32,PWideChar(ws),Length(ws));
end;
pdf.EndPage;
pdf.EndDoc;
end;
Alles anzeigen
Good Luck,
Richard Spurgeon :D
I tried your code with some russian strings and RUSSIAN_CHARSET and failed with it. Latin characters in the widestring were displayed correct and kyrillic characters were omitted. On a Delphi canvas all characters are displayed with your method.
Are there additional settings in the pdfPrinter necessary or what might be my fault?
Thanks
Gunter
Hi Gunter,
I have tested the below with some russian text and it works a treat. I have uploaded the resultant pdf file for you to see http://www.paramet.co.uk/test.pdf
I had to add wpExactTextPositioning to make the spacing right.
ws := '';
ws := tntedit1.text;
pdf.Modes := pdf.Modes + [wpExactTextPositioning];
pdf.filename := 'c:\test.pdf';
pdf.BeginDoc;
pdf.StartPage(Round(8.3 * Screen.PixelsPerInch),Round(11.67 * Screen.PixelsPerInch),Screen.PixelsPerInch,Screen.PixelsPerInch,0);
with pdf.Canvas do begin
Font.Name := '@Arial';
Font.Charset := RUSSIAN_CHARSET;
Font.size := 12;
TextOutW(Handle,62,32,PWideChar(ws),Length(ws));
end;
pdf.EndPage;
pdf.EndDoc;
Kind Regards,
Richard Spurgeon
Hi Richard,
thanks a lot for your fast amd extensive answer. The main difference seems to be the character '@' in the
font.name:='@Arial',
which yields to the exception 'Cannot load font data' on my PC. So I tried 'Arial' and 'Arial Unicode MS' as fontname but without success as before.
Can you tell me the meaning of the @ (Google wasn't very helpful for this)?
Kind regards,
Gunter
Hi,
I think the @ is used by the chinese font. Didn't see @Arial so far.
It is true that wPDF 2 supports chinese and japanese. It also supports Russian, Greek and East Europe charsets.
The most important part of the example code is:
Font.Charset := GB2312_CHARSET;
or
Font.Charset := RUSSIAN_CHARSET;
That is required for wPDF to select the correct charset in the PDF file.
wPDF 2 also includes unicode support for the outlines.
Julian
Hi,
now I know what was my mistake. I viewed the results of wPDF with the Acrobat Reader 5.0, which omitted the kyrillic characters. In WPviewPDF everything is ok.
Thank you very much, that was extremly helpful for me.
Gunter
Hi Gunther,
Glad to hear you got it working... I remember having the same problem in Abode Acrobat 5. I found that adobe acrobat 6 and 7 work fine.
I think, but dont quote me on it, that the @ symbol means font alias. I have tried searching myself but it seems google and altavista dont allow you to search for the @ character.
Kind Regards,
Richard Spurgeon.