Beispiel #1
0
     $code .= $line;
     //  } else if (((strlen($line)>1 && $line[1]=='<') || (strlen($line) && $line[0]=='<')) && $line[strlen($line)-1]=='>') {
 } else {
     if (strlen($line) > 1 && $line[1] == '<' && $line[strlen($line) - 1] == '>') {
         // then this is a title
         switch ($line[0]) {
             case '1':
                 $tmp = substr($line, 2, strlen($line) - 3);
                 $tmp2 = $tmp . '<C:rf:1' . rawurlencode($tmp) . '>';
                 $pdf->ezText($tmp2, 26, array('justification' => 'centre'));
                 break;
             default:
                 $tmp = substr($line, 2, strlen($line) - 3);
                 // add a grey bar, highlighting the change
                 $tmp2 = $tmp . '<C:rf:2' . rawurlencode($tmp) . '>';
                 $pdf->transaction('start');
                 $ok = 0;
                 while (!$ok) {
                     $thisPageNum = $pdf->ezPageCount;
                     $pdf->saveState();
                     $pdf->setColor(0.9, 0.9, 0.9);
                     $pdf->filledRectangle($pdf->ez['leftMargin'], $pdf->y - $pdf->getFontHeight(18) + $pdf->getFontDecender(18), $pdf->ez['pageWidth'] - $pdf->ez['leftMargin'] - $pdf->ez['rightMargin'], $pdf->getFontHeight(18));
                     $pdf->restoreState();
                     $pdf->ezText($tmp2, 18, array('justification' => 'left'));
                     if ($pdf->ezPageCount == $thisPageNum) {
                         $pdf->transaction('commit');
                         $ok = 1;
                     } else {
                         // then we have moved onto a new page, bad bad, as the background colour will be on the old one
                         $pdf->transaction('rewind');
                         $pdf->ezNewPage();