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 = 4; // Use error level 4 |
---|
10 | $modwidth = 2; // Setup module width (in pixels) |
---|
11 | $height = 2; // Height factor (=2) |
---|
12 | $showtext = false; // Show human readable string |
---|
13 | |
---|
14 | // Create a new encoder and backend to generate PNG images |
---|
15 | try { |
---|
16 | $encoder = new PDF417Barcode($columns,$errlevel); |
---|
17 | $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder); |
---|
18 | $backend->SetModuleWidth($modwidth); |
---|
19 | $backend->SetHeight($height); |
---|
20 | $backend->NoText(!$showtext); |
---|
21 | $backend->Stroke($data); |
---|
22 | } |
---|
23 | catch(JpGraphException $e) { |
---|
24 | echo 'PDF417 Error: '.$e->GetMessage(); |
---|
25 | } |
---|
26 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.