Documentation

Base
in package

Abstract driver class for pdf generation.

Table of Contents

DRIVER_NAME  = self::DRIVER_NAME
WATERMARK_TYPE_IMAGE  = 1
WATERMARK_TYPE_TEXT  = 0
$defaultMargins  : array<string|int, mixed>
$body  : string
$charset  : string
$fileName  : string
$font  : string
$fontSize  : mixed
$footer  : string
$footerMargin  : int
$header  : string
$headerMargin  : int
$pdf  : object
$template  : Vtiger_PDF_Model
$watermark  : string
getBody()  : string
Get HTML body content.
getFileName()  : string
Get pdf filename.
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.

Constants

DRIVER_NAME

public string DRIVER_NAME = self::DRIVER_NAME

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

Default font.

$fontSize

protected mixed $fontSize

Default font size.

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.

$pdf

protected object $pdf

PDF generator instance.

$template

protected Vtiger_PDF_Model $template

PDF model instance.

$watermark

protected string $watermark

HTML watermark.

Methods

getBody()

Get HTML body content.

public getBody() : string
Return values
string

getFileName()

Get pdf filename.

public getFileName() : 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 abstract static isActive() : bool
Return values
bool

loadTemplateData()

Load template data to PDF instance.

public loadTemplateData() : void
Return values
void

loadWatermark()

Load watermark.

public abstract loadWatermark() : $this
Return values
$this

output()

Output content to PDF.

public abstract output([string $filePath = '' ][, string $mode = 'D' ]) : void
Parameters
$filePath : string = ''

Path name for saving pdf file

$mode : string = '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 abstract 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 abstract setBottomMargin(float $margin) : $this
Parameters
$margin : float
Return values
$this

setCreator()

Set Title of the document.

public abstract 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 abstract setFooter(string $footerHtml) : $this
Parameters
$footerHtml : string
Return values
$this

setFooterMargin()

Set footer margin.

public abstract setFooterMargin(float $margin) : $this
Parameters
$margin : float
Return values
$this

setHeader()

Set header content.

public abstract setHeader(string $headerHtml) : $this
Parameters
$headerHtml : string
Return values
$this

setHeaderMargin()

Set header margin.

public abstract 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 abstract setKeywords(array<string|int, string> $keywords) : $this
Parameters
$keywords : array<string|int, string>
Return values
$this

setLeftMargin()

Set left margin.

public abstract setLeftMargin(float $margin) : $this
Parameters
$margin : float
Return values
$this

setMargins()

Set document margins.

public abstract 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 abstract setPageSize(string $format[, string $orientation = null ]) : $this
Parameters
$format : string
$orientation : string = null
Return values
$this

setRightMargin()

Set right margin.

public abstract setRightMargin(float $margin) : $this
Parameters
$margin : float
Return values
$this

setSubject()

Set Title of the document.

public abstract 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 abstract setTitle(string $title) : $this
Parameters
$title : string
Return values
$this

setTopMargin()

Set top margin.

public abstract setTopMargin(float $margin) : $this
Parameters
$margin : float
Return values
$this

        

Search results