Line | |
---|
1 | <?php |
---|
2 | require_once('jpgraph/datamatrix/datamatrix.inc.php'); |
---|
3 | |
---|
4 | $data = '123456'; |
---|
5 | |
---|
6 | // Create and set parameters for the encoder |
---|
7 | $encoder = DatamatrixFactory::Create(DMAT_44x44); |
---|
8 | $encoder->SetEncoding(ENCODING_BASE256); |
---|
9 | |
---|
10 | // Create the image backend (default) |
---|
11 | $backend = DatamatrixBackendFactory::Create($encoder); |
---|
12 | $backend->SetModuleWidth(3); |
---|
13 | |
---|
14 | try { |
---|
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.