You are here

public function PdfDownload::execute in Entity Print 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/PdfDownload.php, line 108

Class

PdfDownload
Downloads the PDF for an entity.

Namespace

Drupal\entity_print\Plugin\Action

Code

public function execute($entity = NULL) {
  $this
    ->sendResponse(function () use ($entity) {
    $this->pdfBuilder
      ->getEntityRenderedAsPdf($entity, $this
      ->getPdfEngine(), TRUE);
  });
}