Area Print

Component ID

1424920

Component name

Area Print

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

6187

Component created

Component changed

Component body

Area Print is a simple module that let's you add print button or link that sends any given element(div, table, block.. anything with a css id) to a printer.
All original css from the page(including definitions from parent elements) is applied(though browsers tend to strip some off) and you can append your own on top of that.

In it's current form, the module provides only API-like functionality, no UI at all, though this can be changed in the future if needed.

USAGE:

Where ever you can add php code(php-field, text-area with php input format, custom module, template etc.), you can call the button like this:
print area_print_form($options);
where $options is an optional associative array containing:

  • target_id: Id of the element you want to print,
  • button_id: Id that will be given to the print link or button,
  • value: The text for the link/button, e.g. t('Print'),
  • type: either 'link' or 'button',
  • custom_css: path to a css file that will get added to the page before printing, e.g. drupal_get_path('module','my_module').'/css/print.css')

See README.txt for working example.

CREDITS

druid.fi
The module was sponsored by Lääkärikeskus-yhtymä Oy and
is developed by Roni Kantis and currently sponsored by Druid. Contact us for all your Drupal needs.