Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Text.php
Go to the documentation of this file.
1 <?php
24 #require_once 'Zend/Pdf/Element.php';
25 #require_once 'Zend/Pdf/Element/Array.php';
26 #require_once 'Zend/Pdf/Element/Dictionary.php';
27 #require_once 'Zend/Pdf/Element/Name.php';
28 #require_once 'Zend/Pdf/Element/Numeric.php';
29 #require_once 'Zend/Pdf/Element/String.php';
30 
31 
33 #require_once 'Zend/Pdf/Annotation.php';
34 
44 {
50  public function __construct(Zend_Pdf_Element $annotationDictionary)
51  {
52  if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
53  #require_once 'Zend/Pdf/Exception.php';
54  throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
55  }
56 
57  if ($annotationDictionary->Subtype === null ||
58  $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
59  $annotationDictionary->Subtype->value != 'Text') {
60  #require_once 'Zend/Pdf/Exception.php';
61  throw new Zend_Pdf_Exception('Subtype => Text entry is requires');
62  }
63 
64  parent::__construct($annotationDictionary);
65  }
66 
77  public static function create($x1, $y1, $x2, $y2, $text)
78  {
79  $annotationDictionary = new Zend_Pdf_Element_Dictionary();
80 
81  $annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
82  $annotationDictionary->Subtype = new Zend_Pdf_Element_Name('Text');
83 
84  $rectangle = new Zend_Pdf_Element_Array();
85  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
86  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
87  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
88  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
89  $annotationDictionary->Rect = $rectangle;
90 
91  $annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
92 
93  return new Zend_Pdf_Annotation_Text($annotationDictionary);
94  }
95 }
static create($x1, $y1, $x2, $y2, $text)
Definition: Text.php:77
const TYPE_NAME
Definition: Element.php:35
__construct(Zend_Pdf_Element $annotationDictionary)
Definition: Text.php:50
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43
const TYPE_DICTIONARY
Definition: Element.php:37