You are here

function hook_print_pdf_generate in Printer, email and PDF versions 7.2

Generate a PDF version of the provided HTML.

Parameters

string $html: HTML content of the PDF.

array $meta: Meta information to be used in the PDF

  • url: original URL
  • name: author's name
  • title: Page title
  • node: node object.

string $paper_size: (optional) Paper size of the generated PDF.

string $page_orientation: (optional) Page orientation of the generated PDF.

Return value

Object|null generated PDF page, or NULL in case of error

See also

print_pdf_controller_html()

Related topics

4 functions implement hook_print_pdf_generate()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

print_pdf_dompdf_print_pdf_generate in print_pdf/lib_handlers/print_pdf_dompdf/print_pdf_dompdf.pages.inc
Implements hook_print_pdf_generate().
print_pdf_mpdf_print_pdf_generate in print_pdf/lib_handlers/print_pdf_mpdf/print_pdf_mpdf.pages.inc
Implements hook_print_pdf_generate().
print_pdf_tcpdf_print_pdf_generate in print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc
Implements hook_print_pdf_generate().
print_pdf_wkhtmltopdf_print_pdf_generate in print_pdf/lib_handlers/print_pdf_wkhtmltopdf/print_pdf_wkhtmltopdf.pages.inc
Implements hook_print_pdf_generate().

File

print_pdf/print_pdf.api.php, line 86
Hooks provided by the PDF version module.

Code

function hook_print_pdf_generate($html, $meta, $paper_size = NULL, $page_orientation = NULL) {
  $pdf = new PDF($meta, $paper_size, $page_orientation);
  $pdf
    ->writeHTML($html);
  return $pdf
    ->Output();
}