### image.processingInstructions TypoScript configuration Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ConfigurationReference/TypoScriptReference/Index.html Example configuration for image.processingInstructions, passed to ImageService->applyProcessingInstructions. Shows width/height constraints and a custom crop variant. ```typoscript processingInstructions { width = height = maxHeight = minWidth = maxWidth = 200 minHeight = crop { custom_crop { cropArea { width = 0.5 height = 0.5 x = 0 y = 0 } } } cropVariant = custom_crop } ``` -------------------------------- ### Advanced usage of pdf:multiColumn with width and padding Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/MultiColumnViewHelper/Index.html Shows two advanced examples. The first uses percentage widths and padding for columns. The second uses absolute width values (in millimeters) without padding. Both examples demonstrate how to customize column widths and padding. ```Fluid Column 1 Column 2 Column 3 ``` ```Fluid Column 1 Column 2 Column 3 ``` -------------------------------- ### php.ini settings for large extension installation Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Troubleshooting/Index.html php.ini configuration to increase memory limit and execution time for installing the pdfviewhelpers extension. ```ini max_execution_time = 300 memory_limit = 512M ``` -------------------------------- ### Advanced usage of DocumentViewHelper with attributes Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/ViewHelpers/DocumentViewHelper/Index.rst.txt Advanced example showing the DocumentViewHelper with all available attributes: title, subject, author, keywords, outputDestination, outputPath, sourceFile, unit, unicode, encoding, and pdfa. The sourceFile points to an example template for extending existing PDFs. ```XML [..] ``` -------------------------------- ### Advanced usage of HeadlineViewHelper with all attributes Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/HeadlineViewHelper/Index.html Advanced example showing all available attributes for fine-grained control over headline rendering, including typography, spacing, hyphenation, padding, width, and table of contents integration. ```XML Title ``` -------------------------------- ### PHP ini settings for large extension installation Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Troubleshooting/Index.html PHP settings to increase memory limit and execution time when installing the large pdfviewhelpers extension via TER. ```php ini_set('max_execution_time', 300); ini_set('memory_limit', '512M'); ``` -------------------------------- ### TypoScript configuration for Header and Footer example Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Examples/HeaderAndFooter/Index.html TypoScript configuration for the Header and Footer example. Sets up a PAGE object with a FLUIDTEMPLATE, disables all header code and other output to ensure a clean PDF, and configures page margins, header/footer positions, and auto page break. The module settings are copied from plugin settings. ```typoscript pdfpage = PAGE pdfpage { 10 = FLUIDTEMPLATE 10 { file = EXT:pdfviewhelpers/Resources/Public/Examples/HeaderAndFooter/Template.html } # ensure there is no other output apart from the pdf # take a look at the generated pdf file (end!) in a text editor to verify there is no other output # like warnings, error messages or html code config { disableAllHeaderCode = 1 xhtml_cleaning = 0 admPanel = 0 } } plugin.tx_pdfviewhelpers.settings { page { autoPageBreak = 1 margin { top = 25 bottom = 25 } } header { posY = 10 } footer { posY = -15 } } module.tx_pdfviewhelpers < plugin.tx_pdfviewhelpers ``` -------------------------------- ### Basic Usage of pdf:list ViewHelper Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/ListViewHelper/Index.html Renders a list from a one-dimensional array. The first example uses an inline array, the second uses a property from the template context. ```fluid ``` -------------------------------- ### Advanced usage of DocumentViewHelper with attributes Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/DocumentViewHelper/Index.html Configure the PDF document with metadata, output destination, source file, and PDF/A compliance. The sourceFile attribute points to an example template in the extension. ```XML [..] ``` -------------------------------- ### AttachPdfViewHelper usage example Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/ViewHelpers/AttachPdfViewHelper/Index.rst.txt Use this ViewHelper inside a pdf:document tag to import all pages of an existing PDF. The path attribute specifies the PDF file, using the EXT: extension syntax. ```XML ``` -------------------------------- ### Attach PDF in Fluid template Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/AttachPdfViewHelper/Index.html Use this Fluid ViewHelper to attach a PDF file. The example shows the ViewHelper call with the file path as an argument. ```html ``` -------------------------------- ### Basic usage of pdf:getPosX and pdf:getPosY Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/GetPosViewHelper/Index.html Use these ViewHelpers inside a pdf:text tag to output the current X and Y coordinates. The example renders a text with the position values embedded. ```Fluid This text will be rendered at position x={pdf:getPosX()} and y={pdf:getPosY()} ``` -------------------------------- ### Fluid template for Full Feature Show Case Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/Examples/FullFeatureShowCase/Index.rst.txt Starts the Fluid template for the PDF, declaring the necessary XML namespaces and opening the pdf:document tag with an overwritten output path and title. ```html ``` -------------------------------- ### PHP: Set up StandaloneView and render PDF Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Examples/StandaloneRendering/Index.html Creates a StandaloneView instance, sets the template path, assigns variables, and renders the PDF. The render() method returns the PDF as a string, which can be saved to the file system. ```php setFormat('html'); $standaloneView->setTemplatePathAndFilename($templatePath); $standaloneView->assignMultiple(['someVariable' => 'someValue']); $pdf = $standaloneView->render(); //return pdf as string, or simply save to file system ``` -------------------------------- ### PDF metadata XML example for validation Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Troubleshooting/Index.html Example of the metadata XML structure inside a PDF file. Used to check for valid PDF/A metadata by validating the XML content. ```xml << /Type /Metadata /Subtype /XML /Length 4505 >> stream ... ``` -------------------------------- ### Basic ImageViewHelper usage with src, width, alignment, link, padding, fitOnPage Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/ImageViewHelper/Index.html Renders an image using the pdf:image ViewHelper. The src argument accepts a TYPO3 path (e.g., EXT:...) or an object implementing TYPO3 FAL FileInterface (e.g., File or FileReference). The examples show various attributes: width (with unit or percentage), alignment, link, padding, and fitOnPage. ```html ``` -------------------------------- ### Basic Usage Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/BookmarkViewHelper/Index.html Shows how to add a custom bookmark using the text attribute or tag content. ```APIDOC ## BookmarkViewHelper ### Description Adds a custom bookmark to the table of contents. ### Usage #### Basic Usage ``` Adding custom bookmark ``` #### Advanced Usage ``` ``` ### Parameters - **text** (string) - Optional - The bookmark text. If not provided, the tag content is used. - **level** (integer) - Optional - The bookmark level (e.g., 1 for top level). - **fontStyle** (string) - Optional - The font style (e.g., "bold"). - **color** (string) - Optional - The color in hex format (e.g., "#ff642c"). ### Notes - TCPDF does not produce valid PDF documents when bookmarks are used, though most viewers can still render them. ``` -------------------------------- ### Basic usage of TextViewHelper Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/TextViewHelper/Index.html Renders text using the default settings. The first line uses the tag content, the second uses the 'text' attribute as an alternative syntax. ```html Title ``` -------------------------------- ### Fluid template for Header and Footer example Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/Examples/HeaderAndFooter/Index.html Fluid template for the Header and Footer example. Defines a PDF document with document-wide header and footer, then demonstrates page-specific overrides using the 'scope' attribute on pdf:header and pdf:footer. Includes a page break to show that page-specific footers only apply to the current page. ```html Bithost GmbH Milchbuckstrasse 83 - 8057 Zürich Page {pdf:getPageNumberAlias()} of {pdf:getTotalNumberOfPagesAlias()} Bithost GmbH Milchbuckstrasse 83 8057 Zürich First page different First page - different header and footer applied. Page 2 - document wide header and footer applied. Change footer only on first page even if page break occurs. Page 3 - document wide header but page specific footer applied. Page 4 - Again document wide header and footer applied. ``` -------------------------------- ### HtmlViewHelper with escaped children (before fix) Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/UpgradeGuides/UpgradingFrom3To4/Index.rst.txt This example shows the previous usage that will break because the HtmlViewHelper now escapes children by default ($escapeChildren = true). ```typo3 fluid {someRichText} ``` -------------------------------- ### Basic Usage Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/DocumentViewHelper/Index.html Shows the minimal usage of the DocumentViewHelper as the first element in a template. ```APIDOC ## DocumentViewHelper - Basic Usage ### Description This ViewHelper must be the first to be used in your template and wrap all the other ViewHelpers. It is responsible for generating the document. ### Usage ``` [..] ``` ``` -------------------------------- ### Advanced usage: custom padding and style Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/GraphicsLineViewHelper/Index.html Renders a line with custom padding and style attributes. The style attribute accepts values as described in the TCPDF example 012. ```XML ``` -------------------------------- ### Add a page break with conditional usage Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/PageBreakViewHelper/Index.html Use to insert a page break. The example shows an unconditional break between pages and a conditional break wrapped in . ```XML Page 1 Page 2 Conditional page break ``` -------------------------------- ### Basic usage of TextViewHelper Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/ViewHelpers/TextViewHelper/Index.rst.txt Two basic ways to render text: using the tag content or the 'text' attribute. ```XML Title ``` -------------------------------- ### Advanced usage with absolute width values Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/ViewHelpers/MultiColumnViewHelper/Index.rst.txt Demonstrates setting column widths using absolute numeric values (100, 45, 45) instead of percentages. This is an alternative to the percentage-based example. ```xml Column 1 Column 2 Column 3 ``` -------------------------------- ### Advanced usage with percentage widths and padding Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/_sources/ViewHelpers/MultiColumnViewHelper/Index.rst.txt Shows how to set column widths as percentages and add padding to individual columns. The first two columns have right padding of 2, while the third has no padding. ```xml Column 1 Column 2 Column 3 ``` -------------------------------- ### Basic usage of HeadlineViewHelper Source: https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/main/en-us/ViewHelpers/HeadlineViewHelper/Index.html Two basic ways to render a headline: using the tag content or the `text` attribute. The `type` attribute can be used to apply predefined styles. ```XML Title ```