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_Element_Name Class Reference
Inheritance diagram for Zend_Pdf_Element_Name:
Zend_Pdf_Element

Public Member Functions

 __construct ($val)
 
 getType ()
 
 toString ($factory=null)
 
- Public Member Functions inherited from Zend_Pdf_Element
 getType ()
 
 toString ($factory=null)
 
 makeClone (Zend_Pdf_ElementFactory $factory, array &$processed, $mode)
 
 setParentObject (Zend_Pdf_Element_Object $parent)
 
 getParentObject ()
 
 touch ()
 
 cleanUp ()
 
 toPhp ()
 

Static Public Member Functions

static escape ($inStr)
 
static unescape ($inStr)
 
- Static Public Member Functions inherited from Zend_Pdf_Element
static phpToPdf ($input)
 

Data Fields

 $value
 
- Data Fields inherited from Zend_Pdf_Element
const TYPE_BOOL = 1
 
const TYPE_NUMERIC = 2
 
const TYPE_STRING = 3
 
const TYPE_NAME = 4
 
const TYPE_ARRAY = 5
 
const TYPE_DICTIONARY = 6
 
const TYPE_STREAM = 7
 
const TYPE_NULL = 11
 
const CLONE_MODE_SKIP_PAGES = 1
 
const CLONE_MODE_FORCE_CLONING = 2
 

Detailed Description

Definition at line 35 of file Name.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $val)

Object constructor

Parameters
string$val
Exceptions
Zend_Pdf_Exception

Definition at line 51 of file Name.php.

52  {
53  settype($val, 'string');
54  if (strpos($val,"\x00") !== false) {
55  #require_once 'Zend/Pdf/Exception.php';
56  throw new Zend_Pdf_Exception('Null character is not allowed in PDF Names');
57  }
58  $this->value = (string)$val;
59  }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9

Member Function Documentation

◆ escape()

static escape (   $inStr)
static

Escape string according to the PDF rules

Parameters
string$inStr
Returns
string

Definition at line 79 of file Name.php.

80  {
81  $outStr = '';
82 
83  for ($count = 0; $count < strlen($inStr); $count++) {
84  $nextCode = ord($inStr[$count]);
85 
86  switch ($inStr[$count]) {
87  case '(':
88  // fall through to next case
89  case ')':
90  // fall through to next case
91  case '<':
92  // fall through to next case
93  case '>':
94  // fall through to next case
95  case '[':
96  // fall through to next case
97  case ']':
98  // fall through to next case
99  case '{':
100  // fall through to next case
101  case '}':
102  // fall through to next case
103  case '/':
104  // fall through to next case
105  case '%':
106  // fall through to next case
107  case '\\':
108  // fall through to next case
109  case '#':
110  $outStr .= sprintf('#%02X', $nextCode);
111  break;
112 
113  default:
114  if ($nextCode >= 33 && $nextCode <= 126 ) {
115  // Visible ASCII symbol
116  $outStr .= $inStr[$count];
117  } else {
118  $outStr .= sprintf('#%02X', $nextCode);
119  }
120  }
121 
122  }
123 
124  return $outStr;
125  }
$count
Definition: recent.phtml:13

◆ getType()

getType ( )

Return type of the element.

Returns
integer

Definition at line 67 of file Name.php.

68  {
70  }
const TYPE_NAME
Definition: Element.php:35

◆ toString()

toString (   $factory = null)

Return object as string

Parameters
Zend_Pdf_Factory$factory
Returns
string

Definition at line 157 of file Name.php.

158  {
159  return '/' . self::escape((string)$this->value);
160  }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
static escape($inStr)
Definition: Name.php:79

◆ unescape()

static unescape (   $inStr)
static

Unescape string according to the PDF rules

Parameters
string$inStr
Returns
string

Definition at line 134 of file Name.php.

135  {
136  $outStr = '';
137 
138  for ($count = 0; $count < strlen($inStr); $count++) {
139  if ($inStr[$count] != '#' ) {
140  $outStr .= $inStr[$count];
141  } else {
142  // Escape sequence
143  $outStr .= chr(base_convert(substr($inStr, $count+1, 2), 16, 10 ));
144  $count +=2;
145  }
146  }
147  return $outStr;
148  }
$count
Definition: recent.phtml:13

Field Documentation

◆ $value

Definition at line 42 of file Name.php.


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