/** * Dump object to a string to save within PDF file. * * $factory parameter defines operation context. * * @param \ZendPdf\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"; }
/** * Dump object to a string to save within PDF file * * $factory parameter defines operation context. * * @param \ZendPdf\ObjectFactory $factory * @return string */ public function dump(ObjectFactory $factory) { $shift = $factory->getEnumerationShift($this->_factory); if ($this->_streamDecoded) { $this->_initialDictionaryData = $this->_extractDictionaryData(); $this->_encodeStream(); } elseif ($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"; }
/** * Return reference to the object * * @param \ZendPdf\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'; }