In this tutorial, we’ll show you how to add a “Printer-friendly version” button to your Drupal articles. This produces a super-clean version of your article, with any of the site design.
The main reason you’d want to do this is a courtesy for your readers. Many still print things they read online and you don’t want them to waste that expensive printer ink just to print your logo and theme as well as the article.
Without this solution, you’d likely need to create a separate CSS file with styles specifically for the printed page. Fortunately, the “Printer, email and PDF versions” Drupal community module makes this much easier. It will automatically create a printer-friendly version of each article
- Download the “Printer, e-mail and PDF versions” Drupal module.
- Upload the downloaded file to the <your_drupal_root>sites/all/modules folder and rename it to “print” (without the double quotes).
- In your Drupal dashboard go to “Modules”. You will now see the “Printer, email and PDF versions” (see screenshot below).
- Scroll slightly down the page. As on the screenshot below, you will now see the “Printer, email and PDF versions” module installed, along with its ten sub-modules.
To create printer-friendly versions of your Drupal articles, you are interested in only two of those ten sub-modules:
- “Printer-friendly pages”
- “Printer-friendly pages UI”
As you can see, both of these sub-modules have been installed but they are still disabled.
- To enable them, click on the checkboxes of each of them and then – on the “Save configuration” button:
- You will now see the “Permissions” and “Configure” links displayed for both sub-modules, as well as the “Help” link for the “Printer-friendly pages”:
- Now, visit one of your Drupal articles. You will see the “Printer-friendly version” link displayed at the bottom right-hand corner:
- Click on the link to see the printer-friendly version of the Drupal article:
- To replace this text link to an icon image, in your Drupal dashboard go to Modules >> PRINTER, EMAIL AND PDF VERSIONS >> Printer-friendly pages UI >> Configure:
- Now go to the tab “LINKS” >> group of settings “ADVANCED LINK OPTIONS” and play with the parameter “Link style”:
If you wish, you can also display the “Printer-friendly version” links for your articles teasers. It takes just four easy steps.
- Go to “Printer-friendly pages” sub-module >> Configure >> tab Links.
- Locate the “Display link in teaser” setting.
- Click on the checkbox next to it.
- Click on the “Save configuration” button:
- You will now see your articles teasers display the “Printer-friendly version” links:
Excellent! You just learned how to enhance your Drupal articles with the “Printer-friendly version” link, generated by the “Printer, email and PDF versions” Drupal community module.
In one of our next blog posts, you will learn how to add to your Drupal articles the “Email to friend” and “PDF” links.