您能否看到下面的代码,让我知道如何在$png
图片上面写$jpg
?代码在浏览器中显示bacode图像,但它不保存它并将其与$jpg
图像合并。感谢您抽出宝贵时间和帮助。
$jpg= imagejpeg($image, '/applications/AMPPS/www/files/final-image-2.jpg');
require_once(dirname(__FILE__).'/tcpdf/tcpdf_barcodes_2d.php');
// set the barcode content and type
$barcodeobj = new TCPDF2DBarcode('Hello-this-is-a-test', 'DATAMATRIX');
// output the barcode as PNG image
$barcodeobj->getBarcodePNG(6, 6, array(0,0,0));
// the code stops to work from here
$png= imagepng($barcodeobj, '/applications/AMPPS/www/certificates/barcode.jpg');
imagecopymerge($png, $jpg, 0, 0, 0, 0, 50, 50, 100);
imagedestroy($image);
imagedestroy($png);