You are here

public function WkhtmltopdfGenerator::stream in PDF generator API 8

Same name and namespace in other branches
  1. 2.x src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\WkhtmltopdfGenerator::stream()

Stream the PDF to the browser.

Overrides PdfGeneratorInterface::stream

File

src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php, line 156
Contains \Drupal\pdf_api\Plugin\WkhtmltopdfGenerator.

Class

WkhtmltopdfGenerator
A PDF generator plugin for the WKHTMLTOPDF library.

Namespace

Drupal\pdf_api\Plugin\PdfGenerator

Code

public function stream($filelocation) {
  $this
    ->preGenerate();
  $this->generator
    ->saveAs($filelocation);
  $this->generator
    ->send($filelocation, false);
}