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

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 452 bytes
Line 
1<?php
2require_once('jpgraph/datamatrix/datamatrix.inc.php');
3
4$data = 'The first datamatrix';
5$encoder = DatamatrixFactory::Create();
6$encoder->SetEncoding(ENCODING_ASCII);
7$backend = DatamatrixBackendFactory::Create($encoder);
8
9// We increase the module width to 3 pixels
10$backend->SetModuleWidth(3);
11
12try {
13    $backend->Stroke($data);
14} catch (Exception $e) {
15    echo 'Datamatrix error: '.$e->GetMessage()."\n";
16    exit(1);
17}
18?>
Note: See TracBrowser for help on using the repository browser.