Contao Utils Bundle

AbstractPdfWriter
in package

AbstractYes

Class AbstractPdfWriter.

Use PdfCreator instead

Table of Contents

Constants

OUTPUT_MODE_DOWNLOAD  = 'download'
OUTPUT_MODE_FILE  = 'file'
OUTPUT_MODE_INLINE  = 'inline'
OUTPUT_MODES  = [self::OUTPUT_MODE_DOWNLOAD, self::OUTPUT_MODE_FILE, self::OUTPUT_MODE_INLINE]

Properties

$config  : array<string|int, mixed>
Pdf configuration.
$fileName  : string
Pdf file name.
$folder  : string
The folder in case of saving to file.
$html  : string
Pdf html content including styles.
$isPrepared  : bool
$pdf  : mixed

Methods

__construct()  : mixed
constructor.
generate()  : void
Generate the pdf.
getConfig()  : array<string|int, mixed>
Get the pdf config.
getFileName()  : string
Get the pdf file name.
getFolder()  : string
getHtml()  : string
Get html including styles.
getPdf()  : mixed
Get current pdf object.
isPrepared()  : bool
Check if prepare was already triggered.
mergeConfig()  : PdfWriter
Merge current pdf config with given.
prepare()  : mixed
Prepare the current object.
setConfig()  : PdfWriter
Set pdf config, replace default with custom config.
setDefaultConfig()  : mixed
setFileName()  : PdfWriter
Set the pdf filename.
setFolder()  : void
setHtml()  : PdfWriter
Set html including styles.

Constants

OUTPUT_MODES

public mixed OUTPUT_MODES = [self::OUTPUT_MODE_DOWNLOAD, self::OUTPUT_MODE_FILE, self::OUTPUT_MODE_INLINE]

Properties

Methods

generate()

Generate the pdf.

public abstract generate([string $mode = self::OUTPUT_MODE_DOWNLOAD ]) : void
Parameters
$mode : string = self::OUTPUT_MODE_DOWNLOAD

getConfig()

Get the pdf config.

public getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFileName()

Get the pdf file name.

public getFileName() : string
Return values
string

getHtml()

Get html including styles.

public getHtml() : string
Return values
string

getPdf()

Get current pdf object.

public abstract getPdf([bool $init = false ]) : mixed
Parameters
$init : bool = false

Set true if you want to create a new pdf regardless there is always an existing pdf

isPrepared()

Check if prepare was already triggered.

public isPrepared() : bool
Return values
bool

mergeConfig()

Merge current pdf config with given.

public mergeConfig(array<string|int, mixed> $config) : PdfWriter
Parameters
$config : array<string|int, mixed>
Return values
PdfWriter

Current pdf writer instance

setConfig()

Set pdf config, replace default with custom config.

public setConfig(array<string|int, mixed> $config) : PdfWriter
Parameters
$config : array<string|int, mixed>
Return values
PdfWriter

Current pdf writer instance

setFileName()

Set the pdf filename.

public setFileName(string $fileName) : PdfWriter
Parameters
$fileName : string
Return values
PdfWriter

Current pdf writer instance

setFolder()

public setFolder(string $folder) : void
Parameters
$folder : string

        
On this page

Search results