0

I installed "Print" and "Book Made Simple" modules on Drupal 7. The Print module also print the button "add this child" from "Book Made Simple". How can I not print "Add this child" on PDF?

below screenshot is showing where the button from "Book Made Simple" enter image description here

And here is the screenshot of a PDF contained "Add child page" and icon. enter image description here

2

In those cases I added a custom print--pdf.tpl.php file to my theme and defined my custom css in the head of the HTML page which is rendered in this file (you find the original template file named "print.tpl.php" in the print modules folder - just copy it to your theme and rename it).

Here you can define any element by CSS and give it a "display: none;" - so it will not be seen in your final PDF.

|improve this answer|||||
  • the css trick does not work on PDF generator. – CocoSkin Aug 29 '14 at 12:29
  • my bad, i placed the css on the media(mobile screen) only lol. Thanks, it works! – CocoSkin Aug 29 '14 at 14:19
  • at some point the "Add child page" keep coming back on PDF only(HTML is fine). Is there a way to remove that section instead of using css "display:none"? – CocoSkin Sep 2 '14 at 21:12
  • You can try to use a preprocess funtion for the book - I did not use this module so far and did not find any during a short search now. Maybe you will find a key/ value in the array which shows you that the book is rendered on a PDF path (or something else giving hint to the PDF creation). Additionally I think I remember that there is a view mode for nodes where you can what should be visible on print/ pdf pages. Maybe there is something like that for books as well? – Tobias Krause Sep 3 '14 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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