如何在PHP中创建和合并JPG图像上的2D透明条形码?

时间:2014-06-02 22:57:48

标签: php barcode

您能否看到下面的代码,让我知道如何在$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);

0 个答案:

没有答案