Exemplo n.º 1
0
 /**
  * Create destination object
  *
  * @param Zend_Pdf_Page|integer $page  Page object or page number
  * @param float $left  Left edge of displayed page
  * @param float $top   Top edge of displayed page
  * @param float $zoom  Zoom factor
  * @return Zend_Pdf_Destination_Zoom
  * @throws Zend_Pdf_Exception
  */
 public static function create($page, $left = null, $top = null, $zoom = null)
 {
     $destinationArray = new Zend_Pdf_Element_Array();
     if ($page instanceof Zend_Pdf_Page) {
         $destinationArray->items[] = $page->getPageDictionary();
     } else {
         if (is_integer($page)) {
             $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
         } else {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
         }
     }
     $destinationArray->items[] = new Zend_Pdf_Element_Name('XYZ');
     if ($left === null) {
         $destinationArray->items[] = new Zend_Pdf_Element_Null();
     } else {
         $destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
     }
     if ($top === null) {
         $destinationArray->items[] = new Zend_Pdf_Element_Null();
     } else {
         $destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
     }
     if ($zoom === null) {
         $destinationArray->items[] = new Zend_Pdf_Element_Null();
     } else {
         $destinationArray->items[] = new Zend_Pdf_Element_Numeric($zoom);
     }
     return new Zend_Pdf_Destination_Zoom($destinationArray);
 }
Exemplo n.º 2
0
 /**
  * Create destination object
  *
  * @param Zend_Pdf_Page|integer $page  Page object or page number
  * @return Zend_Pdf_Destination_FitBoundingBox
  * @throws Zend_Pdf_Exception
  */
 public static function create($page)
 {
     $destinationArray = new Zend_Pdf_Element_Array();
     if ($page instanceof Zend_Pdf_Page) {
         $destinationArray->items[] = $page->getPageDictionary();
     } elseif (is_integer($page)) {
         $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
     } else {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
     }
     $destinationArray->items[] = new Zend_Pdf_Element_Name('FitB');
     return new Zend_Pdf_Destination_FitBoundingBox($destinationArray);
 }
Exemplo n.º 3
0
 /**
  * Create destination object
  *
  * @param Zend_Pdf_Page|integer $page  Page object or page number
  * @param float $top  Top edge of displayed page
  * @return Zend_Pdf_Destination_FitHorizontally
  * @throws Zend_Pdf_Exception
  */
 public static function create($page, $top)
 {
     $destinationArray = new Zend_Pdf_Element_Array();
     if ($page instanceof Zend_Pdf_Page) {
         $destinationArray->items[] = $page->getPageDictionary();
     } else {
         if (is_integer($page)) {
             $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
         } else {
             require_once LIB_DIR . '/Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
         }
     }
     $destinationArray->items[] = new Zend_Pdf_Element_Name('FitH');
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
     return new Zend_Pdf_Destination_FitHorizontally($destinationArray);
 }
Exemplo n.º 4
0
 /**
  * Create destination object
  *
  * @param Zend_Pdf_Page|integer $page  Page object or page number
  * @param float $left  Left edge of displayed page
  * @return Zend_Pdf_Destination_FitVertically
  * @throws Zend_Pdf_Exception
  */
 public static function create($page, $left)
 {
     $destinationArray = new Zend_Pdf_Element_Array();
     if ($page instanceof Zend_Pdf_Page) {
         $destinationArray->items[] = $page->getPageDictionary();
     } else {
         if (is_integer($page)) {
             $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
         } else {
             //$1 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or page number.');
         }
     }
     $destinationArray->items[] = new Zend_Pdf_Element_Name('FitV');
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
     return new Zend_Pdf_Destination_FitVertically($destinationArray);
 }
Exemplo n.º 5
0
 /**
  * Create destination object
  *
  * @param Zend_Pdf_Page|integer $page  Page object or page number
  * @param float $left    Left edge of displayed page
  * @param float $bottom  Bottom edge of displayed page
  * @param float $right   Right edge of displayed page
  * @param float $top     Top edge of displayed page
  * @return Zend_Pdf_Destination_FitRectangle
  * @throws Zend_Pdf_Exception
  */
 public static function create($page, $left, $bottom, $right, $top)
 {
     $destinationArray = new Zend_Pdf_Element_Array();
     if ($page instanceof Zend_Pdf_Page) {
         $destinationArray->items[] = $page->getPageDictionary();
     } elseif (is_integer($page)) {
         $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
     } else {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
     }
     $destinationArray->items[] = new Zend_Pdf_Element_Name('FitR');
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($bottom);
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($right);
     $destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
     return new Zend_Pdf_Destination_FitRectangle($destinationArray);
 }