|
 |
pdf_save (PHP 3 >= 3.0.6, PHP 4, PECL) pdf_save -- Saves the current environment Descriptionbool pdf_save ( resource pdfdoc )
Save the current graphics state. Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.
pdf_save
bob at nijman dot de
02-Aug-2001 05:12
By playing around with this you'll get a better understanding of what pdf_save and pdf_restore do.
<?php
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "Author","Bob Nijman");
pdf_set_info($pdf, "Title","Sponsored by www.nijman.de");
pdf_set_info($pdf, "Creator", "See Author");
pdf_set_info($pdf, "Subject", "pdf_restore");
pdf_begin_page($pdf, 300, 300);
pdf_save($pdf);
pdf_translate($pdf, 100, 100);
pdf_rotate($pdf, 45);
pdf_rect($pdf, 0, 0, 20, 20);
pdf_stroke($pdf);
pdf_restore($pdf);
pdf_save($pdf);
pdf_translate($pdf, 10, 20);
pdf_rotate($pdf, 15);
pdf_rect($pdf, 0, 0, 40, 40);
pdf_stroke($pdf);
pdf_restore($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=nijman.pdf');
header('Content-length: ' . strlen($data));
echo $data;
?>
Thanx to:
http://www.dynamicwebpages.de/50.tutorials.php?dwp_tutorialID=11
| |