As the Print module's creation of a PDF can be quite slow (and use a lot of memory/CPU), is it possible to save a PDF into the public:// files area each time a node is saved?

Has anyone done this? Presumably you could call a save-PDF function on hook_node_presave but I'm not sure what the next step is. Call a print-PDF function with a file path? Where is that print-PDF function and how would you call it?

1 Answer 1


The function used from that module to output PDF is print_pdf_generate_html(), which gets a filename as last parameter.

To understand what to pass as first argument, see print_pdf_generate_path(), which is the function calling print_pdf_generate_html(). In particular, see the following code.

$print = print_controller($path, $cid, PRINT_PDF_FORMAT);
if ($print === FALSE) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.