Um Barcodes in bestehende PDF-Dokumente einzufügen, ist mit der Aloaha PDF SDK nur eine API nötig.
Folgende Barcode-Arten werden unterstützt:
- Code39 (or Code 3 of 9)
- EAN-13
- Code128
- PostNet
- Interleaved 2 of 5
Nachfolgend finden Sie einige Beispielskripte:
PDF Barcode API
Dim pdf
Dim infile
Dim outfile
Dim Barcode
'PDF coordinates in points
dim d_Left
dim d_Top
dim d_Width
dim d_Height
'Barcode Type
Dim b_type
'Code39= 1
'EAN-13 = 2
'Code128 = 3
'PostNet = 4
'Interleaved 2 of 5 = 5
b_type = 1
'Barcode Options
'B_options
if b_type=1 or b_type=3 or b_type=5 then
B_options=0
else
'value betwee 0-3
B_options=0
end if
'Barcode Direction
Dim B_Direction
'possible values are 0, 1, 2, 3
B_Direction = 0
Dim P_Page 'PDF Page to be used
P_Page = 1
'Background Image
Dim B_Image
This variable holds the path to an image to be used as background. Empty value will make Bardcode transparent.
B_Image = "c:\whitepixel.bmp"
If pdf.place_barcode(CDbl(d_Left), CDbl(d_Top), CDbl(d_Width), CDbl(d_Height), CStr(Barcode), CLng(b_type
), CLng(B_options), CLng(B_Direction), CLng(P_Page), CStr(B_Image)) = true Then
Call pdf.save_pdf_to_file(CStr(outfile))
End If