I have need to send pdf via drupal mail. I want to use tcpdf library but when im trying to use example i have error: http: //..../tcpdf_example/download/simple
Fatal error: Call to a member function DrupalInitialize() on a non-object in C:\xampp\htdocs\drupalac_gw\sites\all\modules\tcpdf\tcpdf_example\tcpdf_example.pages.inc on line 55
$html = theme('tcpdf_example_basic_html');
// Never make an instance of TCPDF or TCPDFDrupal classes manually.
// Use tcpdf_get_instance() instead.
$tcpdf = tcpdf_get_instance();
/* DrupalInitialize() is an extra method added to TCPDFDrupal that initializes
* some TCPDF variables (like font types), and makes possible to change the
* default header or footer without creating a new class.
*/
$tcpdf->DrupalInitialize(array(
'footer' => array(
'html' => 'This is a test!! <em>Bottom of the page</em>',
),
'header' => array(
'callback' => array(
'function' => 'tcpdf_example_default_header',
// You can pass extra data to your callback.
'context' => array(
'welcome_message' => 'Hello, context array!',
),
),
),
));
then somehow...
...
$attachment = array(
'filecontent' => $tcpdf->Output('', 'E');
'filename' => 'test.txt',
'filemime' => 'text/plain',
);
switch($key) {
case 'notice':
$langcode = $message['language']->language;
$message['subject'] = 'example submission from' . $account;
$message['body'][] =''. $account .' has submitted an example.';
$message['params']['attachments'][] = $attachment;
break;
...
What i need to correct to get rid of error?