Barryvdh\DomPDF\PDF::stream PHP Method

stream() public method

Return a response with the PDF to show in the browser
public stream ( string $filename = 'document.pdf' ) : Illuminate\Http\Response
$filename string
return Illuminate\Http\Response
    public function stream($filename = 'document.pdf')
    {
        $output = $this->output();
        return new Response($output, 200, array('Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; filename="' . $filename . '"'));
    }

Usage Example

 /**
  * Return a response with the PDF to show in the browser
  *
  * @param string $filename
  * @return \Illuminate\Http\Response 
  * @static 
  */
 public static function stream($filename = 'document.pdf')
 {
     return \Barryvdh\DomPDF\PDF::stream($filename);
 }