README.txt 4.02 KB
Newer Older
jcnventura's avatar
jcnventura committed
1 2
DESCRIPTION
-----------
3

jcnventura's avatar
jcnventura committed
4 5 6 7
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)
8
    * PDF version (at www.example.com/printpdf/nid)
9
    * Send by-email (at www.example.com/printmail/nid)
jcnventura's avatar
jcnventura committed
10 11

where nid is the node id of content to render.
12

jcnventura's avatar
jcnventura committed
13 14 15
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.
16

17 18 19 20 21
INSTALLATION
------------

Follow the instructions in the provided INSTALL.txt file.

jcnventura's avatar
jcnventura committed
22 23
CONFIGURATION
-------------
24

jcnventura's avatar
jcnventura committed
25
- There are several settings that can be configured in the following places:
26

jcnventura's avatar
jcnventura committed
27
  Administer > Site building > Modules (admin/build/modules)
jcnventura's avatar
jcnventura committed
28
    Enable or disable the module. (default: disabled)
29

jcnventura's avatar
jcnventura committed
30
  Administer > User management > Access control (admin/user/access)
jcnventura's avatar
jcnventura committed
31 32 33 34 35
    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)
36

jcnventura's avatar
jcnventura committed
37
  Administer > Content management > Content types (admin/content/types)
jcnventura's avatar
jcnventura committed
38 39 40
    For each content type it is possible to enable or disable the PF link
    via the "Show printer-friendly version link" checkbox. (default:
    enabled)
jcnventura's avatar
jcnventura committed
41 42 43
    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)
44

jcnventura's avatar
jcnventura committed
45
  Administer > Site configuration > Printer-friendly (admin/settings/print)
jcnventura's avatar
jcnventura committed
46
    This is where all the module-specific configuration options can be set.
47

jcnventura's avatar
jcnventura committed
48
- To modify the template of printer friendly pages, simply edit the
jcnventura's avatar
jcnventura committed
49
print.tpl.php or the css/print.css files.
50

jcnventura's avatar
jcnventura committed
51 52
- It is possible to set per-content-type and/or theme-specific templates
  which are searched for in the following order: 
jcnventura's avatar
jcnventura committed
53 54 55 56 57 58 59 60
   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)
61

62 63 64
  format is either html, mail or pdf, and type is Drupal's node type (e.g.
  page, story, etc.)

jcnventura's avatar
jcnventura committed
65 66
API
---
67

68
print_insert_link(), print_mail_insert_link(), print_pdf_insert_link()
69 70 71

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
jcnventura's avatar
jcnventura committed
72 73
disable the regular Printer-friendly link so that it is not shown in both
locations.
74

jcnventura's avatar
jcnventura committed
75
Calling the function like this:
76

jcnventura's avatar
jcnventura committed
77
  print_insert_link()
78

jcnventura's avatar
jcnventura committed
79 80
will return the HTML for a link pointing to a Printer-friendly version of
the current page.
81

jcnventura's avatar
jcnventura committed
82
It is also possible to specify the link to the page yourself:
83

jcnventura's avatar
jcnventura committed
84
  print_insert_link("print/42")
85

jcnventura's avatar
jcnventura committed
86
will return the HTML pointing to the printer-friendly version of node 42.
87

jcnventura's avatar
jcnventura committed
88 89
THEMEABLE FUNCTIONS
-------------------
90

jcnventura's avatar
jcnventura committed
91
The following themeable functions are defined:
92

93
  * theme_print_format_link()
94
  * theme_print_mail_format_link()
95 96 97 98 99 100 101 102 103
  * theme_print_pdf_format_link()
      Returns an array of formatted attributes for the Printer-friendly
      link.

  * print_pdf_dompdf_footer($html)
    Format the dompdf footer contents

  * print_pdf_tcpdf_header($pdf, $html, $font)
    Format the TCPDF header
104

105 106 107 108 109 110 111 112 113 114 115
  * 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
116

jcnventura's avatar
jcnventura committed
117 118
MORE INFORMATION
----------------
119

jcnventura's avatar
jcnventura committed
120 121
For more information, consult the modules' documentation at
http://drupal.org/node/190171.
122 123 124 125 126

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