Active
Project:
Entity Print
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2019 at 19:32 UTC
Updated:
10 Jan 2023 at 00:37 UTC
Jump to comment: Most recent
The module is working as expected with no issues as far as I know, but currently when i click on the https://example.com/entityprint/pdf/node/15, a pdf file of the /node/15 is directly downloaded and saved locally/offline on my computer/mobile phone !
I would like to know if there is a method to programmatically or via UI, save the pdf file online on my server for example under: /web/sites/default/files/pdf directory.
any help please ?
Thank you,
Comments
Comment #2
c.e.a commentedComment #3
c.e.a commentedComment #4
trentwyman commentedI'm trying to figure this out as well. I've got a use case where members of groups can download PDF documents, but after leaving the group the PDF file is no longer available to the user for future reference. I need to find a way to also allow users to SAVE the PDF to their user files folder in Drupal (on the server), in addition to the standard print-on-demand download functionality (which is working as expected).
Comment #5
canardesign commentedSubscribing. Same need here, would be interested in saving multiple PDF files programmatically.
Comment #6
z3cka commentedYou can use the
entity_print.print_builderservice to save the rendered pdf. My use case was a little different, as I just needed to save the file to the temp directory and attach it to an outgoing email, but it is similar:You would need to swap out
$orderfor your desired entity that you would like saved as a printable pdf and change the file scheme/filename to match your needs. See the PrintBuilderInterface->savePrintable() source for more details on the above code. For more context see comment #45 and discussion on #2831952: Create an entity_print renderer for orders (to allow order PDF output).Good luck!