You are here

public function PrintBuilderInterface::savePrintable in Entity Print 8.2

Render any content entity as a printed document and save to disk.

Be careful when not specifying a uri as the default behaviour will use the default file scheme which is likely to be public and therefore putting a rendered version of this entity in a web accessible location. If you want to keep the files private, you must specify the uri yourself when calling this method.

Parameters

\Drupal\Core\Entity\EntityInterface[] $entities: The content entity to render.

\Drupal\entity_print\Plugin\PrintEngineInterface $print_engine: The plugin id of the Print engine to use.

string $scheme: The Drupal scheme.

string $filename: (optional) The filename or empty to have one generated.

bool $use_default_css: (optional) TRUE if you want the default CSS included, otherwise FALSE.

Return value

string FALSE or the URI to the file. E.g. public://my-file.pdf.

1 method overrides PrintBuilderInterface::savePrintable()
PrintBuilder::savePrintable in src/PrintBuilder.php
Render any content entity as a printed document and save to disk.

File

src/PrintBuilderInterface.php, line 68

Class

PrintBuilderInterface
Interface for the Print builder service.

Namespace

Drupal\entity_print

Code

public function savePrintable(array $entities, PrintEngineInterface $print_engine, $scheme = 'public', $filename = '', $use_default_css = TRUE);