public function preview() {
    if(!empty($this->pdf->getError())) {
      throw new Exception('Could not create PDF: ' . $this->pdf->getError());
    } else {
      $this->pdf->send();
    }
    
    die();
  }