Exemplo n.º 1
0
 /**
  * Seeks the file read position to the specified byte offset.
  *
  * Throws an exception if the file pointer cannot be moved or if it is
  * moved beyond EOF (end of file).
  *
  * @param integer $offset Destination byte offset.
  * @throws Zend_Pdf_Exception
  */
 public function moveToOffset($offset)
 {
     if ($this->_offset == $offset) {
         return;
         // Not moving; do nothing.
     }
     parent::moveToOffset($offset);
     $result = @fseek($this->_fileResource, $offset, SEEK_SET);
     if ($result !== 0) {
         //require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Error while setting new file position', Zend_Pdf_Exception::CANT_SET_FILE_POSITION);
     }
     if (feof($this->_fileResource)) {
         //require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Moved beyond the end of the file', Zend_Pdf_Exception::MOVE_BEYOND_END_OF_FILE);
     }
 }
 /**
  * Convenience wrapper for the data source object's moveToOffset() method.
  *
  * @param integer $offset Destination byte offset.
  * @throws Zend_Pdf_Exception
  */
 public function moveToOffset($offset)
 {
     $this->_dataSource->moveToOffset($offset);
 }