activePDF Toolkit 2011 API リファレンス
フォームフィールドへのバーコードの挿入
チュートリアル > フォームフィールドへのバーコードの挿入

Glossary Item Box

このチュートリアルでは、Toolkit を使用して DataMatrix バーコードを生成し、PDF ファイルのフォームフィールドへ設定します。このチュートリアルをはじめるにあたり、テキスト ボックス フィールドを含んだ 1 ページの PDF (ファイル名 field.pdf) が必要です。

ノート: このチュートリアルのコードは、X:\Program Files\activePDF\Toolkit\Examples\Barcodes に保存されています。

例:

strPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") & "\"

Set TK = CreateObject("APToolkit.Object")

Set barcode = CreateObject("APToolkit.Barcode")

barcode.Symbology = 41

barcode.BorderStyle = 0

barcode.SymbolMarginBottom = 0

barcode.SymbolMarginTop = 0

barcode.SymbolMarginRight = 0

barcode.SymbolMarginLeft = 0

barcode.Value = "this is some test data...blah blah blah"

r = TK.OpenOutputFile("BarcodeInField.pdf")

r = TK.OpenInputFile("field.pdf")

TK.SetFormFieldData "testField", barcode.AsString, -996

r = TK.CopyForm(0, 0)

TK.CloseOutputFile

Set barcode = Nothing

Set TK = Nothing