Hi,
I'd like to convert a jpg image to a pdf document using the fpdf class.
(www.fpdf.org).
here is the code :
?php
require(fpdf.php);
$image=/pat/to/image.jpg;
$pdf = new FPDF();
$pdf-open();
$pdf-image($image,0,0);
$pdf-Output(/path/to/image.pdf,'F');
?
but I only get a blank a4 pdf
Correct me if I am wrong, but do fpdf allow jpg? I think you must convert to
PNG or GIF and then use that image.
-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 26, 2006 8:24 PM
To: PHP List
Subject: [PHP] jpg to pdf using fpdf
Hi,
I'd like
Peter Lauri a écrit :
Correct me if I am wrong, but do fpdf allow jpg? I think you must convert to
PNG or GIF and then use that image.
I correct you.
FPDF allow jpg.
take a look at ttp://www.fpdf.org/en/doc/image.htm
Supported formats are JPEG and PNG.
N F
--
PHP General Mailing List
So then it was the opposite of what I had in memory :)
-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 26, 2006 8:30 PM
To: 'PHP List'
Subject: Re: [PHP] jpg to pdf using fpdf
Peter Lauri a écrit :
Correct me if I am wrong, but do fpdf allow jpg
: Wednesday, July 26, 2006 8:24 PM
To: PHP List
Subject: [PHP] jpg to pdf using fpdf
Hi,
I'd like to convert a jpg image to a pdf document using the fpdf class.
(www.fpdf.org).
here is the code :
?php
require(fpdf.php);
$image=/pat/to/image.jpg;
$pdf = new FPDF();
$pdf-open();
$pdf-image
Peter Lauri a écrit :
This is code how it works for me:
$pdf = new FPDF('p','pt','a4');
$pdf-AddPage();
$pdf-Image(pdf/profilechart.png,145,$pdf-GetY());
$pdf-Output(pdf/temp/thepdf.pdf,'F');
Add the $pdf-AddPage(); and it might work :)
addpage did the trick.
thanks peter.
next question
figaro [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 26, 2006 8:44 PM
To: PHP List
Subject: Re: [PHP] jpg to pdf using fpdf
Peter Lauri a écrit :
This is code how it works for me:
$pdf = new FPDF('p','pt','a4');
$pdf-AddPage();
$pdf-Image(pdf/profilechart.png,145,$pdf-GetY());
$pdf-Output(pdf
At 3:23 PM +0200 7/26/06, nicolas figaro wrote:
Hi,
I'd like to convert a jpg image to a pdf document using the fpdf
class. (www.fpdf.org).
here is the code :
?php
require(fpdf.php);
$image=/pat/to/image.jpg;
$pdf = new FPDF();
$pdf-open();
$pdf-image($image,0,0);
8 matches
Mail list logo