Exemplo n.º 1
0
 /**
  * Convenience wrapper for the data source object's moveToOffset() method.
  *
  * @param integer $offset Destination byte offset.
  * @throws \ZendPdf\Exception\ExceptionInterface
  */
 public function moveToOffset($offset)
 {
     $this->_dataSource->moveToOffset($offset);
 }
Exemplo n.º 2
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 \ZendPdf\Exception\ExceptionInterface
  */
 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) {
         throw new Exception\IOException('Error while setting new file position');
     }
     if (feof($this->_fileResource)) {
         throw new Exception\IOException('Moved beyond the end of the file');
     }
 }