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

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 956 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/pdf417/jpgraph_pdf417.php');
3
4$data1 = '12345';
5$data2 = 'Abcdef';
6$data3 = '6789';
7
8// Manually specify several encodation schema
9$data = array(
10    array(USE_NC,$data1),
11    array(USE_TC,$data2),
12    array(USE_NC,$data3));
13
14//$data = "12345Abcdef6789";
15
16// Setup some symbolic names for barcode specification
17
18$columns = 8;   // Use 8 data (payload) columns
19$modwidth = 2;  // Use 2 pixel module width
20$errlevel = 2;  // Use error level 2
21$showtext = true;  // Show human readable string
22
23try {
24        // Create a new encoder and backend to generate PNG images
25        $encoder = new PDF417Barcode($columns,$errlevel);
26        $backend = PDF417BackendFactory::Create(BACKEND_IMAGE,$encoder);
27
28        $backend->SetModuleWidth($modwidth);
29    $backend->NoText(!$showtext);
30    $backend->Stroke($data);
31}
32catch(JpGraphException $e) {
33        echo 'PDF417 Error: '.$e->GetMessage();
34}
35?>
Note: See TracBrowser for help on using the repository browser.