Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Pdf_Outline_Created Class Reference
Inheritance diagram for Zend_Pdf_Outline_Created:
Zend_Pdf_Outline

Public Member Functions

 getTitle ()
 
 setTitle ($title)
 
 isItalic ()
 
 setIsItalic ($isItalic)
 
 isBold ()
 
 setIsBold ($isBold)
 
 getColor ()
 
 setColor (Zend_Pdf_Color_Rgb $color)
 
 getTarget ()
 
 setTarget ($target=null)
 
 __construct ($options=array())
 
 dumpOutline (Zend_Pdf_ElementFactory_Interface $factory, $updateNavigation, Zend_Pdf_Element $parent, Zend_Pdf_Element $prev=null, SplObjectStorage $processedOutlines=null)
 
- Public Member Functions inherited from Zend_Pdf_Outline
 getTitle ()
 
 setTitle ($title)
 
 isOpen ()
 
 setIsOpen ($isOpen)
 
 isItalic ()
 
 setIsItalic ($isItalic)
 
 isBold ()
 
 setIsBold ($isBold)
 
 getColor ()
 
 setColor (Zend_Pdf_Color_Rgb $color)
 
 getTarget ()
 
 setTarget ($target=null)
 
 getOptions ()
 
 setOptions (array $options)
 
 openOutlinesCount ()
 
 dumpOutline (Zend_Pdf_ElementFactory_Interface $factory, $updateNavigation, Zend_Pdf_Element $parent, Zend_Pdf_Element $prev=null, SplObjectStorage $processedOutlines=null)
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 getChildren ()
 
 hasChildren ()
 
 count ()
 

Protected Attributes

 $_title
 
 $_color = null
 
 $_italic = false
 
 $_bold = false
 
 $_target = null
 
- Protected Attributes inherited from Zend_Pdf_Outline
 $_open = false
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Pdf_Outline
static create ($param1, $param2=null)
 
- Data Fields inherited from Zend_Pdf_Outline
 $childOutlines = array()
 

Detailed Description

Definition at line 44 of file Created.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $options = array())

Object constructor

Parameters
array$options
Exceptions
Zend_Pdf_Exception

Definition at line 222 of file Created.php.

223  {
224  if (!isset($options['title'])) {
225  #require_once 'Zend/Pdf/Exception.php';
226  throw new Zend_Pdf_Exception('Title parameter is required.');
227  }
228 
229  $this->setOptions($options);
230  }
setOptions(array $options)
Definition: Outline.php:173

Member Function Documentation

◆ dumpOutline()

dumpOutline ( Zend_Pdf_ElementFactory_Interface  $factory,
  $updateNavigation,
Zend_Pdf_Element  $parent,
Zend_Pdf_Element  $prev = null,
SplObjectStorage  $processedOutlines = null 
)

Dump Outline and its child outlines into PDF structures

Returns dictionary indirect object or reference

Definition at line 246 of file Created.php.

251  {
252  if ($processedOutlines === null) {
253  $processedOutlines = new SplObjectStorage();
254  }
255  $processedOutlines->attach($this);
256 
257  $outlineDictionary = $factory->newObject(new Zend_Pdf_Element_Dictionary());
258 
259  $outlineDictionary->Title = new Zend_Pdf_Element_String($this->getTitle());
260 
261  $target = $this->getTarget();
262  if ($target === null) {
263  // Do nothing
264  } else if ($target instanceof Zend_Pdf_Destination) {
265  $outlineDictionary->Dest = $target->getResource();
266  } else if ($target instanceof Zend_Pdf_Action) {
267  $outlineDictionary->A = $target->getResource();
268  } else {
269  #require_once 'Zend/Pdf/Exception.php';
270  throw new Zend_Pdf_Exception('Outline target has to be Zend_Pdf_Destination, Zend_Pdf_Action object or null');
271  }
272 
273  $color = $this->getColor();
274  if ($color !== null) {
275  $components = $color->getComponents();
276  $colorComponentElements = array(new Zend_Pdf_Element_Numeric($components[0]),
277  new Zend_Pdf_Element_Numeric($components[1]),
278  new Zend_Pdf_Element_Numeric($components[2]));
279  $outlineDictionary->C = new Zend_Pdf_Element_Array($colorComponentElements);
280  }
281 
282  if ($this->isItalic() || $this->isBold()) {
283  $outlineDictionary->F = new Zend_Pdf_Element_Numeric(($this->isItalic()? 1 : 0) | // Bit 1 - Italic
284  ($this->isBold()? 2 : 0)); // Bit 2 - Bold
285  }
286 
287 
288  $outlineDictionary->Parent = $parent;
289  $outlineDictionary->Prev = $prev;
290 
291  $lastChild = null;
292  foreach ($this->childOutlines as $childOutline) {
293  if ($processedOutlines->contains($childOutline)) {
294  #require_once 'Zend/Pdf/Exception.php';
295  throw new Zend_Pdf_Exception('Outlines cyclyc reference is detected.');
296  }
297 
298  if ($lastChild === null) {
299  $lastChild = $childOutline->dumpOutline($factory, true, $outlineDictionary, null, $processedOutlines);
300  $outlineDictionary->First = $lastChild;
301  } else {
302  $childOutlineDictionary = $childOutline->dumpOutline($factory, true, $outlineDictionary, $lastChild, $processedOutlines);
303  $lastChild->Next = $childOutlineDictionary;
304  $lastChild = $childOutlineDictionary;
305  }
306  }
307  $outlineDictionary->Last = $lastChild;
308 
309  if (count($this->childOutlines) != 0) {
310  $outlineDictionary->Count = new Zend_Pdf_Element_Numeric(($this->isOpen()? 1 : -1)*count($this->childOutlines));
311  }
312 
313  return $outlineDictionary;
314  }
$target
Definition: skip.phtml:8

