/**
  * Dump object to a string to save within PDF file.
  *
  * $factory parameter defines operation context.
  *
  * @param \Zend\Pdf\ObjectFactory $factory
  * @return string
  */
 public function dump(ObjectFactory $factory)
 {
     $shift = $factory->getEnumerationShift($this->_factory);
     return $this->_objNum + $shift . " " . $this->_genNum . " obj \n" . $this->_value->toString($factory) . "\n" . "endobj\n";
 }
 /**
  * Return reference to the object
  *
  * @param \Zend\Pdf\ObjectFactory $factory
  * @return string
  */
 public function toString(Pdf\ObjectFactory $factory = null)
 {
     if ($factory === null) {
         $shift = 0;
     } else {
         $shift = $factory->getEnumerationShift($this->_factory);
     }
     return $this->_objNum + $shift . ' ' . $this->_genNum . ' R';
 }
Beispiel #3
0
 /**
  * Dump object to a string to save within PDF file
  *
  * $factory parameter defines operation context.
  *
  * @param \Zend\Pdf\ObjectFactory $factory
  * @return string
  */
 public function dump(ObjectFactory $factory)
 {
     $shift = $factory->getEnumerationShift($this->_factory);
     if ($this->_streamDecoded) {
         $this->_initialDictionaryData = $this->_extractDictionaryData();
         $this->_encodeStream();
     } else {
         if ($this->_initialDictionaryData != null) {
             $newDictionary = $this->_extractDictionaryData();
             if ($this->_initialDictionaryData !== $newDictionary) {
                 $this->_decodeStream();
                 $this->_initialDictionaryData = $newDictionary;
                 $this->_encodeStream();
             }
         }
     }
     // Update stream length
     $this->dictionary->Length->value = $this->_value->length();
     return $this->_objNum + $shift . " " . $this->_genNum . " obj \n" . $this->dictionary->toString($factory) . "\n" . $this->_value->toString($factory) . "\n" . "endobj\n";
 }
Beispiel #4
0
 /**
  * Retrive object enumeration shift.
  *
  * @param \Zend\Pdf\ObjectFactory $factory
  * @return integer
  * @throws \Zend\Pdf\Exception
  */
 public function getEnumerationShift(ObjectFactory $factory)
 {
     return $this->_factory->getEnumerationShift($factory);
 }