You are here

function tcpdf_example_default_header in TCPDF 7

Same name and namespace in other branches
  1. 8 tcpdf_example/tcpdf_example.module \tcpdf_example_default_header()

Callback for generating the header. This function acts like if it overridded the Header() function of tcpdf class except the tcpdf instance is not $this but a parameter.

Parameters

type $tcpdf TCPDFDrupal instance. It can be used as $this in the: Header() function of a siebling of TCPDF.

1 string reference to 'tcpdf_example_default_header'
tcpdf_example_simple_pdf in tcpdf_example/tcpdf_example.pages.inc
Generates a pdf file using TCPDF module.

File

tcpdf_example/tcpdf_example.pages.inc, line 84
Contains page callbacks and related functions of TCPDF module.

Code

function tcpdf_example_default_header(&$tcpdf, $context) {

  // $args contains passed variable...
  $theme_settings = variable_get('theme_' . variable_get('theme_default', '') . '_settings', '');
  if (isset($theme_settings['logo_path']) && file_exists($theme_settings['logo_path'])) {
    $tcpdf
      ->Image(drupal_realpath($theme_settings['logo_path']), 10, 10, 30, 0, '', variable_get('site_url', ''), '', TRUE, 150, '', FALSE, FALSE, 0, FALSE, FALSE, FALSE);
  }
  $tcpdf
    ->Write(0, $context['welcome_message'], '', 0, 'J', true, 0, false, true, 0);
}