"; } else { echo "NO NUG NUGS
"; } */ error_reporting(E_ALL); //ini_set('display_errors', '1'); if (isset($_GET['pageID']) && is_numeric($_GET['pageID'])) { $pageID = $_GET['pageID']; $key = null; $pagename = get_the_title($_GET['pageID']); } else { $pageID = 879; // This is the PageID of the PDF generator. $key = null; $pagename = get_the_title(879); } $pageContent = get_post_meta($pageID, $key, false); // Prepare $css = " "; $html = "

$pagename Paintball Centre

" . $pageContent['pdfContent'][0] . "
"; require_once('./wp-content/themes/IPGUK_Template/tcpdf/tcpdf/config/lang/eng.php'); require_once('./wp-content/themes/IPGUK_Template/tcpdf/tcpdf/tcpdf.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('International Paintball Group'); $pdf->SetTitle('Ticket'); $pdf->SetSubject('Voucher'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetHeaderMargin(0); $pdf->SetFooterMargin(0); $pdf->SetAutoPageBreak(false); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); $pdf->SetFont('helvetica', '', 11); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->AddPage(); // full page-size image numbers: //$pdf->Image("http://ipgau2.dtestf.com.au/wp-content/maps/".$pagename.".jpg", 0, 0, 210, 297, '', '', '', false, 0, '', false, false, 0); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/common-logo.jpg", 173, 7, '', 14, '', '', '', false, 0, '', false, false, 0); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $css . $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/" . $pagename . ".jpg", 4.5, 170, '', 118, '', '', '', false, 0, '', false, false, 0); //$pdf->Text(90, 26, $pagename); if ($pageContent['pdfContent2'][0]) { $pdf->AddPage(); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/common-logo.jpg", 173, 7, '', 14, '', '', '', false, 0, '', false, false, 0); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $css . "
" . $pageContent['pdfContent2'][0] . "
", $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); } if ($pageContent['pdfContent3'][0]) { $pdf->AddPage(); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/common-logo.jpg", 173, 7, '', 14, '', '', '', false, 0, '', false, false, 0); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $css . "
" . $pageContent['pdfContent3'][0] . "
", $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); } if ($pageContent['pdfContent4'][0]) { $pdf->AddPage(); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/common-logo.jpg", 173, 7, '', 14, '', '', '', false, 0, '', false, false, 0); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $css . "
" . $pageContent['pdfContent4'][0] . "
", $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); } if ($pageContent['pdfContent5'][0]) { $pdf->AddPage(); $pdf->Image(get_bloginfo('wpurl') . "/wp-content/maps/common-logo.jpg", 173, 7, '', 14, '', '', '', false, 0, '', false, false, 0); $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $css . "
" . $pageContent['pdfContent5'][0] . "
", $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); } $pdf->lastPage(); $pdf->Output('directions.pdf', 'I'); ?>