include 'Cezpdf.php'; require_once "Mail.php"; class Creport extends Cezpdf { function Creport($p, $o) { $this->__construct($p, $o, 'none'); } } $pdf = new Creport('a4', 'portrait'); $pdf->ezSetMargins(20, 20, 20, 20); $mainFont = 'Times-Roman'; // select a font $pdf->selectFont($mainFont); $size = 12; $height = $pdf->getFontHeight($size); // modified to use the local file if it can $pdf->openHere('Fit'); $pdf->ezText("PNG grayscaled with alpha channel"); $pdf->ezImage('images/test_grayscaled_alpha.png', 0, 0, 'none', 'right'); if (isset($_GET['d']) && $_GET['d']) { $pdfcode = $pdf->ezOutput(1); $pdfcode = str_replace("\n", "\n<br>", htmlspecialchars($pdfcode)); echo '<html><body>'; echo trim($pdfcode); echo '</body></html>'; } else { //$pdf->ezStream(array('compress'=>0)); //die; //$pdf->options['compression']=0; $doc = $pdf->ezOutput();
$tmp .= $section . "\n\n"; } } else { $tmp = $v['d']; } $tmp = str_replace($s, $r, $tmp); $bits = explode("\n", $tmp); foreach ($bits as $bit) { $data[] = $bit . "\n"; } } } $pdf->ezNewPage(); $pdf->ezStartPageNumbers(500, 28, 10, '', '', 1); $size = 12; $height = $pdf->getFontHeight($size); $textOptions = array('justification' => 'full'); $collecting = 0; $code = ''; foreach ($data as $line) { // go through each line, showing it as required, if it is surrounded by '<>' then // assume that it is a title $line = chop($line); if (strlen($line) && $line[0] == '#') { // comment, or new page request switch ($line) { case '#NP': $pdf->ezNewPage(); break; case '#C': $pdf->selectFont($codeFont);