Skip to content
README.txt 3.95 KiB
Newer Older
João Ventura's avatar
João Ventura committed
DESCRIPTION
-----------
João Ventura's avatar
João Ventura committed
This module allows you to generate the following printer-friendly versions
of any node:

    * Web page printer-friendly version (at www.example.com/print/nid)
    * PDF version (at www.example.com/printpdf/nid)
    * Send by-email (at www.example.com/printmail/nid)
João Ventura's avatar
João Ventura committed

where nid is the node id of content to render.
João Ventura's avatar
João Ventura committed
A link is inserted in the each node (configurable in the content type
settings), that opens a version of the page with no sidebars, search boxes,
navigation pages, etc.
João Ventura's avatar
João Ventura committed
CONFIGURATION
-------------
João Ventura's avatar
João Ventura committed
- There are several settings that can be configured in the following places:
João Ventura's avatar
João Ventura committed
  Administer > Site building > Modules (admin/build/modules)
João Ventura's avatar
João Ventura committed
    Enable or disable the module. (default: disabled)
João Ventura's avatar
João Ventura committed
  Administer > User management > Access control (admin/user/access)
João Ventura's avatar
João Ventura committed
    Under print module:
    access print: Enable access to the PF page and display of the PF link in
    other pages. (default: disabled)
    administer print: Enable access to the module settings page. (default:
    disabled)
João Ventura's avatar
João Ventura committed
  Administer > Content management > Content types (admin/content/types)
João Ventura's avatar
João Ventura committed
    For each content type it is possible to enable or disable the PF link
    via the "Show printer-friendly version link" checkbox. (default:
    enabled)
João Ventura's avatar
João Ventura committed
    It is also possible to enable or disable the PF link in individual
    comments via the "Show printer-friendly version link in individual
    comments" checkbox. (default: disabled)
João Ventura's avatar
João Ventura committed
  Administer > Site configuration > Printer-friendly (admin/settings/print)
João Ventura's avatar
João Ventura committed
    This is where all the module-specific configuration options can be set.
João Ventura's avatar
João Ventura committed
- To modify the template of printer friendly pages, simply edit the
João Ventura's avatar
João Ventura committed
print.tpl.php or the css/print.css files.
João Ventura's avatar
João Ventura committed
- It is possible to set per-content-type and/or theme-specific templates
  which are searched for in the following order: 
João Ventura's avatar
João Ventura committed
   1. print_[format].node-[type].tpl.php in the theme directory
   2. print_[format].node-[type].tpl.php in the module directory 
   3. print_[format].tpl.php in the theme directory
   4. print_[format].tpl.php in the module directory 
   5. print.node-[type].tpl.php in the theme directory
   6. print.node-[type].tpl.php in the module directory 
   7. print.tpl.php in the theme directory
   8. print.tpl.php in the module directory (supplied by the module)
João Ventura's avatar
João Ventura committed
API
---
print_insert_link(), print_mail_insert_link(), print_pdf_insert_link()

The *_insert_link functions are available to content developers that prefer
to place the printer-friendly link in a custom location. It is advisable to
João Ventura's avatar
João Ventura committed
disable the regular Printer-friendly link so that it is not shown in both
locations.
João Ventura's avatar
João Ventura committed
Calling the function like this:
João Ventura's avatar
João Ventura committed
  print_insert_link()
João Ventura's avatar
João Ventura committed
will return the HTML for a link pointing to a Printer-friendly version of
the current page.
João Ventura's avatar
João Ventura committed
It is also possible to specify the link to the page yourself:
João Ventura's avatar
João Ventura committed
  print_insert_link("print/42")
João Ventura's avatar
João Ventura committed
will return the HTML pointing to the printer-friendly version of node 42.
João Ventura's avatar
João Ventura committed
THEMEABLE FUNCTIONS
-------------------
João Ventura's avatar
João Ventura committed
The following themeable functions are defined:
  * theme_print_format_link()
  * theme_print_mail_format_link()
  * theme_print_pdf_format_link()
      Returns an array of formatted attributes for the Printer-friendly
      link.

  * theme_print_text()
    Returns an array of costumized text strings used in the printer-friendly
    page.

  * print_pdf_dompdf_footer($html)
    Format the dompdf footer contents

  * print_pdf_tcpdf_header($pdf, $html, $font)
    Format the TCPDF header
  * print_pdf_tcpdf_page($pdf)
    Format the TCPDF page settings (margins, etc)

  * print_pdf_tcpdf_content($pdf, $html, $font)
    Format the TCPDF page content

  * print_pdf_tcpdf_footer($pdf, $html, $font)
    Format the TCPDF footer contents

  * print_pdf_tcpdf_footer2($pdf)
    Format the TCPDF footer layout
João Ventura's avatar
João Ventura committed
MORE INFORMATION
----------------
João Ventura's avatar
João Ventura committed
For more information, consult the modules' documentation at
http://drupal.org/node/190171.

ACKNOWLEDGMENTS
---------------
The print, pdf and mail icons are copyright Plone Foundation. Thanks for
letting me use them!