+ //return self::_html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path);
+ }
+ }
+
+ static function _html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path) {
+ // Documentation on the TCPDF library can be found at: http://www.tcpdf.org
+ // This function also uses the FPDI library documented at: http://www.setasign.com/products/fpdi/about/
+ // Syntax borrowed from https://github.com/jake-mw/CDNTaxReceipts/blob/master/cdntaxreceipts.functions.inc
+ require_once 'tcpdf/tcpdf.php';
+ require_once('FPDI/fpdi.php'); // This library is only in the 'packages' area as of version 4.5
+
+ $paper_size_arr = array( $paper_size[2], $paper_size[3]);
+
+ $pdf = new TCPDF($orientation, 'pt', $paper_size_arr);
+ $pdf->Open();
+
+ if (is_readable($stationery_path)){
+ $pdf->SetStationery( $stationery_path );