参考:
https://github.com/tecnickcom/TCPDF
下载完成放入vendor 目录
参考例子:
https://tcpdf.org/examples/example_027/
以下代码直接运行生成条码:
function createCode()
{
/**
* Creates an example PDF TEST document using TCPDF
* @package com.tecnick.tcpdf
* @abstract TCPDF - Example: 1D Barcodes.
* @author Nicola Asuni
* @since 2008-03-04
*/
require_once ROOT_PATH . '/vendor/tecnickcom/tcpdf/examples/tcpdf_include.php';
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 027');
$pdf->SetSubject('TCPDF Tutorial');
$pdf-