setSourceFile(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:if_oberstufenplaner/Resources/Public/pdf/maxim.pdf')); ////// $tplIdx = $this->importPage(1); ////// $this->addPage(); ////// $this->useTemplate($tplIdx, 10, 10, 90); //// parent::__construct(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:if_oberstufenplaner/Resources/Public/pdf/maxim.pdf')); //// $this->importPDF($file); // } public function configureFonts($extFontPath) { $this->customFonts['openSansRegularFont'] = \TCPDF_FONTS::addTTFfont(GeneralUtility::getFileAbsFileName($extFontPath.'OpenSans-Regular.ttf')); } public function getCustomFont($name) { if (isset($this->customFonts[$name])) { return $this->customFonts[$name]; } throw new \Exception('Font '.$name.' not found'); } public function pdfDrawFaecherTitel($title) { $this->SetFont($this->getCustomFont('openSansRegularFont'), '', $this->tableTitleFontSize); $this->currentX = 0; $this->SetTextColor(0, 0, 0); $this->SetFillColor(255, 255, 255); $this->setCellMargins($this->cellmarginLeft); $this->MultiCell($this->nameCellWidth, $this->lineHeight*2, $title, 0, 'L', false, 0, $this->currentX, $this->currentY); $this->currentX += ($this->nameCellWidth + $this->marginX); $this->MultiCell($this->dataCellWidth*2+$this->marginX, $this->lineHeight, 'Wochenstunden', 0, 'C', false, 0, $this->currentX, $this->currentY); $this->MultiCell($this->dataCellWidth+$this->marginX, $this->lineHeight, '11', 0, 'C', false, 0, $this->currentX, $this->currentY+($this->lineHeight+$this->marginY)); $this->MultiCell($this->dataCellWidth+$this->marginX, $this->lineHeight, '12', 0, 'C', false, 0, ($this->currentX+$this->dataCellWidth+$this->marginX), ($this->currentY+($this->lineHeight+$this->marginY))); $this->currentX += ($this->dataCellWidth + $this->marginX)*2; $this->MultiCell($this->dataCellWidth, $this->lineHeight*2, "Jahres-\nWochenstd.", 0, 'C', false, 0, $this->currentX, $this->currentY); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->MultiCell($this->dataCellWidth, $this->lineHeight*2, "Einbringung\nHalbjahre", 0, 'C', false, 0, $this->currentX, $this->currentY); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->MultiCell($this->dataCellWidth, $this->lineHeight*2, "Abitur-\nPrüfungsfach", 0, 'C', false, 0, $this->currentX, $this->currentY); $this->currentY += ($this->lineHeight+$this->marginY)*2; $this->SetY($this->currentY); } public function pdfDrawFachLine(Fach $fach) { $this->SetFont($this->getCustomFont('openSansRegularFont'), '', $this->tableCellFontSize); $this->currentX = 0; $this->SetTextColor(0, 0, 0); // list($col1, $col2, $col3) = $fach->getRgbColor(); // $this->SetFillColor($col1, $col2, $col3); $fillColor1 = array(217, 217, 217); $fillColor2 = array(238, 238, 238); $this->setCellMargins($this->cellmarginLeft); $this->SetX($this->currentX); $this->SetY($this->currentY); $this->SetFillColor($fillColor1[0], $fillColor1[1], $fillColor1[2]); $this->Cell($this->nameCellWidth, $this->lineHeight, $fach->getName(), 0, 0, 'L', true); $this->currentX += ($this->nameCellWidth + $this->marginX); $this->setX($this->currentX); $this->SetFillColor($fillColor2[0], $fillColor2[1], $fillColor2[2]); $this->Cell($this->dataCellWidth, $this->lineHeight, $fach->getWochenStunden11(), 0, 0, 'C', true); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->setX($this->currentX); $this->Cell($this->dataCellWidth, $this->lineHeight, $fach->getWochenStunden12(), 0, 0, 'C', true); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->setX($this->currentX); $this->Cell($this->dataCellWidth, $this->lineHeight, $fach->getJahreswochenstunden(), 0, 0, 'C', true); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->setX($this->currentX); $this->Cell($this->dataCellWidth, $this->lineHeight, $fach->getHalbjahresleistungen(), 0, 0, 'C', true); $this->currentX += ($this->dataCellWidth + $this->marginX); $this->setX($this->currentX); $this->Cell($this->dataCellWidth, $this->lineHeight, strtoupper($fach->getPruefung()), 0, 0, 'C', true); $this->currentY += ($this->lineHeight+$this->marginY); $this->SetY($this->currentY); } function Header() { if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') { $this->Image(PATH_site . 'fileadmin/templates/faecherplaner/img/wappen-ministerium.png', 3, 1, 16, 2.11, 'PNG', '', '', true); // Angaben in cm // $this->Image($GLOBALS['TSFE']->baseUrl . 'fileadmin/templates/faecherplaner/img/wappen-ministerium.png', 3, 0, 16, 2.11, 'PNG', '', '', true); // Angaben in cm } else { // $this->Image($GLOBALS['TSFE']->baseUrl . 'fileadmin/templates/img/wappen-ministerium.png', 3, 1, 16, 2.11, 'PNG', '', '', true); // Angaben in cm $this->Image(PATH_site . 'fileadmin/templates/img/wappen-ministerium.png', 3, 1, 16, 2.11, 'PNG', '', '', true); // Angaben in cm } } function Footer() { $lineHeight = 0.4; $footerHeight = 3.8; //left $this->SetXY(1.25, -$footerHeight); $this->SetTextColor(0, 0, 0); $this->SetFont($this->getCustomFont('openSansRegularFont'),'',8); $this->MultiCell(21-(1.25*2), $lineHeight, $this->footerText, 0, 'L', false, 0); $this->SetX(1.25); // $this->MultiCell(20, $lineHeight, $this->footerText, 0, 1, 'L', false); $this->SetX(1.25); } }