User Contributed Notes 3 notes

Thanks for your help, this is a clean working example ...<?php $pdf = pdf_new();pdf_open_file($pdf);pdf_set_info($pdf,"Creator","images.php");pdf_set_info($pdf,"Title","Horizontal and Vertical Example");// Width of 612, and length of 792 make US Letter Size // Dimensions are reversed for Landscape Modepdf_begin_page($pdf,792,612);

When you rotate, remember that you are rotating the coordinate system. So if you are rotating 90 degrees with the origin at (0,0) (bottom-left corner on PDFs) in the clockwise direction, then the pivot appears to be on the top-left of the PDF. For instance, if you put a sheet of paper on the table in vertical position, then rotate it clockwise 90 degrees by pivoting from the bottom-left corner, the pivot (or origin) will now be in the top-left corner of the horizontal paper. As you can see, you now have room show text in the +x, -y directions, not +x, +y.

Many of the functions used in the post below are deprecated. Here is the modern Object Oriented version that is almost the same line by line and uses the PDFlib() class:

<?php $pdf = new PDFlib();$pdf->begin_document("","");$pdf->set_info("Creator","images.php");$pdf->set_info("Title","Horizontal and Vertical Example");// Width of 612, and length of 792 make US Letter Size // Dimensions are reversed for Landscape Mode$pdf->begin_page_ext(792,612,'');