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

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 863 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 = 2;  // Setup module width (in pixels)
11$height = 2;    // 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_IMAGE,$encoder);
18
19        $backend->SetModuleWidth($modwidth);
20    $backend->SetHeight($height);
21    $backend->NoText(!$showtext);
22    $backend->SetColor('black','yellow');
23    $backend->Stroke($data);
24}
25catch(JpGraphException $e) {
26        echo 'PDF417 Error: '.$e->GetMessage();
27}
28?>
Note: See TracBrowser for help on using the repository browser.