I'm having problems to fill pdf template when using Zend_Pdf.
The problem is that i have to fill a existing pdf and i don't know how to say to Zend that this template is horizontal and not vertical.
If i make a new page with:
Zend_Pdf_Page::SIZE_A4_LANDSCAPE
everything ok, but the problem is that i have to use the template like:
$certificado = Zend_Pdf::load( dirname(__FILE__) . '/../../../docs/x.pdf');
$page = $certificado->pages[0];
How can i set the page to A4-Landscape?
After searching into Zend_Pdf_Page class, i figured out how to fix my problem:
Load the template i need to use(that is in landscape format)
And now rotate the document:
I tried different posibilities to insert the rotation angle, but deg2rad was the best solution.
After that the X and Y coords change, so only have to find out where you are drawing.