Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mage-os-ci committed Sep 12, 2023
2 parents 925ddfc + 4426cdf commit 686c76f
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 77 deletions.
8 changes: 7 additions & 1 deletion library/Zend/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[\AllowDynamicProperties]
class Zend_Pdf
{
/**** Class Constants ****/
Expand Down Expand Up @@ -207,6 +206,13 @@ class Zend_Pdf
*/
protected $_parser;

/**
* PDF version specified in the file header
*
* @var string
*/
protected $_pdfHeaderVersion;

/**
* List of inheritable attributesfor pages tree
*
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Pdf/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,6 @@ public function hasChildren()
#[\ReturnTypeWillChange]
public function count()
{
return count($this->childOutlines);
return count($this->next);
}
}
2 changes: 1 addition & 1 deletion library/Zend/Pdf/Canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct($width, $height)
*/
protected function _addProcSet($procSetName)
{
$this->_procset[$procSetName] = 1;
$this->_procSet[$procSetName] = 1;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions library/Zend/Pdf/Canvas/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ abstract class Zend_Pdf_Canvas_Abstract implements Zend_Pdf_Canvas_Interface
*/
protected $_style = null;

/**
* Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).
*
* @var Zend_Pdf_Element_Reference|Zend_Pdf_Element_Object
*/
protected $_dictionary;


/**
* Counter for the "Save" operations
Expand Down
5 changes: 1 addition & 4 deletions library/Zend/Pdf/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,7 @@ public function cleanUp()
*
* @return mixed
*/
public function toPhp()
{
return $this->value;
}
abstract public function toPhp();

/**
* Convert PHP value into PDF element.
Expand Down
11 changes: 11 additions & 0 deletions library/Zend/Pdf/Element/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@ public function toString($factory = null)
{
return $this->value ? 'true' : 'false';
}


/**
* Convert PDF element to PHP type.
*
* @return boolean
*/
public function toPhp()
{
return $this->value;
}
}
11 changes: 11 additions & 0 deletions library/Zend/Pdf/Element/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,15 @@ public function toString($factory = null)
{
return '/' . self::escape((string)$this->value);
}


/**
* Convert PDF element to PHP type.
*
* @return string
*/
public function toPhp()
{
return $this->value;
}
}
11 changes: 11 additions & 0 deletions library/Zend/Pdf/Element/Null.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,15 @@ public function toString($factory = null)
{
return 'null';
}


/**
* Convert PDF element to PHP type.
*
* @return mixed
*/
public function toPhp()
{
return $this->value;
}
}
11 changes: 11 additions & 0 deletions library/Zend/Pdf/Element/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,15 @@ public function toString($factory = null)
}
return sprintf("%.{$prec}F", $this->value);
}


/**
* Convert PDF element to PHP type.
*
* @return numeric
*/
public function toPhp()
{
return $this->value;
}
}
10 changes: 10 additions & 0 deletions library/Zend/Pdf/Element/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,14 @@ public function toString($factory = null)
{
return "stream\n" . $this->value->getRef() . "\nendstream";
}

/**
* Convert PDF element to PHP type.
*
* @return Zend_Memory_Container
*/
public function toPhp()
{
return $this->value;
}
}
11 changes: 11 additions & 0 deletions library/Zend/Pdf/Element/String.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ public function toString($factory = null)
}


/**
* Convert PDF element to PHP type.
*
* @return string
*/
public function toPhp()
{
return $this->value;
}


/**
* Escape string according to the PDF rules
*
Expand Down
43 changes: 43 additions & 0 deletions library/Zend/Pdf/Outline.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,49 @@ abstract class Zend_Pdf_Outline implements RecursiveIterator, Countable
*/
protected $_open = false;

/**
* Outline title.
*
* @var string
*/
protected $_title;

/**
* True if outline item is displayed in italic.
* Default value is false.
*
* @var boolean
*/
protected $_italic = false;

/**
* Color to be used for the outline entry’s text.
* It uses the DeviceRGB color space for color representation.
* Null means default value - black ([0.0 0.0 0.0] in RGB representation).
*
* @var Zend_Pdf_Color_Rgb
*/
protected $_color = null;

/**
* True if outline item is displayed in bold.
* Default value is false.
*
* @var boolean
*/
protected $_bold = false;

