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_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
protected
mixed
$pdf
The pdf object
Methods
__construct()
constructor.
public
__construct() : mixed
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
stringgetFolder()
public
getFolder() : string
Return values
stringgetHtml()
Get html including styles.
public
getHtml() : string
Return values
stringgetPdf()
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
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 object.
public
prepare() : mixed
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
setDefaultConfig()
public
abstract 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