-
Notifications
You must be signed in to change notification settings - Fork 6
Class ZugferdVisualizer
Class representing the main visualizer class
Factory for creating a visualizer by a ZugferdDocumentReader
public static function fromDocumentReader(
horstoeko\zugferd\ZugferdDocumentReader $documentReader,
?horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract $renderer = null,
): \ZugferdVisualizer
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
documentReader | horstoeko\zugferd\ZugferdDocumentReader | ❌ | |
renderer | horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract | ✔️ |
Returns a value of type \ZugferdVisualizer
Factory for creating a visualizer by a ZugferdDocumentReader
public static function fromDocumentBuilder(
horstoeko\zugferd\ZugferdDocumentBuilder $documentBuilder,
?horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract $renderer = null,
): \ZugferdVisualizer
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
documentBuilder | horstoeko\zugferd\ZugferdDocumentBuilder | ❌ | |
renderer | horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract | ✔️ |
Returns a value of type \ZugferdVisualizer
Caution
Deprecated v2.0.0 Direct call of constructor will be removed in the future. Use static factory methods instead
Constructor
public function __construct(
horstoeko\zugferd\ZugferdDocumentReader $documentReader,
?horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract $renderer = null,
): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
documentReader | horstoeko\zugferd\ZugferdDocumentReader | ❌ | |
renderer | horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract | ✔️ |
Setup the renderer to use for generating markup
public function setRenderer(
horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract $renderer,
): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
renderer | horstoeko\zugferdvisualizer\contracts\ZugferdVisualizerMarkupRendererContract | ❌ |
Set the template to use in the specified renderer
public function setTemplate(string $template): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
template | string | ❌ |
Sets the built-in template (and switch the markup-rendering engine to the default renderer)
public function setDefaultTemplate(): void
{
}
Add an additional directory where the PDF-Engine will
search for fonts
public function addPdfFontDirectory(string $directory): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
directory | string | ❌ |
Add a font definition
- Example 1: $visualizer->addPdfFont('frutiger', 'R', 'Frutiger-Normal.ttf')
- Example 2: $visualizer->addPdfFont('frutiger', 'I', 'FrutigerObl-Normal.ttf')
public function addPdfFontData(string $name, string $style, string $filename): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
name | string | ❌ | |
style | string | ❌ | |
filename | string | ❌ |
Sets the default PDF default font
public function setPdfFontDefault(string $pdfFontDefault): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
pdfFontDefault | string | ❌ |
Sets the PDF papersize
public function setPdfPaperSize(string $pdfPaperSize): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
pdfPaperSize | string | ❌ |
Set the callback which is called before the internal instance
of the PDF-Engine is instanciated
public function setPdfPreInitCallback(callable $callback): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
callback | callable | ❌ |
Set the callback which is called after the internal instance
of the PDF-Engine is instanciated
public function setPdfRuntimeInitCallback(callable $callback): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
callback | callable | ❌ |
Renders the markup (HTML)
public function renderMarkup(): string
{
}
Returns a value of type string
Renders the PDF by markup (HTML) and returns the PDF as a string
public function renderPdf(): string
{
}
Returns a value of type string
Renders the PDF by markup (HTML) to a physical file
public function renderPdfFile(string $toFilename): void
{
}
Name | Type | Allows Null | Description |
---|---|---|---|
toFilename | string | ❌ |
(c) HorstOeko 2024..