Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Protected Attributes
Zend_Pdf_Annotation Class Reference
Inheritance diagram for Zend_Pdf_Annotation:
Zend_Pdf_Annotation_FileAttachment Zend_Pdf_Annotation_Link Zend_Pdf_Annotation_Markup Zend_Pdf_Annotation_Text

Public Member Functions

 getResource ()
 
 setBottom ($bottom)
 
 getBottom ()
 
 setTop ($top)
 
 getTop ()
 
 setRight ($right)
 
 getRight ()
 
 setLeft ($left)
 
 getLeft ()
 
 getText ()
 
 setText ($text)
 
 __construct (Zend_Pdf_Element $annotationDictionary)
 

Static Public Member Functions

static load (Zend_Pdf_Element $resource)
 

Protected Attributes

 $_annotationDictionary
 

Detailed Description

Definition at line 38 of file Annotation.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Zend_Pdf_Element  $annotationDictionary)

Annotation object constructor

Exceptions
Zend_Pdf_Exception

Definition at line 189 of file Annotation.php.

190  {
191  if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
192  #require_once 'Zend/Pdf/Exception.php';
193  throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
194  }
195 
196  $this->_annotationDictionary = $annotationDictionary;
197 
198  if ($this->_annotationDictionary->Type !== null &&
199  $this->_annotationDictionary->Type->value != 'Annot') {
200  #require_once 'Zend/Pdf/Exception.php';
201  throw new Zend_Pdf_Exception('Wrong resource type. \'Annot\' expected.');
202  }
203 
204  if ($this->_annotationDictionary->Rect === null) {
205  #require_once 'Zend/Pdf/Exception.php';
206  throw new Zend_Pdf_Exception('\'Rect\' dictionary entry is required.');
207  }
208 
209  if (count($this->_annotationDictionary->Rect->items) != 4 ||
210  $this->_annotationDictionary->Rect->items[0]->getType() != Zend_Pdf_Element::TYPE_NUMERIC ||
211  $this->_annotationDictionary->Rect->items[1]->getType() != Zend_Pdf_Element::TYPE_NUMERIC ||
212  $this->_annotationDictionary->Rect->items[2]->getType() != Zend_Pdf_Element::TYPE_NUMERIC ||
213  $this->_annotationDictionary->Rect->items[3]->getType() != Zend_Pdf_Element::TYPE_NUMERIC ) {
214  #require_once 'Zend/Pdf/Exception.php';
215  throw new Zend_Pdf_Exception('\'Rect\' dictionary entry must be an array of four numeric elements.');
216  }
217  }
const TYPE_NUMERIC
Definition: Element.php:33
const TYPE_DICTIONARY
Definition: Element.php:37

Member Function Documentation

◆ getBottom()

getBottom ( )

Get bottom edge of the annotation rectangle.

Returns
float

Definition at line 77 of file Annotation.php.

77  {
78  return $this->_annotationDictionary->Rect->items[1]->value;
79  }

◆ getLeft()

getLeft ( )

Get left edge of the annotation rectangle.

Returns
float

Definition at line 143 of file Annotation.php.

143  {
144  return $this->_annotationDictionary->Rect->items[0]->value;
145  }

◆ getResource()

getResource ( )

Get annotation dictionary

Definition at line 53 of file Annotation.php.

54  {
56  }

◆ getRight()

getRight ( )

Get right edge of the annotation rectangle.

Returns
float

Definition at line 121 of file Annotation.php.

121  {
122  return $this->_annotationDictionary->Rect->items[2]->value;
123  }

◆ getText()

getText ( )

Return text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form.

Returns
string

Definition at line 154 of file Annotation.php.

154  {
155  if ($this->_annotationDictionary->Contents === null) {
156  return '';
157  }
158 
159  return $this->_annotationDictionary->Contents->value;
160  }

◆ getTop()

getTop ( )

Get top edge of the annotation rectangle.

Returns
float

Definition at line 99 of file Annotation.php.

99  {
100  return $this->_annotationDictionary->Rect->items[3]->value;
101  }

◆ load()

static load ( Zend_Pdf_Element  $resource)
static

Load Annotation object from a specified resource

Todo:
implementation

Definition at line 226 of file Annotation.php.

227  {
229  }

◆ setBottom()

setBottom (   $bottom)

Set bottom edge of the annotation rectangle.

Parameters
float$bottom
Returns
Zend_Pdf_Annotation

Definition at line 65 of file Annotation.php.

65  {
66  $this->_annotationDictionary->Rect->items[1]->touch();
67  $this->_annotationDictionary->Rect->items[1]->value = $bottom;
68 
69  return $this;
70  }

◆ setLeft()

setLeft (   $left)

Set left edge of the annotation rectangle.

Parameters
float$left
Returns
Zend_Pdf_Annotation

Definition at line 131 of file Annotation.php.

131  {
132  $this->_annotationDictionary->Rect->items[0]->touch();
133  $this->_annotationDictionary->Rect->items[0]->value = $left;
134 
135  return $this;
136  }

◆ setRight()

setRight (   $right)

Set right edge of the annotation rectangle.

Parameters
float$right
Returns
Zend_Pdf_Annotation

Definition at line 109 of file Annotation.php.

109  {
110  $this->_annotationDictionary->Rect->items[2]->touch();
111  $this->_annotationDictionary->Rect->items[2]->value = $right;
112 
113  return $this;
114  }

◆ setText()

setText (   $text)

Set text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation’s contents in human-readable form.

Parameters
string$text
Returns
Zend_Pdf_Annotation

Definition at line 170 of file Annotation.php.

170  {
171  #require_once 'Zend/Pdf/Element/String.php';
172 
173  if ($this->_annotationDictionary->Contents === null) {
174  $this->_annotationDictionary->touch();
175  $this->_annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
176  } else {
177  $this->_annotationDictionary->Contents->touch();
178  $this->_annotationDictionary->Contents->value = new Zend_Pdf_Element_String($text);
179  }
180 
181  return $this;
182  }
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43

◆ setTop()

setTop (   $top)

Set top edge of the annotation rectangle.

Parameters
float$top
Returns
Zend_Pdf_Annotation

Definition at line 87 of file Annotation.php.

87  {
88  $this->_annotationDictionary->Rect->items[3]->touch();
89  $this->_annotationDictionary->Rect->items[3]->value = $top;
90 
91  return $this;
92  }

Field Documentation

◆ $_annotationDictionary

$_annotationDictionary
protected

Definition at line 45 of file Annotation.php.


The documentation for this class was generated from the following file: