5

I was wondering if the Print module can be used to print an entire page, not just nodes. I need to add some blocks to the pdf as well, not just the node content.

Is there any way of doing this, or will I need to manually add the blocks to the node->content property?

LATER EDIT: The problem is that the print module takes the node ID as a parameter. This means I cannot print blocks on those pages.

2 Answers 2

0

Yes. You can show blocks by tweaking templates. See FAQs in the project documentation specifically the entry on blocks.

It says there: add the following to your print.tpl.php template:

  print render(block_get_blocks_by_region('content'));

Update The FAQ also has an entry on Views support. It's doable - have just tested with Drupal 7.20 and Print 7.x-1.2. You have to add the paths to the non-nodes you want in Configuration. There's also a useful point on Views support and hiding the print link on your print out when using Views in the comments on the FAQ page, so worth rooting around there. Don't forget to enable the block to show the print / email / PDF links.

5
  • thanks for that. Apparently it works for all regions except for the content one :)) I'll try creating a new template, maybe this will help Mar 18, 2013 at 9:09
  • but the problem is that the links (print/nid, printpdf/nid) requires a node ID parameter. this means I cannot print view pages :( Mar 18, 2013 at 9:20
  • Again - take a good look at the Documentation for the module and also work through the configuration pages. Just tested with Views and it works fine. Updated answer to explicitly mention Views.
    – Obliquely
    Mar 18, 2013 at 19:39
  • I will accept this answer but still doesn't solve my problem: adding blocks from the content region to a pdf. Mar 19, 2013 at 9:00
  • I know this is an old issue, but be sure to check your print.css. It could be hiding those blocks from you.
    – akalata
    Sep 22, 2014 at 20:56
1

There is a block version of print links Printer, email and PDF versions. goto admin/structure/block and enable it. next you should goto admin/config/user-interface/print and change Printer-friendly page link setting to Block.

1
  • it sill adds just the node content, no additional blocks are added to the pdf version :( Mar 18, 2013 at 8:46

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.