PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Linear Transformations

Rotations

PDF page can be rotated before applying any draw operation. It can be done by Zend_Pdf_Page::rotate() method:

<?php
/**
 * Rotate the page.
 *
 * @param float $x  - the X co-ordinate of rotation point
 * @param float $y  - the Y co-ordinate of rotation point
 * @param float $angle - rotation angle
 * @return Zend_Pdf_Page
 */
public function rotate($x$y$angle);

Starting from ZF 1.8, scaling

Scaling transformation is provided by Zend_Pdf_Page::scale() method:

<?php
/**
 * Scale coordination system.
 *
 * @param float $xScale - X dimention scale factor
 * @param float $yScale - Y dimention scale factor
 * @return Zend_Pdf_Page
 */
public function scale($xScale$yScale);

Starting from ZF 1.8, translating

Coordinate system shifting is performed by Zend_Pdf_Page::translate() method:

<?php
/**
 * Translate coordination system.
 *
 * @param float $xShift - X coordinate shift
 * @param float $yShift - Y coordinate shift
 * @return Zend_Pdf_Page
 */
public function translate($xShift$yShift);

Starting from ZF 1.8, skewing

Page skewing can be done using Zend_Pdf_Page::skew() method:

<?php
/**
 * Translate coordination system.
 *
 * @param float $x  - the X co-ordinate of axis skew point
 * @param float $y  - the Y co-ordinate of axis skew point
 * @param float $xAngle - X axis skew angle
 * @param float $yAngle - Y axis skew angle
 * @return Zend_Pdf_Page
 */
public function skew($x$y$xAngle$yAngle);

Zend Framework