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_String_Binary Class Reference
Inheritance diagram for Zend_Pdf_Element_String_Binary:
Zend_Pdf_Element_String Zend_Pdf_Element

Public Member Functions

 toString ($factory=null)
 
- Public Member Functions inherited from Zend_Pdf_Element_String
 __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_String
static escape ($str)
 
static unescape ($str)
 
- Static Public Member Functions inherited from Zend_Pdf_Element
static phpToPdf ($input)
 

Data Fields

 $value
 
- Data Fields inherited from Zend_Pdf_Element_String
 $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 Binary.php.

Member Function Documentation

◆ escape()

static escape (   $inStr)
static

Escape string according to the PDF rules

Parameters
string$inStr
Returns
string

Definition at line 51 of file Binary.php.

52  {
53  return strtoupper(bin2hex($inStr));
54  }

◆ toString()

toString (   $factory = null)

Return object as string

Parameters
Zend_Pdf_Factory$factory
Returns
string

Definition at line 94 of file Binary.php.

95  {
96  return '<' . self::escape((string)$this->value) . '>';
97  }
$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

◆ unescape()

static unescape (   $inStr)
static

Unescape string according to the PDF rules

Parameters
string$inStr
Returns
string

Definition at line 63 of file Binary.php.

64  {
65  $chunks = array();
66  $offset = 0;
67  $length = 0;
68  while ($offset < strlen($inStr)) {
69  // Collect hexadecimal characters
70  $start = $offset;
71  $offset += strspn($inStr, "0123456789abcdefABCDEF", $offset);
72  $chunks[] = substr($inStr, $start, $offset - $start);
73  $length += strlen(end($chunks));
74 
75  // Skip non-hexadecimal characters
76  $offset += strcspn($inStr, "0123456789abcdefABCDEF", $offset);
77  }
78  if ($length % 2 != 0) {
79  // We have odd number of digits.
80  // Final digit is assumed to be '0'
81  $chunks[] = '0';
82  }
83 
84  return pack('H*' , implode($chunks));
85  }
$start
Definition: listing.phtml:18

Field Documentation

◆ $value

Definition at line 42 of file Binary.php.


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