◆ getColor()

getColor ( )

Get outline text color.

Returns
Zend_Pdf_Color_Rgb

Definition at line 162 of file Created.php.

163  {
164  return $this->_color;
165  }

◆ getTarget()

getTarget ( )

Get outline target.

Returns
Zend_Pdf_Target

Definition at line 185 of file Created.php.

186  {
187  return $this->_target;
188  }

◆ getTitle()

getTitle ( )

Get outline title.

Returns
string

Definition at line 95 of file Created.php.

96  {
97  return $this->_title;
98  }

◆ isBold()

isBold ( )

Returns true if outline item is displayed in bold

Returns
boolean

Definition at line 139 of file Created.php.

140  {
141  return $this->_bold;
142  }

◆ isItalic()

isItalic ( )

Returns true if outline item is displayed in italic

Returns
boolean

Definition at line 117 of file Created.php.

118  {
119  return $this->_italic;
120  }

◆ setColor()

setColor ( Zend_Pdf_Color_Rgb  $color)

Set outline text color. (null means default color which is black)

Parameters
Zend_Pdf_Color_Rgb$color
Returns
Zend_Pdf_Outline

Definition at line 174 of file Created.php.

175  {
176  $this->_color = $color;
177  return $this;
178  }

◆ setIsBold()

setIsBold (   $isBold)

Sets 'isBold' outline flag

Parameters
boolean$isBold
Returns
Zend_Pdf_Outline

Definition at line 150 of file Created.php.

151  {
152  $this->_bold = $isBold;
153  return $this;
154  }

◆ setIsItalic()

setIsItalic (   $isItalic)

Sets 'isItalic' outline flag

Parameters
boolean$isItalic
Returns
Zend_Pdf_Outline

Definition at line 128 of file Created.php.

129  {
130  $this->_italic = $isItalic;
131  return $this;
132  }

◆ setTarget()

setTarget (   $target = null)

Set outline target. Null means no target

Parameters
Zend_Pdf_Target | string$target
Returns
Zend_Pdf_Outline
Exceptions
Zend_Pdf_Exception

Definition at line 198 of file Created.php.

199  {
200  if (is_string($target)) {
201  #require_once 'Zend/Pdf/Destination/Named.php';
203  }
204 
205  if ($target === null || $target instanceof Zend_Pdf_Target) {
206  $this->_target = $target;
207  } else {
208  #require_once 'Zend/Pdf/Exception.php';
209  throw new Zend_Pdf_Exception('Outline target has to be Zend_Pdf_Destination or Zend_Pdf_Action object or string');
210  }
211 
212  return $this;
213  }
$target
Definition: skip.phtml:8

◆ setTitle()

setTitle (   $title)

Set outline title

Parameters
string$title
Returns
Zend_Pdf_Outline

Definition at line 106 of file Created.php.

107  {
108  $this->_title = $title;
109  return $this;
110  }
$title
Definition: default.phtml:14

Field Documentation

◆ $_bold

$_bold = false
protected

Definition at line 77 of file Created.php.

◆ $_color

$_color = null
protected

Definition at line 61 of file Created.php.

◆ $_italic

$_italic = false
protected

Definition at line 69 of file Created.php.

◆ $_target

$_target = null
protected

Definition at line 87 of file Created.php.

◆ $_title

$_title
protected

Definition at line 51 of file Created.php.


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