DrawBarcode

向量圖形、條碼

描述

在所選頁面上繪製條碼

Code128 的條碼是 "B" 與 "C" 兩組字元集的組合,能得到最緊湊的編碼

把 Barcode 參數設為 3(Code128),並在適當位置放進 "[FNC1]" 字串或 ASCII GS 字元(#29),即可繪製 GS1-128 條碼(又稱 EAN-128)。例如:

"[FNC1]21ABC123[FNC1]2013"

上面的例子表示序號(AI 21)為 "ABC123",產品變體(AI 20)為 "13"

語法

Delphi

Function TPDFlib.DrawBarcode(Left, Top, Width, Height: Double; Const Text: WideString; Barcode, Options: Integer): Integer;

ActiveX

Function PDFlib::DrawBarcode(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Barcode As Long, Options As Long) As Long

DLL

int DLDrawBarcode(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t* Text, int Barcode, int Options);
int DLDrawBarcodeA(int InstanceID, double Left, double Top, double Width, double Height, const char* Text, int Barcode, int Options);

參數

Left條碼左緣的水平座標
Top條碼上緣的垂直座標
Width條碼的寬度
Height條碼的高度
Text條碼資料。在條碼資料字串後面附加以下內容即可旋轉條碼:/RC = 順時針旋轉 /RA = 逆時針旋轉 /RU = 旋轉 180 度
Barcode1 = Code39(又稱 Code 3 of 9) 2 = EAN-13 3 = Code128 4 = PostNet 5 = Interleaved 2 of 5 6 = EAN-8 7 = UPC-A 8 = Code93 9 = UPC-E 10 = Codabar
OptionsCode39:0 = 預設繪製 EAN-13:0 = 只畫條碼 1 = 延伸護線 2 = 畫出人類可讀數字 3 = 畫出人類可讀數字並加右側間隔 Code128:0 = 預設繪製 PostNet:0 = 預設繪製 Interleaved 2 of 5:0 = 不加檢查碼、無護線 1 = 加檢查碼字元、無護線 2 = 不加檢查碼、畫護線 3 = 加檢查碼字元並畫護線 要把條碼線寬縮減 10%,把 Options 參數值加 10

Type 10 繪製 Codabar(BS EN 798):文字必須以起始/停止字母 A、B、C、D 之一開頭與結尾,本體可包含數字與符號 - $ : / . +;符號採用模組寬度為 3 的公制化編碼

類型 9 繪製 UPC-E:傳入六個資料位,位數不足時在左側補零;或傳入完整的八位形式,即數字系統 0、六個資料位與會加以驗證的檢查碼;數字以外的字元會被忽略,其他位數、其他數字系統或錯誤的檢查碼都會讓呼叫傳回 0

傳回值

0無法繪製條碼。Barcode 或 Options 參數無效。
1條碼繪製成功