Documentation

YetiForcePDF extends PDF
in package

YetiForcePDF class.

Table of Contents

WATERMARK_TYPE_IMAGE  = 1
WATERMARK_TYPE_TEXT  = 0
$defaultMargins  : array<string|int, mixed>
Default margins.
$format  : string
Page format.
$html  : string
HTML content.
$orientation  : string
$charset  : string
Charset.
$defaultFontFamily  : string
Default font.
$defaultFontSize  : int
Default font size.
$fileName  : mixed
$footer  : string
$footerMargin  : int
$footerYetiForce  : string
$header  : string
$headerMargin  : int
$library  : mixed
$moduleModel  : Vtiger_Module_Model
$params  : array<string|int, mixed>
Additional params.
$pdf  : mixed
$watermark  : string
__construct()  : mixed
Constructor.
export()  : mixed
Export record to PDF file.
getFileName()  : string
Get pdf filename.
getFooterMargin()  : mixed
Gets footer margin.
getHeaderMargin()  : mixed
Gets header margin.
getHtml()  : string
Gets full html.
getInputCharset()  : string
Get input charset.
getPdf()  : mixed
Returns pdf library object.
getTemplateWatermark()  : string
Get template watermark.
loadHTML()  : $this
Load HTML content for exporting to PDF.
loadHtml()  : mixed
{@inheritdoc}
output()  : mixed
Output content to PDF.
parseParams()  : $this
Parse and set options.
setAuthor()  : $this
Set Title of the document.
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.
setTitle()  : $this
Set Title of the document.
setTopMargin()  : $this
Set top margin.
setWatermark()  : $this
Set watermark.
wrapFooterContent()  : string
Wrap footer content.
wrapHeaderContent()  : string
Wrap header content.
wrapWatermark()  : string
Wrap watermark.
writeHTML()  : $this
Write html.
loadCustomFonts()  : $this
Load custom fonts.

Constants

WATERMARK_TYPE_IMAGE

public mixed WATERMARK_TYPE_IMAGE = 1

WATERMARK_TYPE_TEXT

public mixed WATERMARK_TYPE_TEXT = 0

Properties

$defaultMargins

Default margins.

public array<string|int, mixed> $defaultMargins = ['left' => 30, 'right' => 30, 'top' => 40, 'bottom' => 40, 'header' => 10, 'footer' => 10]

$defaultFontFamily

Default font.

protected string $defaultFontFamily = 'DejaVu Sans'

$defaultFontSize

Default font size.

protected int $defaultFontSize = 10

$fileName

protected mixed $fileName

$library

protected mixed $library

$moduleModel

protected Vtiger_Module_Model $moduleModel

$params

Additional params.

protected array<string|int, mixed> $params = []

$pdf

protected mixed $pdf

Methods

__construct()

Constructor.

public __construct() : mixed
Return values
mixed

export()

Export record to PDF file.

public export(int $recordId, int $templateId[, string $filePath = '' ][, string $saveFlag = '' ]) : mixed
Parameters
$recordId : int
  • record ID
$templateId : int
  • id of pdf template
$filePath : string = ''
  • path name for saving pdf file
$saveFlag : string = ''
  • save option flag
Return values
mixed

getFileName()

Get pdf filename.

public getFileName() : string
Return values
string

getFooterMargin()

Gets footer margin.

public getFooterMargin() : mixed
Return values
mixed

getHeaderMargin()

Gets header margin.

public getHeaderMargin() : mixed
Return values
mixed

getHtml()

Gets full html.

public getHtml() : string
Return values
string

getInputCharset()

Get input charset.

public getInputCharset() : string
Return values
string

getPdf()

Returns pdf library object.

public getPdf() : mixed
Return values
mixed

getTemplateWatermark()

Get template watermark.

public getTemplateWatermark(Vtiger_PDF_Model $templateModel) : string
Parameters
$templateModel : Vtiger_PDF_Model
Return values
string

loadHTML()

Load HTML content for exporting to PDF.

public abstract loadHTML(string $html) : $this
Parameters
$html : string
Return values
$this

loadHtml()

{@inheritdoc}

public loadHtml(string $html) : mixed
Parameters
$html : string
Return values
mixed

output()

Output content to PDF.

public output([string $fileName = '' ][, string $dest = '' ]) : mixed
Parameters
$fileName : string = ''
$dest : string = ''
Return values
mixed

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

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, int $size) : $this
Parameters
$family : string
$size : int
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

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

setWatermark()

Set watermark.

public setWatermark(string $watermark) : $this
Parameters
$watermark : string
Return values
$this

wrapFooterContent()

Wrap footer content.

public wrapFooterContent(string $footerContent) : string
Parameters
$footerContent : string
Return values
string

wrapHeaderContent()

Wrap header content.

public wrapHeaderContent(string $headerContent) : string
Parameters
$headerContent : 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
Return values
$this

        

Search results