Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

How to Create Printer-friendly Versions of Drupal Articles

Parent Feed: 
Creating Printer-friendly Versions of Drupal Articles

In this tutorial, we'll show you how to add a "Printer-friendly version" button to your Drupal articles. 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.

This is a themed tutorial because our sister post "Creating Printer-friendly Versions of Wordpress Posts" with Wordpress tutorial covers the same topic.

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

Let's get started.

  • 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:

  1. "Printer-friendly pages"
  2. "Printer-friendly pages UI"

01 new module installed

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:

02 enable two submodules

  • 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":

03 two submodules enabled

  • Now, visit one of your Drupal articles. You will see the "Printer-friendly version" link displayed at the bottom right-hand corner:

04 article gone printer friendly 

  • Click on the link to see the printer-friendly version of the Drupal article:

09 printer friendly page

  • 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:

05 configure

  • Now go to the tab "LINKS" >> group of settings "ADVANCED LINK OPTIONS" and play with the parameter "Link style":

06 parameter link style

If you wish, you can also display the "Printer-friendly version" links for your articles teases. All it takes just four easy steps.

  1. Go to "Printer-friendly pages" sub-module >> Configure >>  tab Links.
  2. Locate the "Display link in teaser" setting.
  3. Click on the checkbox next to it.
  4. Click on the "Save configuration" button:

08 display on teaser

  • You will now see your articles teasers display the "Printer-friendly version" links:

08 links for articles teasers

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.

Subscribe to OSTraining Video Club and right away start learning how to build superb Drupal websites. Follow our step by step bite-sized video tutorials from only $6 per month!
Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web