diff --git a/src/PrintBuilder.php b/src/PrintBuilder.php index e4cd688..ecb0333 100644 --- a/src/PrintBuilder.php +++ b/src/PrintBuilder.php @@ -77,7 +77,7 @@ class PrintBuilder implements PrintBuilderInterface { /** * {@inheritdoc} */ - public function savePrintable(array $entities, PrintEngineInterface $print_engine, $uri = '', $force_download = FALSE, $use_default_css = TRUE) { + public function savePrintable(array $entities, PrintEngineInterface $print_engine, $uri = '', $use_default_css = TRUE) { $renderer = $this->prepareRenderer($entities, $print_engine, $use_default_css); // Allow other modules to alter the generated Print object. diff --git a/src/PrintBuilderInterface.php b/src/PrintBuilderInterface.php index ed54211..e6be8c1 100644 --- a/src/PrintBuilderInterface.php +++ b/src/PrintBuilderInterface.php @@ -45,20 +45,24 @@ interface PrintBuilderInterface { /** * 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. + * * @param \Drupal\Core\Entity\EntityInterface[] $entities * The content entity to render. * @param \Drupal\entity_print\Plugin\PrintEngineInterface $print_engine * The plugin id of the Print engine to use. * @param string $uri * The URI on disk the file should be saved to. - * @param bool $force_download - * (optional) TRUE to try and force the document download. * @param bool $use_default_css * (optional) TRUE if you want the default CSS included, otherwise FALSE. * * @return string - * FALSE or the Print content will be sent to the browser. + * FALSE or the URI to the file. E.g. public://my-file.pdf. */ - public function savePrintable(array $entities, PrintEngineInterface $print_engine, $uri, $force_download = FALSE, $use_default_css = TRUE); + public function savePrintable(array $entities, PrintEngineInterface $print_engine, $uri, $use_default_css = TRUE); }