Line | |
---|
1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/pdf417/jpgraph_pdf417.php'); |
---|
3 | |
---|
4 | $data = 'PDF-417'; |
---|
5 | |
---|
6 | // Setup some symbolic names for barcode specification |
---|
7 | |
---|
8 | $columns = 8; // Use 8 data (payload) columns |
---|
9 | $errlevel = 2; // Use error level 2 (minimum recommended) |
---|
10 | $modwidth = 2; // Setup module width (in pixels) |
---|
11 | $height = 3; // Height factor |
---|
12 | |
---|
13 | // Create a new encoder and backend to generate PNG images |
---|
14 | try { |
---|
15 | $encoder = new PDF417Barcode($columns,$errlevel); |
---|
16 | $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder); |
---|
17 | $backend->SetModuleWidth($modwidth); |
---|
18 | $backend->SetHeight($height); |
---|
19 | $backend->Stroke($data); |
---|
20 | } |
---|
21 | catch(JpGraphException $e) { |
---|
22 | echo 'PDF417 Error: '.$e->GetMessage(); |
---|
23 | } |
---|
24 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.