Пример #1
0
<?php

/**
 * @var VeranstaltungController $this
 * @var Veranstaltung $veranstaltung
 * @var array|Aenderungsantrag[] $aenderungsantraege
 * @var Sprache $sprache
 */
header('Content-type: application/pdf; charset=UTF-8');
$cached = Yii::app()->cache->get("pdf_ae_" . $veranstaltung->id);
if ($cached !== false) {
    echo $cached;
} else {
    // create new PDF document
    $pdf = new AntragsgruenPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetTitle($veranstaltung->name);
    //$pdf->SetSubject($sprache->get("Antrag") . " " . $model->revision_name . ": " . $model->name);
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 006', 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);
    $pdf->setPrintHeader(false);
    $pdf->setPrintFooter(true);
    //set margins
    $pdf->SetMargins(25, 40, 25);
Пример #2
0
<?php

/**
 * @var Antrag $model
 * @var Sprache $sprache
 * @var AntragController $this
 */
// Muss am Anfang stehen, ansonsten zerhaut's die Zeilenumbrüche; irgendwas mit dem internen Encoding
$absae = $model->getParagraphs();
// create new PDF document
$pdf = new AntragsgruenPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
/** @var array|string[] $initiatorinnen  */
$initiatorinnen = array();
$unterstuetzerInnen = array();
foreach ($model->antragUnterstuetzerInnen as $unt) {
    if ($unt->rolle == IUnterstuetzerInnen::$ROLLE_INITIATORIN) {
        $name = $unt->person->name;
        if ($unt->person->organisation != "" || $unt->beschlussdatum > 0) {
            $name .= " (";
            if ($unt->person->organisation != "") {
                $name .= $unt->person->organisation;
            }
            if ($unt->person->organisation != "" && $unt->beschlussdatum > 0) {
                $name .= ", ";
            }
            if ($unt->beschlussdatum > 0) {
                $name .= "Beschlossen am " . AntraegeUtils::date_sql2de($unt->beschlussdatum);
            }
            $name .= ")";
        }
        $initiatorinnen[] = $name;