How to display a JSON/base64 encoded image in FPDF?

后端 未结 2 802
无人及你
无人及你 2020-12-19 23:42

I\'m storing signatures (using signaturepad in my database Coldfusion/MySQL 5.0.88 and would like to output the signature I\'m taking onto a pdf which I\'m gene

2条回答
  •  遥遥无期
    2020-12-20 00:38

    The issue is here

    $pdf->imagepng($img);
                     ^-------------- This should be an image path (String)
    

    Solution

    $file = 'signature.png' ;
    imagepng($img, $file);  
                     ^----------- Save Image to File Instead 
    

    Then

    if ($imgProceed == "true") {
        $pdf->imagepng($file);
    } else {
        $pdf->Cell(50, 4, '', 0, 1);
    }
    

提交回复
热议问题