This commit is contained in:
Andreas Österreicher
2007-07-11 15:12:13 +00:00
parent 35fca963e4
commit 3d39cf396d
2 changed files with 38 additions and 2 deletions
+24
View File
@@ -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
**/
+14 -2
View File
@@ -55,8 +55,20 @@ class XslFo2PDF {
echo "Didn't find root node<br>";
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) {