YetiForcePDF
extends Base
in package
YetiForcePDF driver class for PDF generation.
Table of Contents
- DRIVER_NAME = 'LBL_YETIFORCE_PDF'
- WATERMARK_TYPE_IMAGE = 1
- WATERMARK_TYPE_TEXT = 0
- $defaultMargins : array<string|int, mixed>
- $body : string
- $charset : string
- $fileName : string
- $font : string
- $fontSize : int
- $footer : string
- $footerMargin : int
- $header : string
- $headerMargin : int
- $pdf : Document
- $template : Vtiger_PDF_Model
- $watermark : string
- __construct() : mixed
- Constructor.
- getBody() : string
- Get HTML body content.
- getFileName() : string
- Get pdf filename.
- getHtml() : string
- Gets full html.
- getInputCharset() : string
- Get input charset.
- getTemplate() : Vtiger_PDF_Model
- Get PDF template model.
- isActive() : bool
- Check if the driver is active.
- loadTemplateData() : void
- Load template data to PDF instance.
- loadWatermark() : $this
- Load watermark.
- output() : void
- Output content to PDF.
- parseParams() : $this
- Parse and set options.
- setAuthor() : $this
- Set Title of the document.
- setBody() : $this
- Set HTML body content for exporting to PDF.
- setBottomMargin() : $this
- Set bottom margin.
- setCreator() : $this
- Set Title of the document.
- setFileName() : $this
- Set pdf filename.
- setFont() : $this
- Set font.
- setFooter() : $this
- Set footer content.
- setFooterMargin() : $this
- Set footer margin.
- setHeader() : $this
- Set header content.
- setHeaderMargin() : $this
- Set header margin.
- setInputCharset() : $this
- Set input charset.
- setKeywords() : $this
- Set Title of the document.
- setLeftMargin() : $this
- Set left margin.
- setMargins() : $this
- Set document margins.
- setPageSize() : $this
- Set page size and orientation.
- setRightMargin() : $this
- Set right margin.
- setSubject() : $this
- Set Title of the document.
- setTemplate() : $this
- Set PDF template model.
- setTitle() : $this
- Set Title of the document.
- setTopMargin() : $this
- Set top margin.
- wrapFooterContent() : string
- Wrap footer content.
- wrapHeaderContent() : string
- Wrap header content.
- wrapWatermark() : string
- Wrap watermark.
- writeHTML() : $this
- Write html.
- loadCustomFonts() : $this
- Load custom fonts.
Constants
DRIVER_NAME
public
string
DRIVER_NAME
= 'LBL_YETIFORCE_PDF'
Driver name
WATERMARK_TYPE_IMAGE
public
string
WATERMARK_TYPE_IMAGE
= 1
Watermark image type
WATERMARK_TYPE_TEXT
public
string
WATERMARK_TYPE_TEXT
= 0
Watermark text type
Properties
$defaultMargins
public
array<string|int, mixed>
$defaultMargins
= ['left' => 30, 'right' => 30, 'top' => 40, 'bottom' => 40, 'header' => 10, 'footer' => 10]
Default margins in mm.
$body
protected
string
$body
HTML body.
$charset
protected
string
$charset
Charset.
$fileName
protected
string
$fileName
File name.
$font
protected
string
$font
= 'DejaVu Sans'
Default font.
$fontSize
protected
int
$fontSize
= 10
Default font size
$footer
protected
string
$footer
HTML footer.
$footerMargin
protected
int
$footerMargin
= 10
Footer margin .
$header
protected
string
$header
HTML header.
$headerMargin
protected
int
$headerMargin
= 10
Header margin.
protected
Document
$pdf
PDF generator instance.
$template
protected
Vtiger_PDF_Model
$template
PDF model instance.
$watermark
protected
string
$watermark
HTML watermark.
Methods
__construct()
Constructor.
public
__construct() : mixed
Return values
mixed —getBody()
Get HTML body content.
public
getBody() : string
Return values
string —getFileName()
Get pdf filename.
public
getFileName() : string
Return values
string —getHtml()
Gets full html.
public
getHtml() : string
Return values
string —getInputCharset()
Get input charset.
public
getInputCharset() : string
Return values
string —getTemplate()
Get PDF template model.
public
getTemplate() : Vtiger_PDF_Model
Return values
Vtiger_PDF_Model —isActive()
Check if the driver is active.
public
static isActive() : bool
Return values
bool —loadTemplateData()
Load template data to PDF instance.
public
loadTemplateData() : void
Return values
void —loadWatermark()
Load watermark.
public
loadWatermark() : $this
Return values
$this —output()
Output content to PDF.
public
output([mixed $fileName = '' ][, mixed $mode = 'D' ]) : void
Parameters
- $fileName : mixed = ''
- $mode : mixed = 'D'
-
Output mode, default:
D
,I
= show in browser ,D
= download ,F
= save to file
Return values
void —parseParams()
Parse and set options.
public
parseParams(array<string|int, mixed> $params) : $this
Parameters
- $params : array<string|int, mixed>
Return values
$this —setAuthor()
Set Title of the document.
public
setAuthor(string $author) : $this
Parameters
- $author : string
Return values
$this —setBody()
Set HTML body content for exporting to PDF.
public
setBody(string $html) : $this
Parameters
- $html : string
Return values
$this —setBottomMargin()
Set bottom margin.
public
setBottomMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —setCreator()
Set Title of the document.
public
setCreator(string $creator) : $this
Parameters
- $creator : string
Return values
$this —setFileName()
Set pdf filename.
public
setFileName(string $fileName) : $this
Parameters
- $fileName : string
Return values
$this —setFont()
Set font.
public
setFont(string $family, mixed $size) : $this
Parameters
- $family : string
- $size : mixed
Return values
$this —setFooter()
Set footer content.
public
setFooter(string $footerHtml) : $this
Parameters
- $footerHtml : string
Return values
$this —setFooterMargin()
Set footer margin.
public
setFooterMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —setHeader()
Set header content.
public
setHeader(string $headerHtml) : $this
Parameters
- $headerHtml : string
Return values
$this —setHeaderMargin()
Set header margin.
public
setHeaderMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —setInputCharset()
Set input charset.
public
setInputCharset(string $charset) : $this
Parameters
- $charset : string
Return values
$this —setKeywords()
Set Title of the document.
public
setKeywords(array<string|int, mixed> $keywords) : $this
Parameters
- $keywords : array<string|int, mixed>
Return values
$this —setLeftMargin()
Set left margin.
public
setLeftMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —setMargins()
Set document margins.
public
setMargins(array<string|int, mixed> $margins) : $this
Parameters
- $margins : array<string|int, mixed>
-
['top'=>40,'bottom'=>40,'left'=>30,'right'=>30,'header'=>10,'footer'=>10]
Return values
$this —setPageSize()
Set page size and orientation.
public
setPageSize(string $format[, string $orientation = null ]) : $this
Parameters
- $format : string
- $orientation : string = null
Return values
$this —setRightMargin()
Set right margin.
public
setRightMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —setSubject()
Set Title of the document.
public
setSubject(string $subject) : $this
Parameters
- $subject : string
Return values
$this —setTemplate()
Set PDF template model.
public
setTemplate(Vtiger_PDF_Model $template) : $this
Parameters
- $template : Vtiger_PDF_Model
Return values
$this —setTitle()
Set Title of the document.
public
setTitle(string $title) : $this
Parameters
- $title : string
Return values
$this —setTopMargin()
Set top margin.
public
setTopMargin(float $margin) : $this
Parameters
- $margin : float
Return values
$this —wrapFooterContent()
Wrap footer content.
public
wrapFooterContent(string $content) : string
Parameters
- $content : string
Return values
string —wrapHeaderContent()
Wrap header content.
public
wrapHeaderContent(string $content) : string
Parameters
- $content : string
Return values
string —wrapWatermark()
Wrap watermark.
public
wrapWatermark(string $watermarkContent) : string
Parameters
- $watermarkContent : string
Return values
string —writeHTML()
Write html.
public
writeHTML() : $this
Return values
$this —loadCustomFonts()
Load custom fonts.
private
loadCustomFonts() : $this