線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1671
推到 Plurk!
推到 Facebook!

llionsoft TPDFDocument 出不到中文字

尚未結案
SuperLowB
初階會員


發表:96
回覆:77
積分:34
註冊:2003-06-11

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-01-29 15:04:14 IP:203.198.xxx.xxx 訂閱
請問各位, 有沒有人用過llionsoft 的產品TPDFDocument, 它說話可以support unicode, 但連中文Big5 都出不到
我不知是否我的coding有問題, 請大家幫忙:

在以下程式我的String 是 "你好嗎abc" 但用 PDFDocument1.CurrentPage.TextOut(10, 20, 0,S) 出不到 "你好嗎", 只出到"abc",
但如果我用 PDFDocument1.CurrentPage.UnicodeTextOut(10,20, 0,PWord(s),length('s')) (remark的一行) 就什麼都看不見...
是不是我程式上出問題?

[code delphi]
procedure TForm1.Button1Click(Sender: TObject);
var
PDFDocument1:TPDFDocument;
s:string;
begin
try
PDFDocument1:=TPDFDocument.Create(nil);
s:='你好嗎abc';
PDFDocument1.FileName := 'D:\test.pdf';
PDFDocument1.AutoLaunch := true;
PDFDocument1.BeginDoc;
PDFDocument1.CurrentPage.Orientation:=poPageLandscape;
PDFDocument1.CurrentPage.SetActiveFont('Courier',[],9,CHINESEBIG5_CHARSET);
PDFDocument1.CurrentPage.TextOut(10, 20, 0,S);
//PDFDocument1.CurrentPage.UnicodeTextOut(10,20, 0,PWord(s),length('s')
PDFDocument1.EndDoc;
finally
FreeAndNil(PDFDocument1);
end;
[/code]
TextOut 的定義是這樣:
procedure TextOut(X: Extended, Y: Extended, Orientation: Extended, TextStr: string);

UnicodeTextOut的定義是這樣:
procedure UnicodeTextOut(X: Extended, Y: Extended, Orientation: Extended, Text: PWord, Len:Integer);
編輯記錄
SuperLowB 重新編輯於 2008-01-29 15:06:10, 註解 無‧
SuperLowB 重新編輯於 2008-01-29 15:06:27, 註解 無‧
SuperLowB 重新編輯於 2008-01-29 15:06:53, 註解 無‧
SuperLowB 重新編輯於 2008-01-29 15:11:17, 註解 無‧
SuperLowB 重新編輯於 2008-01-29 15:15:26, 註解 無‧
系統時間:2024-05-15 22:56:33
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!