Beispiel #1
0
 /**
  * Copy all imported objects to the resulting document.
  */
 protected function _putimportedobjects()
 {
     foreach ($this->parsers as $filename => $p) {
         $this->currentParser = $p;
         if (!isset($this->_objStack[$filename]) || !is_array($this->_objStack[$filename])) {
             continue;
         }
         while (($n = key($this->_objStack[$filename])) !== null) {
             try {
                 $nObj = $this->currentParser->resolveObject($this->_objStack[$filename][$n][1]);
             } catch (Exception $e) {
                 $nObj = array(pdf_parser::TYPE_OBJECT, pdf_parser::TYPE_NULL);
             }
             $this->_newobj($this->_objStack[$filename][$n][0]);
             if ($nObj[0] == pdf_parser::TYPE_STREAM) {
                 $this->_writeValue($nObj);
             } else {
                 $this->_writeValue($nObj[1]);
             }
             $this->_out("\nendobj");
             $this->_objStack[$filename][$n] = null;
             // free memory
             unset($this->_objStack[$filename][$n]);
             reset($this->_objStack[$filename]);
         }
     }
 }
Beispiel #2
0
 /**
  * Copy all imported objects to the resulting document.
  */
 protected function _putimportedobjects()
 {
     if (!is_array($this->parsers) || count($this->parsers) === 0) {
         return;
     }
     foreach ($this->parsers as $filename => $p) {
         $this->currentParser =& $p;
         if (!isset($this->_objStack[$filename]) || !is_array($this->_objStack[$filename])) {
             continue;
         }
         while (($n = key($this->_objStack[$filename])) !== null) {
             $nObj = $this->currentParser->resolveObject($this->_objStack[$filename][$n][1]);
             $this->_newobj($this->_objStack[$filename][$n][0]);
             if ($nObj[0] == pdf_parser::TYPE_STREAM) {
                 $this->_writeValue($nObj);
             } else {
                 $this->_writeValue($nObj[1]);
             }
             $this->_out("\nendobj");
             $this->_objStack[$filename][$n] = null;
             // free memory
             unset($this->_objStack[$filename][$n]);
             reset($this->_objStack[$filename]);
         }
     }
 }