13 if (!class_exists(
'FPDI')) {
14 throw new \wcmf\lib\config\ConfigurationException(
15 'wcmf\lib\pdf\PDF requires '.
16 'FPDI. If you are using composer, add setasign/fpdi '.
17 'as dependency to your project');
27 class PDF extends FPDI {
37 $this->useTemplate($this->tpl);
44 $this->_pageStarted =
true;
45 $this->_pageEnded =
false;
52 $this->_pageEnded =
true;
53 $this->_pageStarted =
false;
77 $this->SetY($units+$this->GetY());
85 $this->SetX($units+$this->GetX());
96 $lines = preg_split(
'/\n/', $text);
97 foreach ($lines as $line) {
98 $nbLines += $this->
NbLines($width, $line);
114 if($this->GetY()+$h>$this->PageBreakTrigger) {
115 $this->AddPage($this->CurOrientation);
127 $cw=&$this->CurrentFont[
'cw'];
129 $w=$this->w-$this->rMargin-$this->x;
131 $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
132 $s=str_replace(
"\r",
'',$txt);
134 if($nb>0 && $s[$nb-1]==
"\n") {
numberOfLines($width, $text)
Computes the number of lines a MultiCell of width w will take instead of NbLines it correctly handles...
moveRight($units)
Move the render position right by given units.
isPageEnded()
Determine if a page finished.
PDF related interfaces and classes.
CheckPageBreak($h)
The following code is taken from FPDF Add-On 'Table with MultiCells'.
startPage()
Call this method when rendering a new page.
Header()
Overriden to set the template on the page.
isPageStarted()
Determine if a new page started.
endPage()
Call this method when rendering a page finished.
NbLines($w, $txt)
Computes the number of lines a MultiCell of width w will take.
moveDown($units)
Move the render position down by given units.