2
I created a PDF generator with the TCPDF
, It’s working okay, I’m just having a little problem.
I want the logo-marca
to enter, whatever I choose in the form.
Follows the codes.
Code of the form sending the data (index.php
)
<table align="right" width="100%">
<tr>
<td size="50px">Logo
<div style="padding-top:5px;">
<input name="logo" type="radio"
value="http://www.example.com/logo1.jpg" /> LOGO 1
<input name="logo" type="radio"
value="http://www.example.com/logo2.jpg" /> LOGO 2
<input name="logo" type="radio"
value="http://www.example.com/logo3.jpg" /> LOGO 3
</div>
</td>
</tr>
</table>
Code php
of the file that generates the pdf
(invoice2.php
)
<?
require_once('tcpdf_include.php');
class MYPDF extends TCPDF {
public function Header() {
$image_file = 'http://www.example.com/logo.jpg';
//$pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '',
// '', false, 300, '', false, false, 0, $fitbox, false, false);
$this->Image($image_file,'',8,80,'', 'JPG', '', 'T', false, 300,
'L', false, false, 0, false, false, false);
}
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
}
}
I want you to take for example:
The person who selects the LOGO 1
, by generating the PDF
, the image selected appears at the top of the PDF
generated.
At the moment, the image that appears is the one in the code of invoice2.php
.
public function Header() {
$image_file = 'http://www.example.com/logo.jpg';
}
Could someone help me with this?
1º: Strict Standards: Declaration of MYPDF::Header() should be compatible with TCPDF::Header() in /invoice2.php on line 12 2º: Warning: Missing argument 1 for MYPDF::Header(), called in /home/evolucao/public_html/celg2/tcpdf.php on line 3537 and defined in /invoice2.php on line 13 3rd: TCPDF ERROR: [Image] Unable to get the size of the image:
– Andeilson Ferreira
you can choose to change the constructor method to remove the Strict standards. See the code I changed in the Pastebin http://pastebin.com/r16EPGMV
– Marabesi