dbXapp
2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Toggle main menu visibility
Loading...
Searching...
No Matches
dbxPDF417.class.php
Go to the documentation of this file.
1
<?php
2
class
dbxPDF417
{
3
4
public
function
__construct
() {
5
$load=
dbx_os_path_file
(
dbx_get_base_dir
().
'vendor/autoload.php'
);
6
require_once $load;
// Pfad ggf. anpassen
7
}
8
20
public
function
get_pdf417
(
string
$data =
''
,
string
$type =
'svg'
,
float
$scale_w = 0.4,
float
$scale_h = 1.2,
string
$color =
'black'
): string {
21
$barcodeobj = new \TCPDF2DBarcode($data,
'PDF417'
);
22
23
$svg = $barcodeobj->getBarcodeSVGcode($scale_w, $scale_h, $color);
24
25
if
($type ===
'img'
) {
26
$width_mm = 70;
// z. B. 50mm Breite
27
$height_mm = 22;
// z. B. 20mm Höhe
28
$base64 = base64_encode($svg);
29
return
'<img src="data:image/svg+xml;base64,'
. $base64 .
'" style="width: '
. $width_mm .
'mm; height: '
. $height_mm .
'mm;" />'
;
30
}
31
32
// Default: raw SVG
33
return
$svg;
34
}
35
}
dbxPDF417
Definition
dbxPDF417.class.php:2
dbxPDF417\get_pdf417
get_pdf417(string $data='', string $type='svg', float $scale_w=0.4, float $scale_h=1.2, string $color='black')
Erzeugt einen PDF417-Barcode.
Definition
dbxPDF417.class.php:20
dbxPDF417\__construct
__construct()
Definition
dbxPDF417.class.php:4
dbx_os_path_file
dbx_os_path_file($path_file)
Definition
index.php:164
dbx_get_base_dir
dbx_get_base_dir($cut_Data=0)
Definition
index.php:157
dbx
include
dbxPDF417.class.php
Generated by
1.17.0