You are here

function commerce_billy_pdf_output in Commerce Billy 7

Transforms HTML to PDF and outputs it to the browser.

Parameters

$html: The HTML to render as PDF

$filename: The filename to be used for the PDF.

$as_file: TRUE if a filecontent should be returned (e.g. for mails), else as stream for downloads.

2 calls to commerce_billy_pdf_output()
commerce_billy_pdf in modules/commerce_billy_pdf/commerce_billy_pdf.module
Page callback for invoice PDF.
commerce_billy_pdf_print_invoices in modules/commerce_billy_pdf/commerce_billy_pdf.module
Callback to generate a PDF.

File

modules/commerce_billy_pdf/commerce_billy_pdf.module, line 247
Commerce Billy module file.

Code

function commerce_billy_pdf_output($html, $filename, $as_file = FALSE) {
  $pdf_converter = variable_get('commerce_billy_pdf_converter', 'dompdf');
  if ($pdf_converter == 'dompdf') {
    return commerce_billy_pdf_dompdf($html, $filename, $as_file);
  }
  elseif ($pdf_converter == 'wkhtmltopdf') {
    return commerce_billy_pdf_wkhtmltopdf($html, $filename, $as_file);
  }
}