AbstractPdfCreator
in package
Class AbstractPdfCreator.
PdfCreator was moved into it's own bundle (heimrichhannot/pdf-creator)
Table of Contents
Constants
- FONT_STYLE_BOLD = 'bold'
- FONT_STYLE_BOLDITALIC = 'bolditalic'
- FONT_STYLE_ITALIC = 'italic'
- FONT_STYLE_REGUALAR = 'regular'
- ORIENTATION_LANDSCAPE = 'landscape'
- ORIENTATION_PORTRAIT = 'portrait'
- OUTPUT_MODE_DOWNLOAD = 'download'
- OUTPUT_MODE_FILE = 'file'
- OUTPUT_MODE_INLINE = 'inline'
- OUTPUT_MODE_STRING = 'string'
- OUTPUT_MODES = [self::OUTPUT_MODE_DOWNLOAD, self::OUTPUT_MODE_FILE, self::OUTPUT_MODE_INLINE, self::OUTPUT_MODE_STRING]
Properties
- $beforeCreateInstanceCallback : callable|null
- $beforeOutputPdfCallback : callable|null
- $filename : string|null
- $folder : string|null
- $fonts : array<string|int, mixed>|null
- $format : array<string|int, mixed>|string|null
- $htmlContent : string|null
- $margins : array<string|int, mixed>|null
- $mediaType : string|null
- $orientation : string|null
- $outputMode : string|null
- $templateFilePath : string|null
Methods
- addFont() : $this
- getBeforeCreateInstanceCallback() : callable|null
- getBeforeOutputPdfCallback() : callable|null
- getFilename() : string
- getFolder() : string|null
- getFonts() : array<string|int, mixed>|null
- getFormat() : string|null
- getHtmlContent() : mixed
- getMargins() : array<string|int, mixed>|null
- getMediaType() : string|null
- getOrientation() : string|null
- getOutputMode() : string
- getSupportedOutputModes() : array<string|int, mixed>
- getTemplateFilePath() : string|null
- getType() : string
- Return an unique type alias.
- render() : void
- setBeforeCreateInstanceCallback() : self
- Add an callback to modify constructor parameters for pdf library.
- setBeforeOutputPdfCallback() : self
- Add an callback to modify the configuration or parameters before outputting the pdf file.
- setFilename() : self
- setFolder() : self
- Absolute folder where to store pdf.
- setFonts() : self
- setFormat() : $this
- Set the document format.
- setHtmlContent() : self
- setMargins() : self
- Set document margins.
- setMediaType() : self
- setOrientation() : self
- Set orientation. Use AbstractPdfCreator::ORIENTATION_LANDSCAPE or AbstractPdfCreator::ORIENTATION_PORTRAIT.
- setOutputMode() : self
- setTemplateFilePath() : self
- Set the absolute path to a pdf template file.
Constants
FONT_STYLE_BOLD
public
mixed
FONT_STYLE_BOLD
= 'bold'
FONT_STYLE_BOLDITALIC
public
mixed
FONT_STYLE_BOLDITALIC
= 'bolditalic'
FONT_STYLE_ITALIC
public
mixed
FONT_STYLE_ITALIC
= 'italic'
FONT_STYLE_REGUALAR
public
mixed
FONT_STYLE_REGUALAR
= 'regular'
ORIENTATION_LANDSCAPE
public
mixed
ORIENTATION_LANDSCAPE
= 'landscape'
ORIENTATION_PORTRAIT
public
mixed
ORIENTATION_PORTRAIT
= 'portrait'
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_MODE_STRING
public
mixed
OUTPUT_MODE_STRING
= 'string'
OUTPUT_MODES
public
mixed
OUTPUT_MODES
= [self::OUTPUT_MODE_DOWNLOAD, self::OUTPUT_MODE_FILE, self::OUTPUT_MODE_INLINE, self::OUTPUT_MODE_STRING]
Properties
$beforeCreateInstanceCallback
protected
callable|null
$beforeCreateInstanceCallback
$beforeOutputPdfCallback
protected
callable|null
$beforeOutputPdfCallback
$filename
protected
string|null
$filename
$folder
protected
string|null
$folder
$fonts
protected
array<string|int, mixed>|null
$fonts
$format
protected
array<string|int, mixed>|string|null
$format
$htmlContent
protected
string|null
$htmlContent
$margins
protected
array<string|int, mixed>|null
$margins
$mediaType
protected
string|null
$mediaType
$orientation
protected
string|null
$orientation
$outputMode
protected
string|null
$outputMode
$templateFilePath
protected
string|null
$templateFilePath
Methods
addFont()
public
addFont(string $filepath, string $family, string $style, string $weight) : $this
Parameters
- $filepath : string
-
Absolute filepath to the font file
- $family : string
-
Font family name
- $style : string
-
Font style (regular, italic, ...), see AbstractPdfCreator::FONT_STYLE constants
- $weight : string
-
Font weight
Return values
$thisgetBeforeCreateInstanceCallback()
public
getBeforeCreateInstanceCallback() : callable|null
Return values
callable|nullgetBeforeOutputPdfCallback()
public
getBeforeOutputPdfCallback() : callable|null
Return values
callable|nullgetFilename()
public
getFilename() : string
Return values
stringgetFolder()
public
getFolder() : string|null
Return values
string|nullgetFonts()
public
getFonts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetFormat()
public
getFormat() : string|null
Return values
string|nullgetHtmlContent()
public
getHtmlContent() : mixed
getMargins()
public
getMargins() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetMediaType()
public
getMediaType() : string|null
Return values
string|nullgetOrientation()
public
getOrientation() : string|null
Return values
string|nullgetOutputMode()
public
getOutputMode() : string
Return values
stringgetSupportedOutputModes()
public
abstract getSupportedOutputModes() : array<string|int, mixed>
Return values
array<string|int, mixed>getTemplateFilePath()
public
getTemplateFilePath() : string|null
Return values
string|nullgetType()
Return an unique type alias.
public
abstract static getType() : string
Return values
stringrender()
public
abstract render() : void
setBeforeCreateInstanceCallback()
Add an callback to modify constructor parameters for pdf library.
public
setBeforeCreateInstanceCallback(callable|null $beforeCreateInstanceCallback) : self
Callback gets an BeforeCreateLibraryInstanceCallback object as parameter and should return an BeforeCreateLibraryInstanceCallback object.
Parameters
- $beforeCreateInstanceCallback : callable|null
Return values
selfsetBeforeOutputPdfCallback()
Add an callback to modify the configuration or parameters before outputting the pdf file.
public
setBeforeOutputPdfCallback(callable|null $beforeOutputPdfCallback) : self
Callback gets an BeforeOutputPdfCallback object as parameter and should return an BeforeOutputPdfCallback object.
Parameters
- $beforeOutputPdfCallback : callable|null
Return values
selfsetFilename()
public
setFilename(string $filename) : self
Parameters
- $filename : string
Return values
selfsetFolder()
Absolute folder where to store pdf.
public
setFolder(string $folder) : self
Parameters
- $folder : string
Return values
selfsetFonts()
public
setFonts(array<string|int, mixed> $fonts) : self
Parameters
- $fonts : array<string|int, mixed>
Return values
selfsetFormat()
Set the document format.
public
setFormat(string|array<string|int, mixed> $format) : $this
Parameters
- $format : string|array<string|int, mixed>
-
A format type like A4, A5, Letter, Legal,... or an array of integers (width and height in mm).
Return values
$thissetHtmlContent()
public
setHtmlContent(mixed $htmlContent) : self
Parameters
- $htmlContent : mixed
Return values
selfsetMargins()
Set document margins.
public
setMargins(int|null $top[, int|null $right = null ][, int|null $bottom = null ][, int|null $left = null ]) : self
Parameters
- $top : int|null
- $right : int|null = null
- $bottom : int|null = null
- $left : int|null = null
Return values
selfsetMediaType()
public
setMediaType(string|null $mediaType) : self
Parameters
- $mediaType : string|null
Return values
selfsetOrientation()
Set orientation. Use AbstractPdfCreator::ORIENTATION_LANDSCAPE or AbstractPdfCreator::ORIENTATION_PORTRAIT.
public
setOrientation(string $orientation) : self
Parameters
- $orientation : string
Return values
selfsetOutputMode()
public
setOutputMode(string $outputMode) : self
Parameters
- $outputMode : string
Return values
selfsetTemplateFilePath()
Set the absolute path to a pdf template file.
public
setTemplateFilePath(string|null $templateFilePath) : self
Parameters
- $templateFilePath : string|null