我有一个签名字符串,我想使用FPDF来显示图像。这是我的代码。
<?php
require('c:/xampp/htdocs/html2pdf.php');
$pdf=new PDF_HTML();
$pdf->AddPage();
$text = '<img src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAABkCAYAAABwx8J9AAANT0lEQVR4Xu2dMbAOPRSGo1ModLRKHaXu01FhxgwqOjpUKMy9t6KjwyhQ0WHGDCpKo1Lq0NEpqa453/y5k3/tbs7JZnez8Xwzt7m7Sc55TiZvcpLd3bW9vb1yzskfPwhAAAIQgAAEFkpg1/b29qZzbmOh9mM2BCAAAQhAAALOOQSdbgABCEAAAhCogACCXkEQcQECEIAABCCAoNMHIAABCEAAAhUQQNArCCIuQAACEIAABBB0+gAEIAABCECgAgIIegVBxAUIQAACEIAAgk4fgAAEIAABCFRAAEGvIIi4AAEIQAACEEDQ6QMQgAAEIACBCggg6BUEERcgAAEIQAACCDp9AAIQgAAEIFABAQS9giDiAgQgAAEIQABBpw9AAAIQgAAEKiCAoFcQRFyAAAQgAAEIIOj0AQhAAAIQgEAFBBD0CoKICxCAAAQgAAEEnT4AAQhAAAIQqIAAgl5BEHEBAhCAAAQggKDTByAAAQhAAAIVEEDQKwgiLkAAAhCAAAQQdPoABCAAAQhAoAICCHoFQcQFCEAAAhCAAIJOH4AABCAAAQhUQABBryCIuAABCEAAAhBA0OkDEIAABCAAgQoIIOgVBBEXIAABCEAAAgg6fQACEIAABCBQAQEEvYIg4gIEIAABCEAAQacPQAACEIAABCoggKBXEERcgAAEIAABCCDo9AEIQAACEIBABQQQ9AqCiAsQgAAEIAABBJ0+AAEIQAACEKiAAIJeQRBxAQIQgAAEIICg0wcgAAEIQAACFRBA0CsIIi5AAAIQgAAEEHT6AAQgAAEIQKACAgh6BUHEBQhAAAIQgACCTh+AAAQgAAEIVEAAQa8giLgAAQhAAAIQQNAr7wPfv393+/fvr9zL+tz7+fOn27t3b32O4REEIDAaAQR9NLTjVawd7D9//uwOHjzonj596s6ePTueQdSclcDm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MABCAAAQhAoDwCCHp5McEiCEAAAhCAgJkAgm5GRgEIQAACEIBAeQQQ9PJigkUQgAAEIAABMwEE3YyMAhCAAAQgAIHyCCDo5cUEiyAAAQhAAAJmAgi6GRkFIAABCEAAAuURQNDLiwkWQQACEIAABMwEEHQzMgpAAAIQgAAEyiOAoJcXEyyCAAQgAAEImAkg6GZkFIAABCAAAQiURwBBLy8mWAQBCEAAAhAwE0DQzcgoAAEIQAACECiPAIJeXkywCAIQgAAEIGAmgKCbkVEAAhCAAAQgUB4BBL28mGARBCAAAQhAwEwAQTcjowAEIAABCECgPAIIenkxwSIIQAACEICAmQCCbkZGAQhAAAIQgEB5BP4AC7d57NOPCX0AAAAASUVORK5CYII=" alt="Signature"/>';
$pdf->WriteHTML($text);
$pdf->Output();
?>
我正在尝试使用html2pdf.php和fpdf version 1.8以pdf格式显示图像。 html2pdf.php和fpdf.php都与我的代码在同一目录中。但我一直收到这个错误。
Fatal error: Call to undefined method PDF_HTML::FPDF() in C:\xampp\htdocs\html2pdf.php on line 52
答案 0 :(得分:0)
尝试改变
require('c:/xampp/htdocs/html2pdf.php');
到
require('html2pdf.php');