FPDIWriter
extends AbstractPdfWriter
in package
Class AbstractPdfWriter.
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 : Fpdi
- Current fpdi instance.
- $template : string
- Master pdf template.
Methods
- __construct() : mixed
- TCPDFWriter constructor.
- addFont() : mixed
- 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() : Fpdi
- Get current pdf object.
- getTemplate() : string
- Get the master template path.
- isPrepared() : bool
- Check if prepare was already triggered.
- mergeConfig() : PdfWriter
- Merge current pdf config with given.
- prepare() : Fpdi
- Prepare the current fpdi 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.
- setTemplate() : PdfWriter
- Set the master template path.
Constants
OUTPUT_MODE_DOWNLOAD
public
mixed
OUTPUT_MODE_DOWNLOAD
= 'download'
OUTPUT_MODE_FILE
public
mixed
OUTPUT_MODE_FILE
= 'file'
OUTPUT_MODE_INLINE
public
mixed
OUTPUT_MODE_INLINE
= 'inline'
OUTPUT_MODES
public
mixed
OUTPUT_MODES
= [self::OUTPUT_MODE_DOWNLOAD, self::OUTPUT_MODE_FILE, self::OUTPUT_MODE_INLINE]
Properties
$config
Pdf configuration.
protected
array<string|int, mixed>
$config
= []
$fileName
Pdf file name.
protected
string
$fileName
$folder
The folder in case of saving to file.
protected
string
$folder
$html
Pdf html content including styles.
protected
string
$html
$isPrepared
protected
bool
$isPrepared
= false
Current fpdi instance.
protected
Fpdi
$pdf
$template
Master pdf template.
protected
string
$template
Methods
__construct()
TCPDFWriter constructor.
public
__construct() : mixed
addFont()
public
addFont(mixed $family, mixed $weight, mixed $filename) : mixed
Parameters
- $family : mixed
- $weight : mixed
- $filename : mixed
-
string The absolute filename including path
generate()
Generate the pdf.
public
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
stringgetFolder()
public
getFolder() : string
Return values
stringgetHtml()
Get html including styles.
public
getHtml() : string
Return values
stringgetPdf()
Get current pdf object.
public
getPdf([bool $init = false ]) : Fpdi
Parameters
- $init : bool = false
-
Set true if you want to create a new pdf regardless there is always an existing pdf
Tags
Return values
FpdigetTemplate()
Get the master template path.
public
getTemplate() : string
Return values
stringisPrepared()
Check if prepare was already triggered.
public
isPrepared() : bool
Return values
boolmergeConfig()
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
prepare()
Prepare the current fpdi object.
public
prepare() : Fpdi
Return values
FpdisetConfig()
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
setDefaultConfig()
public
setDefaultConfig() : mixed
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
setHtml()
Set html including styles.
public
setHtml(string $html) : PdfWriter
Parameters
- $html : string
Return values
PdfWritersetTemplate()
Set the master template path.
public
setTemplate(string $template) : PdfWriter
Parameters
- $template : string
Return values
PdfWriter —Current pdf writer instance