You are here

public function WkhtmltopdfGenerator::save 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::save()

Generate and save the PDF at a specific location.

Parameters

string $location: The location (both absolute/relative) path to save the generated PDF to.

Overrides PdfGeneratorInterface::save

File

src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php, line 140
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 save($location) {
  $this
    ->preGenerate();
  $this->generator
    ->saveAs($location);
}