source: trunk/xgraph/jpgraph/Examples/pdf417_ex5.php

Last change on this file was 42, checked in by marrucho, 11 years ago
File size: 917 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2require_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
14try {
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}
26catch(JpGraphException $e) {
27 echo 'PDF417 Error: '.$e->GetMessage();
28}
29?>
Note: See TracBrowser for help on using the repository browser.