You are here

function theme_print_pdf_tcpdf_page in Printer, email and PDF versions 5.4

Same name and namespace in other branches
  1. 5.3 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_page()
  2. 6 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_page()
  3. 7.2 print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc \theme_print_pdf_tcpdf_page()
  4. 7 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_page()
  5. 5.x print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_page()

Format the TCPDF page settings (margins, etc)

Parameters

$pdf: current TCPDF object

See also

theme_print_pdf_tcpdf_page()

1 theme call to theme_print_pdf_tcpdf_page()
_print_pdf_tcpdf in print_pdf/print_pdf.pages.inc
Generate the PDF file using the TCPDF library

File

print_pdf/print_pdf.pages.inc, line 462

Code

function theme_print_pdf_tcpdf_page($pdf) {

  // set margins
  $pdf
    ->SetMargins(15, 20, 15);

  // set auto page breaks
  $pdf
    ->SetAutoPageBreak(TRUE, 15);

  // set image scale factor
  sscanf(PDF_PRODUCER, "TCPDF %d.%d.%d", $major, $minor, $build);
  $imagescale = $major >= 4 && $minor >= 6 && $build >= 2 ? 1 : 4;
  $pdf
    ->setImageScale($imagescale);

  // set image compression quality
  $pdf
    ->setJPEGQuality(100);
  return $pdf;
}