diff --git a/library/Zend/Pdf/Element.php b/library/Zend/Pdf/Element.php index 1a92dea..7ec0c91 100644 --- a/library/Zend/Pdf/Element.php +++ b/library/Zend/Pdf/Element.php @@ -45,13 +45,6 @@ abstract class Zend_Pdf_Element */ private $_parentObject = null; - /** - * Object value - * - * @var string - */ - public $value; - /** * Return type of the element. * See ZPdfPDFConst for possible values @@ -138,10 +131,7 @@ public function cleanUp() * * @return mixed */ - public function toPhp() - { - return $this->value; - } + abstract public function toPhp(); /** * Convert PHP value into PDF element. diff --git a/library/Zend/Pdf/Element/Boolean.php b/library/Zend/Pdf/Element/Boolean.php index b0edd67..4cf5e90 100644 --- a/library/Zend/Pdf/Element/Boolean.php +++ b/library/Zend/Pdf/Element/Boolean.php @@ -34,6 +34,14 @@ */ class Zend_Pdf_Element_Boolean extends Zend_Pdf_Element { + /** + * Object value + * + * @var boolean + */ + public $value; + + /** * Object constructor * @@ -72,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; + } } diff --git a/library/Zend/Pdf/Element/Name.php b/library/Zend/Pdf/Element/Name.php index de08f39..89c3daf 100644 --- a/library/Zend/Pdf/Element/Name.php +++ b/library/Zend/Pdf/Element/Name.php @@ -34,6 +34,14 @@ */ class Zend_Pdf_Element_Name extends Zend_Pdf_Element { + /** + * Object value + * + * @var string + */ + public $value; + + /** * Object constructor * @@ -150,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; + } } diff --git a/library/Zend/Pdf/Element/Null.php b/library/Zend/Pdf/Element/Null.php index d2b435a..9089e92 100644 --- a/library/Zend/Pdf/Element/Null.php +++ b/library/Zend/Pdf/Element/Null.php @@ -34,6 +34,14 @@ */ class Zend_Pdf_Element_Null extends Zend_Pdf_Element { + /** + * Object value. Always null. + * + * @var mixed + */ + public $value; + + /** * Object constructor */ @@ -64,4 +72,15 @@ public function toString($factory = null) { return 'null'; } + + + /** + * Convert PDF element to PHP type. + * + * @return mixed + */ + public function toPhp() + { + return $this->value; + } } diff --git a/library/Zend/Pdf/Element/Numeric.php b/library/Zend/Pdf/Element/Numeric.php index e039421..f8f0672 100644 --- a/library/Zend/Pdf/Element/Numeric.php +++ b/library/Zend/Pdf/Element/Numeric.php @@ -34,6 +34,14 @@ */ class Zend_Pdf_Element_Numeric extends Zend_Pdf_Element { + /** + * Object value + * + * @var numeric + */ + public $value; + + /** * Object constructor * @@ -84,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; + } } diff --git a/library/Zend/Pdf/Element/Stream.php b/library/Zend/Pdf/Element/Stream.php index 37b88dc..7148da1 100644 --- a/library/Zend/Pdf/Element/Stream.php +++ b/library/Zend/Pdf/Element/Stream.php @@ -37,6 +37,14 @@ */ class Zend_Pdf_Element_Stream extends Zend_Pdf_Element { + /** + * Object value + * + * @var Zend_Memory_Container + */ + public $value; + + /** * Object constructor * @@ -119,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; + } } diff --git a/library/Zend/Pdf/Element/String.php b/library/Zend/Pdf/Element/String.php index 5a1a88c..b9817b3 100644 --- a/library/Zend/Pdf/Element/String.php +++ b/library/Zend/Pdf/Element/String.php @@ -33,6 +33,13 @@ */ class Zend_Pdf_Element_String extends Zend_Pdf_Element { + /** + * Object value + * + * @var string + */ + public $value; + /** * Object constructor * @@ -67,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 *