source: trunk/xgraph/jpgraph/Examples/pdf417_ex1c.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 705 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 = 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
13try {
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}
20catch(JpGraphException $e) {
21        echo 'PDF417 Error: '.$e->GetMessage();
22}
23?>
Note: See TracBrowser for help on using the repository browser.