By playing around with this you'll get a better understanding of what pdf_save and pdf_restore do.
By encapsulating the changes we make to the coordinate system
(pdf_translate() and pdf_rotate()) between pdf_save() and pdf_restore
we give these changes only local scope.
*/
/*
SMALL RECTANGLE
*/pdf_save($pdf);//move the origin of the coordinate system to (100,100)pdf_translate($pdf,100,100);//Rotate the coordinate system by 45 degrees.pdf_rotate($pdf,45);//Draw a samll rectanglepdf_rect($pdf,0,0,20,20);pdf_stroke($pdf);//Restore the graphics state to the way it was
//before we started to translate and rotatepdf_restore($pdf);/*
LARGER RECTANGLE
*/pdf_save($pdf);//move the origin of the coordinate system to (10,20)pdf_translate($pdf,10,20);//Rotate the coordinate system by 15 degrees.pdf_rotate($pdf,15);//Draw a larger rectanglepdf_rect($pdf,0,0,40,40);pdf_stroke($pdf);//Restore the graphics state to the way it was
//before we started to translate and rotatepdf_restore($pdf);//close it uppdf_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