diff --git a/include/xslfo2pdf/fo_block.php b/include/xslfo2pdf/fo_block.php
index baba76300..4e1756e2f 100644
--- a/include/xslfo2pdf/fo_block.php
+++ b/include/xslfo2pdf/fo_block.php
@@ -22,6 +22,7 @@ http://xslf2pdf.tegonal.com
*/ ?>
parentNode->nodeName!='fo:table-cell')
$height_of_current_row=0;
$this->initAttribute($node, "text-align");
+ $this->initAttribute($node, "vertical-align");
$this->initAttribute($node, "content-width");
}
function processContent($text) {
global $max_line_height_for_that_row;
+ global $max_line_height_for_that_cell;
$talign = $this->getContext("text-align");
+ //oesi - add attribute vertical-align
+ $valign = $this->getContext("vertical-align");
//oesi - add attribute content-width
$colwidth = $this->getContext("content-width");
switch ($talign) {
@@ -86,10 +91,41 @@ class FO_Block extends FO_LayoutObject{
// echo "Draw at:$x:$x2:$y
";
$pdf = $this->getPdf();
$lineHeight = $this->getContext("line-height");
-
+
+ //oesi - bei vertikaler Zentrierung wird die y koordinate angepasst (Nur bei Tabellen)
+ switch ($valign)
+ {
+ case "center":
+ //Innerhalb der Zeile zentrieren
+ $y = ($y - ($lineHeight - ($pdf->FontSizePt/72*25.4)) / 2);
+
+ //innerhalb der ganzen TabellenZelle zentrieren
+ if($max_line_height_for_that_row>1 && $max_line_height_for_that_row!=$max_line_height_for_that_cell)
+ $y += ($lineHeight/2*($max_line_height_for_that_row-$max_line_height_for_that_cell));
+ break;
+
+ case "bottom":
+ //Innerhalb der Zeile zentrieren
+ $y = ($y - ($lineHeight - ($pdf->FontSizePt/72*25.4)) / 2);
+
+ //ans untere ende der TabellenZelle schieben
+ if($max_line_height_for_that_row>1 && $max_line_height_for_that_row!=$max_line_height_for_that_cell)
+ $y += ($lineHeight*($max_line_height_for_that_row-$max_line_height_for_that_cell));
+ break;
+ case "top":
+ //Innerhalb der Zeile zentrieren
+ $y = ($y - ($lineHeight - ($pdf->FontSizePt/72*25.4)) / 2);
+ break;
+ default:
+ //Hier lasse ich die zentrierung in der Zeile weg, weil ich nicht genau weiss, welche folgeschaeden dadurch
+ //verursacht werden. Eigentlich muesste die Zentrierung der Zeile aber immer stattfinden, egal ob vertical-align
+ //gesetzt ist oder nicht.
+ }
+
list($width, $height, $nb, $sx, $sy, $lx, $ly) =
$pdf->Text2($x2, $y, $text, $align, $lineHeight, $x, $colwidth);
-//echo "Wrote block:$colwidth:$height:$lineHeight:".$pdf->FontSize.":".$pdf->FontSizePt."$text
";
+
+ //echo "Wrote block:$colwidth:$height:$lineHeight:".$pdf->FontSize.":".$pdf->FontSizePt."$text
";
//oesi - wenn die hoehe einer Spalte groesser ist, dann muss der Border
//fuer die ganze row groesser gezeichnet werden.
diff --git a/include/xslfo2pdf/fo_layout.php b/include/xslfo2pdf/fo_layout.php
index 89a9ad833..db3c1fdf9 100644
--- a/include/xslfo2pdf/fo_layout.php
+++ b/include/xslfo2pdf/fo_layout.php
@@ -72,6 +72,91 @@ class FO_LayoutObject extends FO_FlowContainer {
return str_replace('EURO',chr(128),utf8_decode($str));
}
+ //Spaltenhoehe Berechnen
+ function BerechneZellenHoehe($cell, $anzahl_lines_max)
+ {
+ $pdf = $this->getPdf();
+ $output = '';
+ if($cell->childNodes)
+ {
+ foreach($cell->childNodes as $block)
+ {
+ //Blockelement heraussuchen
+ if($block->nodeName=='fo:block')
+ {
+ //Width des block Elements holen
+ if($block->attributes->getNamedItem('content-width'))
+ {
+ //Schriftgroesse des Elements holen bzw des uebergeordneten
+ if($block->attributes->getNamedItem('font-size'))
+ $font_size=$block->attributes->getNamedItem('font-size')->nodeValue;
+ else
+ $font_size=$this->getContext("font-size");
+
+ //wenn schriftgroesse in pt angegeben ist dann in mm umrechnen
+ if(strstr($font_size,'pt'))
+ $font_size = $font_size/72*25.4;
+ $content_width = $block->attributes->getNamedItem('content-width')->nodeValue;
+ //$output .= $block->nodeValue;
+
+ $anzahl_lines=0;
+ //sonderzeichen konvertieren
+ $line = $this->convert($block->nodeValue);
+
+ //Damit bei den Fussnoten am Zeugnis das Sonderzeichen nicht als 5 Zeichen gezaehlt wird
+ //wird hier einfach das erste Zeichen ersetzt
+ $line = '1'.substr($line, 1);
+ //Zeilenumbrueche loeschen
+ $line = str_replace("\n",'', trim($line));
+ //Lines nach Newlines splitten
+ $lines = explode('\n', $line);
+ foreach ($lines as $line)
+ {
+ if($line!='')
+ {
+ do
+ {
+ /*$x = $this->getContext("x");
+ $x2 = $this->getContext("startx");
+ if (!$x2) {
+ $x2 = $x;
+ }*/
+ //echo "x2:$x2
";
+
+ $w = $content_width-1;
+
+ //Anzahl der zeichen holen die in dieser zeile noch platz haben
+ $noc = $pdf->GetNumberOfChars($w, $line, $font_size);
+ //wenn das wort nicht abgeteilt werden kann dann ueber den rand hinausschreiben
+ if($noc==-1)
+ $noc = strlen($line);
+ //Zeile abteilen
+ $showLine = substr($line, 0, $noc);
+
+ $output.= "w=$w noc=$noc fontsize=$font_size
$showLine ($line)";
+
+ //$textWidth = $pdf->GetStringWidth($showLine);
+ //Rest der Line als neue Line
+ $line = trim(substr($line, $noc));
+ //Anzahl der verbleibenden zeichen ermitteln
+ $width = strlen($line); //$pdf->GetNumberOfChars($w, $line, $font_size);
+ $anzahl_lines++;
+ } while($width>0);
+ }
+ }
+ $output.= " Breaks $anzahl_lines
";
+ //Wenn die Anzahl der benoetigten Zeilen in dieser Zelle
+ //Groesser als die bisher groesste ist dann aendern
+ if($anzahl_lines_max<$anzahl_lines)
+ $anzahl_lines_max = $anzahl_lines;
+ break;
+ }
+ }
+ }
+ }
+ return $anzahl_lines_max;
+ }
+
//oesi - Bei Tabellen wird die Hoehe der Row im vorhinein berechnet
function BerechneTabellenHoehe($child)
{
@@ -83,90 +168,17 @@ class FO_LayoutObject extends FO_FlowContainer {
//alle Zellen durchlaufen
foreach($child->childNodes as $cell)
{
- if($cell->childNodes)
- {
- foreach($cell->childNodes as $block)
- {
- //Blockelement heraussuchen
- if($block->nodeName=='fo:block')
- {
- //Width des block Elements holen
- if($block->attributes->getNamedItem('content-width'))
- {
- //Schriftgroesse des Elements holen bzw des uebergeordneten
- if($block->attributes->getNamedItem('font-size'))
- $font_size=$block->attributes->getNamedItem('font-size')->nodeValue;
- else
- $font_size=$this->getContext("font-size");
-
- //wenn schriftgroesse in pt angegeben ist dann in mm umrechnen
- if(strstr($font_size,'pt'))
- $font_size = $font_size/72*25.4;
- $content_width = $block->attributes->getNamedItem('content-width')->nodeValue;
- //$output .= $block->nodeValue;
-
- $anzahl_lines=0;
- //sonderzeichen konvertieren
- $line = $this->convert($block->nodeValue);
-
- //Damit bei den Fussnoten am Zeugnis das Sonderzeichen nicht als 5 Zeichen gezaehlt wird
- //wird hier einfach das erste Zeichen ersetzt
- $line = '1'.substr($line, 1);
- //Zeilenumbrueche loeschen
- $line = str_replace("\n",'', trim($line));
- //Lines nach Newlines splitten
- $lines = explode('\n', $line);
- foreach ($lines as $line)
- {
- if($line!='')
- {
- do
- {
- /*$x = $this->getContext("x");
- $x2 = $this->getContext("startx");
- if (!$x2) {
- $x2 = $x;
- }*/
- //echo "x2:$x2
";
-
- $w = $content_width-1;
-
- //Anzahl der zeichen holen die in dieser zeile noch platz haben
- $noc = $pdf->GetNumberOfChars($w, $line, $font_size);
- //wenn das wort nicht abgeteilt werden kann dann ueber den rand hinausschreiben
- if($noc==-1)
- $noc = strlen($line);
- //Zeile abteilen
- $showLine = substr($line, 0, $noc);
-
- $output.= "w=$w noc=$noc fontsize=$font_size
$showLine ($line)";
-
- //$textWidth = $pdf->GetStringWidth($showLine);
- //Rest der Line als neue Line
- $line = trim(substr($line, $noc));
- //Anzahl der verbleibenden zeichen ermitteln
- $width = strlen($line); //$pdf->GetNumberOfChars($w, $line, $font_size);
- $anzahl_lines++;
- } while($width>0);
- }
- }
- $output.= " Breaks $anzahl_lines
";
- //Wenn die Anzahl der benoetigten Zeilen in dieser Zelle
- //Groesser als die bisher groesste ist dann aendern
- if($anzahl_lines_max<$anzahl_lines)
- $anzahl_lines_max = $anzahl_lines;
- break;
- }
- }
- }
- }
+ $anzahl_lines_max = $this->BerechneZellenHoehe($cell, $anzahl_lines_max);
}
//Groesse der Zellen in Globale Variable schreiben
$max_line_height_for_that_row = $anzahl_lines_max;
//echo $output." - Line breaks $anzahl_lines_max times
";
}
+
+
function parse(DOMNode $node) {
+ global $max_line_height_for_that_cell;
//set default attributes
$this->initDefaultAttributes($node);
$this->initAttributes($node);
@@ -211,6 +223,9 @@ class FO_LayoutObject extends FO_FlowContainer {
//oesi - Bei Table-rows im vorhinein die hoehe berechnen
if($child->nodeName=='fo:table-row')
$this->BerechneTabellenHoehe($child);
+ //oesi - Bei Table-cell im vorhinein die hoehe berechnen
+ if($child->nodeName=='fo:table-cell')
+ $max_line_height_for_that_cell = $this->BerechneZellenHoehe($child,0);
$this->processChildNode($child, $this->getChildNodes());
}
}
diff --git a/system/xsl/Zeugnis_0_v2.xsl b/system/xsl/Zeugnis_0_v2.xsl
new file mode 100644
index 000000000..a1189efdf
--- /dev/null
+++ b/system/xsl/Zeugnis_0_v2.xsl
@@ -0,0 +1,322 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ZEUGNIS \n
+
+
+
+
+
+
+ (
+
+ )
+
+
+
+
+
+
+
+ -Studiengang
+
+
+
+
+
+
+
+
+
+
+
+ Personenkennzeichen:
+
+
+
+
+
+ Kennzahl des Studienganges:
+
+
+
+
+
+
+
+
+
+
+
+ Vorname/Familienname:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Geburtsdatum:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lehrveranstaltung
+
+
+
+
+ Note
+
+
+
+
+ SWS
+
+
+
+
+ ECTS-LP
+
+
+
+
+
+
+
+
+ \n
+
+
+
+
+
+
+ Notenstufen:
+
+
+ Sehr gut (1), gut (2), Befriedigend (3), Genügend (4), Nicht genügend (5),
+
+
+
+
+
+
+
+ Angerechnet (ar), nicht beurteilt (nb), teilgenommen (tg), bestanden (b), erfolgreich absolviert (ea), nicht erfolgreich absolviert (nea)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wien, am
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ \nStudiengangsleitung
+
+
+
+
+
+
+
+
+ Ort, Datum
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Auslandsaufenthalt: -, ,
+ \n Die im Ausland absolvierten Lehrveranstaltungen werden für das . Semester des Studiums an der Fachhochschule Technikum Wien angerechnet (Details siehe Transcript of Records der Gasthochschule).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+