Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Data Fields
Zend_Pdf_Annotation_Markup Class Reference
Inheritance diagram for Zend_Pdf_Annotation_Markup:
Zend_Pdf_Annotation

Public Member Functions

 __construct (Zend_Pdf_Element $annotationDictionary)
 
- Public Member Functions inherited from Zend_Pdf_Annotation
 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 create ($x1, $y1, $x2, $y2, $text, $subType, $quadPoints)
 
- Static Public Member Functions inherited from Zend_Pdf_Annotation
static load (Zend_Pdf_Element $resource)
 

Data Fields

const SUBTYPE_HIGHLIGHT = 'Highlight'
 
const SUBTYPE_UNDERLINE = 'Underline'
 
const SUBTYPE_SQUIGGLY = 'Squiggly'
 
const SUBTYPE_STRIKEOUT = 'StrikeOut'
 

Additional Inherited Members

- Protected Attributes inherited from Zend_Pdf_Annotation
 $_annotationDictionary
 

Detailed Description

Definition at line 43 of file Markup.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Zend_Pdf_Element  $annotationDictionary)

Annotation object constructor

Exceptions
Zend_Pdf_Exception

Definition at line 58 of file Markup.php.

59  {
60  if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
61  #require_once 'Zend/Pdf/Exception.php';
62  throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
63  }
64 
65  if ($annotationDictionary->Subtype === null ||
66  $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
67  !in_array( $annotationDictionary->Subtype->value,
68  array(self::SUBTYPE_HIGHLIGHT,
69  self::SUBTYPE_UNDERLINE,
70  self::SUBTYPE_SQUIGGLY,
71  self::SUBTYPE_STRIKEOUT) )) {
72  #require_once 'Zend/Pdf/Exception.php';
73  throw new Zend_Pdf_Exception('Subtype => Markup entry is omitted or has wrong value.');
74  }
75 
76  parent::__construct($annotationDictionary);
77  }
const TYPE_NAME
Definition: Element.php:35
const TYPE_DICTIONARY
Definition: Element.php:37

Member Function Documentation

◆ create()

static create (   $x1,
  $y1,
  $x2,
  $y2,
  $text,
  $subType,
  $quadPoints 
)
static

Create markup annotation object

Text markup annotations appear as highlights, underlines, strikeouts or jagged ("squiggly") underlines in the text of a document. When opened, they display a pop-up window containing the text of the associated note.

$subType parameter may contain Zend_Pdf_Annotation_Markup::SUBTYPE_HIGHLIGHT Zend_Pdf_Annotation_Markup::SUBTYPE_UNDERLINE Zend_Pdf_Annotation_Markup::SUBTYPE_SQUIGGLY Zend_Pdf_Annotation_Markup::SUBTYPE_STRIKEOUT for for a highlight, underline, squiggly-underline, or strikeout annotation, respectively.

$quadPoints is an array of 8xN numbers specifying the coordinates of N quadrilaterals default user space. Each quadrilateral encompasses a word or group of contiguous words in the text underlying the annotation. The coordinates for each quadrilateral are given in the order x1 y1 x2 y2 x3 y3 x4 y4 specifying the quadrilateral’s four vertices in counterclockwise order starting from left bottom corner. The text is oriented with respect to the edge connecting points (x1, y1) and (x2, y2).

Parameters
float$x1
float$y1
float$x2
float$y2
string$text
string$subType
array$quadPoints[x1 y1 x2 y2 x3 y3 x4 y4]
Returns
Zend_Pdf_Annotation_Markup
Exceptions
Zend_Pdf_Exception

Definition at line 114 of file Markup.php.

115  {
116  $annotationDictionary = new Zend_Pdf_Element_Dictionary();
117 
118  $annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
119  $annotationDictionary->Subtype = new Zend_Pdf_Element_Name($subType);
120 
121  $rectangle = new Zend_Pdf_Element_Array();
122  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
123  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
124  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
125  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
126  $annotationDictionary->Rect = $rectangle;
127 
128  $annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
129 
130  if (!is_array($quadPoints) || count($quadPoints) == 0 || count($quadPoints) % 8 != 0) {
131  #require_once 'Zend/Pdf/Exception.php';
132  throw new Zend_Pdf_Exception('$quadPoints parameter must be an array of 8xN numbers');
133  }
134  $points = new Zend_Pdf_Element_Array();
135  foreach ($quadPoints as $quadPoint) {
136  $points->items[] = new Zend_Pdf_Element_Numeric($quadPoint);
137  }
138  $annotationDictionary->QuadPoints = $points;
139 
140  return new Zend_Pdf_Annotation_Markup($annotationDictionary);
141  }
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43

Field Documentation

◆ SUBTYPE_HIGHLIGHT

const SUBTYPE_HIGHLIGHT = 'Highlight'

Annotation subtypes

Definition at line 48 of file Markup.php.

◆ SUBTYPE_SQUIGGLY

const SUBTYPE_SQUIGGLY = 'Squiggly'

Definition at line 50 of file Markup.php.

◆ SUBTYPE_STRIKEOUT

const SUBTYPE_STRIKEOUT = 'StrikeOut'

Definition at line 51 of file Markup.php.

◆ SUBTYPE_UNDERLINE

const SUBTYPE_UNDERLINE = 'Underline'

Definition at line 49 of file Markup.php.


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