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