Barryvdh\Snappy\PdfWrapper::stream PHP Method

stream() public method

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

Usage Example

Exemplo n.º 1
0
 /**
  * Return a response with the PDF to show in the browser
  *
  * @param string $filename
  * @return \Barryvdh\Snappy\StreamedResponse 
  * @static 
  */
 public static function stream($filename = 'document.pdf')
 {
     return \Barryvdh\Snappy\PdfWrapper::stream($filename);
 }