Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions
Zend_Pdf_Annotation_FileAttachment Class Reference
Inheritance diagram for Zend_Pdf_Annotation_FileAttachment:
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, $fileSpecification)
 
- Static Public Member Functions inherited from Zend_Pdf_Annotation
static load (Zend_Pdf_Element $resource)
 

Additional Inherited Members

- Protected Attributes inherited from Zend_Pdf_Annotation
 $_annotationDictionary
 

Detailed Description

Definition at line 44 of file FileAttachment.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Zend_Pdf_Element  $annotationDictionary)

Annotation object constructor

Exceptions
Zend_Pdf_Exception

Definition at line 51 of file FileAttachment.php.

52  {
53  if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
54  #require_once 'Zend/Pdf/Exception.php';
55  throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
56  }
57 
58  if ($annotationDictionary->Subtype === null ||
59  $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
60  $annotationDictionary->Subtype->value != 'FileAttachment') {
61  #require_once 'Zend/Pdf/Exception.php';
62  throw new Zend_Pdf_Exception('Subtype => FileAttachment entry is requires');
63  }
64 
65  parent::__construct($annotationDictionary);
66  }
const TYPE_NAME
Definition: Element.php:35
const TYPE_DICTIONARY
Definition: Element.php:37

Member Function Documentation

◆ create()

static create (   $x1,
  $y1,
  $x2,
  $y2,
  $fileSpecification 
)
static

Create link annotation object

Parameters
float$x1
float$y1
float$x2
float$y2
string$fileSpecification
Returns
Zend_Pdf_Annotation_FileAttachment

Definition at line 78 of file FileAttachment.php.

79  {
80  $annotationDictionary = new Zend_Pdf_Element_Dictionary();
81 
82  $annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
83  $annotationDictionary->Subtype = new Zend_Pdf_Element_Name('FileAttachment');
84 
85  $rectangle = new Zend_Pdf_Element_Array();
86  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
87  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
88  $rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
89  $rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
90  $annotationDictionary->Rect = $rectangle;
91 
92  $fsDictionary = new Zend_Pdf_Element_Dictionary();
93  $fsDictionary->Type = new Zend_Pdf_Element_Name('Filespec');
94  $fsDictionary->F = new Zend_Pdf_Element_String($fileSpecification);
95 
96  $annotationDictionary->FS = $fsDictionary;
97 
98 
99  return new Zend_Pdf_Annotation_FileAttachment($annotationDictionary);
100  }

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