File modules/cms/generator/dsl/DslPdf.class.php

Last commit: Fri Feb 17 02:02:18 2023 +0100	Jan Dankert	Refactoring: Script-context should be the same in all environments; New: DslPdf for creating PDF with scriptbox ;)
1 <?php 2 3 namespace cms\generator\dsl; 4 5 use cms\model\Template; 6 use dsl\context\BaseScriptableObject; 7 use wikiparser\renderer\fpdf\Pdf; 8 9 class DslPdf extends BaseScriptableObject { 10 11 /** 12 * @var Pdf 13 */ 14 private $pdf; 15 16 /** 17 * @param Template $template 18 */ 19 public function __construct() 20 { 21 $this->pdf = new Pdf(); 22 } 23 24 public function getOutput() { 25 return $this->pdf->Output(); 26 } 27 28 public function addPage($orientation='', $size='', $rotation=0) { 29 $this->pdf->AddPage($orientation, $size, $rotation); 30 } 31 public function setAuthor( $author ) { 32 $this->pdf->SetAuthor( $author ); 33 } 34 public function setSubject( $author ) { 35 36 $this->pdf->SetSubject( $author ); 37 } 38 39 public function setCreator( $author ) { 40 41 $this->pdf->SetCreator( $author ); 42 } 43 44 public function setTextColor( $r,$g,$b ) { 45 46 $this->pdf->SetTextColor( $r,$g,$b ); 47 } 48 49 public function setTitle( $title ) { 50 51 $this->pdf->SetTitle( $title, true ); 52 } 53 54 public function addText( $text ) { 55 56 $this->pdf->Write( 5,$text ); 57 } 58 59 }
Download modules/cms/generator/dsl/DslPdf.class.php
History Fri, 17 Feb 2023 02:02:18 +0100 Jan Dankert Refactoring: Script-context should be the same in all environments; New: DslPdf for creating PDF with scriptbox ;)