activePDF Toolkit 2011 API リファレンス
バーコードの作成
チュートリアル
> バーコードの作成
Glossary Item Box
このサンプルでは、Toolkit を使用してテンプレート PDF のフォーム フィールドに
Code 39
バーコードを設定し、フォーム フィールドを単層化します。このチュートリアルを始めるにあたり、 テキスト ボックス フィールド (フィールド名 : Image1 を含んだ 1 ページの PDF (ファイル名 :
input1.pdf
) が必要です。
例:
strPath
=
CreateObject
("Scripting.FileSystemObject").
GetAbsolutePathName
(".") & "\"
Set
TK
=
CreateObject
("APToolkit.Object")
Set
barcode
=
CreateObject
("APToolkit.Barcode")
barcode.Symbology
=
0
barcode.BorderStyle
=
0
barcode.SymbolMarginBottom
=
0
barcode.SymbolMarginTop
=
0
barcode.SymbolMarginRight
=
0
barcode.SymbolMarginLeft
=
0
barcode.Value
= "This is the encoded information for the barcode"
r
=
TK.OpenOutputFile
("BarcodeInField.pdf")
r
=
TK.OpenInputFile
("Input1.pdf")
TK.SetFormFieldData
"Image1"
, barcode.AsString,
-996
r
=
TK.CopyForm
(
0
,
0
)
TK.CloseOutputFile
Set
barcode
=
Nothing
Set
TK
=
Nothing