Re: jpg to pdf using fpdf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);

$pdf->Output("/path/to/image.pdf",'F');
?>

but I only get a blank a4 pdf document when I open image.pdf using acroread.

does anyone have an idea how I can convert a jpg to a pdf ? (without paying if possible
the price for a commercial library).

thanks

N F


This code from mine that works:

define('FPDF_FONTPATH','font/');
require('fpdf.php');
require('PDF_Rotate.php');
require('PDF_RotPos.php');
//--- open a new page ----
$pdf = new PDF_RotPos('L','in','Legal');
$pdf->Open();
$pdf->AddPage();
// Do Image
$pdf->Image('medal.jpg',0.3,0.3,2);

I use 'PDF_Rotate.php' and 'PDF_RotPos.php' because I rotate text in my PDF's

hth's

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux