php-general | 2001072
Date: 07/24/01
- Next message: Rasmus Lerdorf: "Re: [PHP] PHP Execution Functions"
- Previous message: Bob Clingan: "[PHP] WSIWYG Editor using PHP?"
- In reply to: Michael Geier, CDM Systems Admin: "[PHP] need advice on project..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Does any one have any good code for creating PDF's on the fly with graphic
> images?
Putting an image in a PDF is trivial:
<?
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_begin_page($pdf, 612, 792); // US-Letter size
$x = 5; $y = 792-72;
$scale = 0.5;
$im = pdf_open_jpeg($pdf, "logo.jpg");
pdf_place_image($pdf, $im, $x, $y, $scale);
pdf_close_image ($pdf,$im);
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=fax.pdf');
header('Content-length: ' . strlen($data));
echo $data;
?>
-Rasmus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Rasmus Lerdorf: "Re: [PHP] PHP Execution Functions"
- Previous message: Bob Clingan: "[PHP] WSIWYG Editor using PHP?"
- In reply to: Michael Geier, CDM Systems Admin: "[PHP] need advice on project..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