/**
* Target destination or action.
* String means named destination
*
* Null means no target.
*
* @var Zend_Pdf_Destination|Zend_Pdf_Action
*/
protected $_target = null;

/**
* Array of child outlines (array of Zend_Pdf_Outline objects)
*
Expand Down
44 changes: 0 additions & 44 deletions library/Zend/Pdf/Outline/Created.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,50 +43,6 @@
*/
class Zend_Pdf_Outline_Created extends Zend_Pdf_Outline
{
/**
* Outline title.
*
* @var string
*/
protected $_title;

/**
* Color to be used for the outline entry’s text.
* It uses the DeviceRGB color space for color representation.
* Null means default value - black ([0.0 0.0 0.0] in RGB representation).
*
* @var Zend_Pdf_Color_Rgb
*/
protected $_color = null;

/**
* True if outline item is displayed in italic.
* Default value is false.
*
* @var boolean
*/
protected $_italic = false;

/**
* True if outline item is displayed in bold.
* Default value is false.
*
* @var boolean
*/
protected $_bold = false;

/**
* Target destination or action.
* String means named destination
*
* Null means no target.
*
* @var Zend_Pdf_Destination|Zend_Pdf_Action
*/
protected $_target = null;


/**
* Get outline title.
*
Expand Down
7 changes: 0 additions & 7 deletions library/Zend/Pdf/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ class Zend_Pdf_Page extends Zend_Pdf_Canvas_Abstract



/**
* Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object).
*
* @var Zend_Pdf_Element_Reference|Zend_Pdf_Element_Object
*/
protected $_dictionary;

/**
* PDF objects factory.
*
Expand Down
3 changes: 1 addition & 2 deletions library/Zend/Pdf/Resource/Font/CidFont.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[\AllowDynamicProperties]
abstract class Zend_Pdf_Resource_Font_CidFont extends Zend_Pdf_Resource_Font
{
/**
Expand Down Expand Up @@ -99,7 +98,7 @@ public function __construct(Zend_Pdf_FileParser_Font_OpenType $fontParser)

$this->_isBold = $fontParser->isBold;
$this->_isItalic = $fontParser->isItalic;
$this->_isMonospaced = $fontParser->isMonospaced;
$this->_isMonospace = $fontParser->isMonospaced;

$this->_underlinePosition = $fontParser->underlinePosition;
$this->_underlineThickness = $fontParser->underlineThickness;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Pdf/Resource/Font/Simple/Parsed.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(Zend_Pdf_FileParser_Font_OpenType $fontParser)

$this->_isBold = $fontParser->isBold;
$this->_isItalic = $fontParser->isItalic;
$this->_isMonospaced = $fontParser->isMonospaced;
$this->_isMonospace = $fontParser->isMonospaced;

$this->_underlinePosition = $fontParser->underlinePosition;
$this->_underlineThickness = $fontParser->underlineThickness;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Pdf/Resource/Font/Simple/Standard/Courier.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct()

$this->_isBold = false;
$this->_isItalic = false;
$this->_isMonospaced = true;
$this->_isMonospace = true;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function __construct()

$this->_isBold = true;
$this->_isItalic = false;
$this->_isMonospaced = true;
$this->_isMonospace = true;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function __construct()

$this->_isBold = true;
$this->_isItalic = true;
$this->_isMonospaced = true;
$this->_isMonospace = true;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function __construct()

$this->_isBold = false;
$this->_isItalic = true;
$this->_isMonospaced = true;
$this->_isMonospace = true;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function __construct()

$this->_isBold = false;
$this->_isItalic = false;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function __construct()

$this->_isBold = true;
$this->_isItalic = false;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function __construct()

$this->_isBold = true;
$this->_isItalic = true;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function __construct()

$this->_isBold = false;
$this->_isItalic = true;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function __construct()

$this->_isBold = false;
$this->_isItalic = false;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function __construct()

$this->_isBold = true;
$this->_isItalic = false;
$this->_isMonospaced = false;
$this->_isMonospace = false;

$this->_underlinePosition = -100;
$this->_underlineThickness = 50;
Expand Down
Loading

0 comments on commit 686c76f

Please sign in to comment.