Het produceert een header en footer maar verder wordt er niets geprint.
Ik kijk al uren naar onderstaand script
<?php
if (session_id() == "") session_start(); // if no active session we start a new one
//ini_set("memory_limit","64M");
ini_set('display_errors', 1);
include("tcPDF_inc.php");
// tcPDF scripts used once
require_once('../tcpdf/config/lang/eng.php');
require_once('../tcpdf/tcpdf.php');
// ---------------------------------------------------------
// Get some data from URL
if(isset($_GET['id'])) {
$Title = $_GET['id'];
} else {
$include = 'template.pdf.default.php';
}
// ---------------------------------------------------------
// Extend the TCPDF class to create custom Header and Footer
class MYPDF extends TCPDF {
//Page header
function Header() {
// Logo
$this->SetTextColor(128, 128, 128); // Set color
$this->SetFont('helvetica', 'B', 25); // Set font
// Title
$this->Cell(0, 0, $Title, 0, false, 'L', 0, 'L', 0, false, ' ', ' ');
$image_file = 'images/Header_Brief.png';
$this->Image($image_file, 0, 6, 210, '', 'PNG', '', 'T', false, 300, '', false, false, 0, false, false, false);
}
// Page footer
function Footer() {
$datum = date('l jS \of F Y \a\t h:i:s A');
$footerDateText = 'This document is created on '.$datum;
$this->SetY(-15);
$this->SetTextColor(0, 0, 0);
$this->SetFont('helvetica', ' ', 7);
$this->Cell(0,0, $footerDateText,' ',1,'R');
$this->SetFont('helvetica', ' ', 8);
$this->Cell(0,0, 'Stichting CCI Boekelo Postbus 535 7500AM Enschede','T',1,'L');
$this->Cell(0,0, 'T +31(0)53-4282831 F +31(0)53-4282851 [email protected] www.military-boekelo.nl',' ',1,'L');
}
}
// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('EventManagement');
$pdf->SetTitle($Title);
$pdf->SetSubject($Subject);
$pdf->SetKeywords('CCI, Boekelo');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set document propertie
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Harry H. Arends');
$pdf->SetTitle('Event Management '. $ID);
$pdf->SetSubject($ID);
$pdf->SetKeywords('Eventing, Military, CCI***, Boekelo, Enschede, Netherlands, FEI');
// *** Set PDF protection (encryption) *********************
//$pdf->SetProtection($permissions=array('modify', 'copy'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null);
$pdf->SetProtection($permissions=array(), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null);
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_width, PDF_HEADER_TITLE, PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set margins
//$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetMargins(PDF_MARGIN_LEFT, 50, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
$pdf->setJPEGQuality(75); // set JPEG quality
$pdf->SetFont('helvetica', '', 10); // set font
// ---------------------------------------------------------
// ---------------------------------------------------------
// Place here the TCPDF Gearbox
// --------------------------------------------------------
// $pdf->writeHTML($html, true, false, true, false, ' ');
// print a block of text using Write()
$pdf->Write(0, $Title, '', 0, 'C', true, 0, false, false, 0);
$pdf->Write(0, $include, '', 0, 'C', true, 0, false, false, 0);
// ---------------------------------------------------------
date_default_timezone_set('EUROPE');
$date1 = date('d-m-y G:i:s'); // H - 24 hr format - values 00 to 23
//Close and output PDF document
$filename= $date1."-EventManagement.pdf";
$pdf->Output($filename, 'I');
//============================================================+
// END OF FILE
//============================================================+
?>
De twee write statement moeten variabelen printen maar doen dat niet en ik komer niet achter waarom. Het zal wel weer heel simpel zijn.
Alvast bedankt voor de hulp
Harry