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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 498 bytes
Line 
1<?php
2require_once('jpgraph/datamatrix/datamatrix.inc.php');
3
4$data = '123456';
5
6// Create and set parameters for the encoder
7$encoder = DatamatrixFactory::Create();
8$encoder->SetEncoding(ENCODING_BASE256);
9
10// Create the image backend (default)
11$backend = DatamatrixBackendFactory::Create($encoder);
12$backend->SetModuleWidth(3);
13
14try {
15    $backend->Stroke($data);
16} catch (Exception $e) {
17    $errstr = $e->GetMessage();
18    echo "Datamatrix error message: $errstr\n";
19}
20
21?>
Note: See TracBrowser for help on using the repository browser.