Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FitBoundingBoxVertically.php
Go to the documentation of this file.
1 <?php
24 #require_once 'Zend/Pdf/Element/Array.php';
25 #require_once 'Zend/Pdf/Element/Name.php';
26 #require_once 'Zend/Pdf/Element/Numeric.php';
27 
28 
30 #require_once 'Zend/Pdf/Destination/Explicit.php';
31 
48 {
57  public static function create($page, $left)
58  {
59  $destinationArray = new Zend_Pdf_Element_Array();
60 
61  if ($page instanceof Zend_Pdf_Page) {
62  $destinationArray->items[] = $page->getPageDictionary();
63  } else if (is_integer($page)) {
64  $destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
65  } else {
66  #require_once 'Zend/Pdf/Exception.php';
67  throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
68  }
69 
70  $destinationArray->items[] = new Zend_Pdf_Element_Name('FitBV');
71  $destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
72 
73  return new Zend_Pdf_Destination_FitBoundingBoxVertically($destinationArray);
74  }
75 
81  public function getLeftEdge()
82  {
83  return $this->_destinationArray->items[2]->value;
84  }
85 
92  public function setLeftEdge($left)
93  {
94  $this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($left);
95  return $this;
96  }
97 
98 }
$page
Definition: pages.php:8