Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php tcpdf生成pdf417二维条码can';t设置宽度_Php_2d_Barcode_Tcpdf_Pdf417 - Fatal编程技术网

Php tcpdf生成pdf417二维条码can';t设置宽度

Php tcpdf生成pdf417二维条码can';t设置宽度,php,2d,barcode,tcpdf,pdf417,Php,2d,Barcode,Tcpdf,Pdf417,我尝试生成符合以下要求的条形码: Barcode Type: PDF 417 Error Correction Length: 5 Module Height/Length: 2

我尝试生成符合以下要求的条形码:

Barcode Type: PDF 417                                                    
Error Correction Length: 5                                                                 
Module Height/Length: 2                                                           
Scanning Method: Document Scanner
Data Compaction: Byte Compaction (BC)

Barcode Measurements Points Inches
Module Width: 0.958pt            0.0133in
Actual Width of Barcode: 540pt               7.5in
Actual Height of Barcode: 108pt               1.5in
我正在使用TCPDF,但无法获得正确的宽度或高度

下面是我的php代码,有人能帮我把宽度和高度正确吗

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false);

// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

// add a page
$pdf->AddPage();

$txt = 'I-90|06/30/15|1|||||||||||||||||This is a message|';

// set style for barcode
$style = array(
    'border' => 0,
    'vpadding' => 'auto',
    'hpadding' => 'auto',
    'fgcolor' => array(0,0,0),
    'bgcolor' => false, //array(255,255,255)
    'module_width' => 1, // width of a single module in points
    'module_height' => 1 // height of a single module in points
);

//write barcode
$pdf->write2DBarcode($txt, 'PDF417', 0, 10, 540, 108, $style, 'N');

//Close and output PDF document
$pdf->Output('example_002.pdf', 'I');

您将其设置为144宽720高。你的意图是什么?我尝试制作一个宽度为540磅、高度为108磅的条形码。我切换了值,但仍然不正确。的页脚,输入值后,将生成条形码。我试图使条形码的宽度和高度精确。