diff --git a/include/xslfo2pdf/fpdf/myfpdf.php b/include/xslfo2pdf/fpdf/myfpdf.php index 1744d4573..66629ced2 100644 --- a/include/xslfo2pdf/fpdf/myfpdf.php +++ b/include/xslfo2pdf/fpdf/myfpdf.php @@ -25,6 +25,30 @@ require_once("fpdf.php"); class MyPdf extends FPDF { + + /** + * Konstruktor + * + * @param $orientation: p oder portrait = Hochformat + * l oder landscape = Querformat + * + * $unit: pt = Point + * mm = Millimeter + * cm = Zentimeter + * in = Inch + * + * $format: A3 + * A4 + * A5 + * letter + * legal + */ + function MyPdf($orientation='P',$unit='mm',$format='A4') + { + //Call parent constructor + $this->FPDF($orientation,$unit,$format); + } + /** * Additional getter methods **/ diff --git a/include/xslfo2pdf/xslfo2pdf.php b/include/xslfo2pdf/xslfo2pdf.php index 2b0bcca8f..9455be749 100644 --- a/include/xslfo2pdf/xslfo2pdf.php +++ b/include/xslfo2pdf/xslfo2pdf.php @@ -55,8 +55,20 @@ class XslFo2PDF { echo "Didn't find root node
"; return false; } - - $pdf = new MyPDF(); + + // oesi - Format und orientation auslesen + $masterpage = $rootNode->getElementsByTagName('simple-page-master'); + $format = 'A4'; + $orient = 'P'; + foreach ($masterpage as $x=>$mp) + { + if($mp->getAttribute('format')!='') + $format = $mp->getAttribute('format'); + if($mp->getAttribute('orientation')!='') + $orient = $mp->getAttribute('orientation'); + } + + $pdf = new MyPDF($orient, 'mm', $format); $root = new FO_Root($pdf); $this->initDefaults($pdf, $root); if ($root->parse($rootNode) === false) {