Rev | Line | |
---|
[42] | 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 | |
---|
| 12 | // Create a new encoder and backend to generate PNG images |
---|
| 13 | try { |
---|
| 14 | $encoder = new PDF417Barcode($columns,$errlevel); |
---|
| 15 | $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder); |
---|
| 16 | $backend->ShowText(true); |
---|
| 17 | $backend->SetModuleWidth($modwidth); |
---|
| 18 | $backend->Stroke($data); |
---|
| 19 | } |
---|
| 20 | catch(JpGraphException $e) { |
---|
| 21 | echo 'PDF417 Error: '.$e->GetMessage(); |
---|
| 22 | } |
---|
| 23 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.