.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../Includes.txt .. _configuration: Configuration Reference ======================= Technical information: Installation, Reference of TypoScript options and how to extend it. Target group: **Developers** .. _installation: Installation ------------ Install the extension using the extension manager and include the static TypoScript template of the extension. .. _typoscript: TypoScript Reference -------------------- Settings inheritance ^^^^^^^^^^^^^^^^^^^^ To avoid redundancy there is an inheritance structure within the settings. There are basically three levels top down: 1. plugin.tx_pdfviewhelpers.settings.document|page|generalText: The top level are global settings for document, page and generalText (all textual output). 2. plugin.tx_pdfviewhelpers.settings.headline|text|list: Headline, text and list inherit settings from generalText. All the settings from generalText may be overwritten here with specific settings. 3. Fluid ViewHelper attributes: The bottom level are Fluid ViewHelper attributes. All settings for document, page, headline, text and list may be overwritten using Fluid ViewHelper attributes with the same name. e.g: :: {namespace pdf=Bithost\Pdfviewhelpers\ViewHelpers} Different color Properties in plugin.tx_pdfviewhelpers.settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. container:: ts-properties =============================== ===================================== ========================================== Property Data type Default =============================== ===================================== ========================================== config.class_ :ref:`t3tsref:data-type-string` Bithost\\Pdfviewhelpers\\Model\\EmptyFPDI config.language_ :ref:`t3tsref:data-type-string` ger config.disableCache_ :ref:`t3tsref:data-type-boolean` 1 config.jpgQuality_ :ref:`t3tsref:data-type-integer` 100 config.allowedImageTypes_ Array *See static TypoScript template* document.title_ :ref:`t3tsref:data-type-string` Default document title document.subject_ :ref:`t3tsref:data-type-string` Autogenerated PDF, By Bithost GmbH document.author_ :ref:`t3tsref:data-type-string` Bithost GmbH document.keywords_ :ref:`t3tsref:data-type-string` document.creator_ :ref:`t3tsref:data-type-string` TYPO3 EXT:pdfviewhelpers document.outputDestination_ :ref:`t3tsref:data-type-string` I document.outputPath_ :ref:`t3tsref:data-type-string` document.pdf document.sourceFile_ :ref:`t3tsref:data-type-string` page.autoPageBreak_ :ref:`t3tsref:data-type-boolean` 0 page.margins_ Array {top: 15, right: 15, bottom: 15, left: 15} page.importPage_ :ref:`t3tsref:data-type-integer` generalText.trim_ :ref:`t3tsref:data-type-boolean` 1 generalText.color_ :ref:`t3tsref:data-type-string` #000 generalText.fontFamily_ :ref:`t3tsref:data-type-string` helvetica generalText.fontSize_ :ref:`t3tsref:data-type-integer` 11 generalText.padding_ Array {top: 0, right: 0, bottom: 0, left: 0} generalText.alignment_ :ref:`t3tsref:data-type-string` left generalText.paragraphSpacing_ :ref:`t3tsref:data-type-integer` 2 text.color. :ref:`t3tsref:data-type-string` *See generalText* text.fontFamily :ref:`t3tsref:data-type-string` *See generalText* text.fontSize :ref:`t3tsref:data-type-integer` *See generalText* text.padding Array *See generalText* text.alignment :ref:`t3tsref:data-type-string` *See generalText* text.paragraphSpacing :ref:`t3tsref:data-type-integer` *See generalText* headline.color :ref:`t3tsref:data-type-string` *See generalText* headline.fontFamily :ref:`t3tsref:data-type-string` *See generalText* headline.fontSize :ref:`t3tsref:data-type-integer` *See generalText* headline.padding Array *See generalText* headline.alignment :ref:`t3tsref:data-type-string` *See generalText* headline.paragraphSpacing :ref:`t3tsref:data-type-integer` *See generalText* list.color :ref:`t3tsref:data-type-string` *See generalText* list.fontFamily :ref:`t3tsref:data-type-string` *See generalText* list.fontSize :ref:`t3tsref:data-type-integer` *See generalText* list.padding Array *See generalText* list.alignment :ref:`t3tsref:data-type-string` *See generalText* list.paragraphSpacing :ref:`t3tsref:data-type-integer` *See generalText* list.bulletColor_ :ref:`t3tsref:data-type-string` #000 list.bulletImageSrc_ :ref:`t3tsref:data-type-string` list.bulletSize_ :ref:`t3tsref:data-type-float` 1.5 =============================== ===================================== ========================================== Property details ^^^^^^^^^^^^^^^^ .. only:: html .. contents:: :local: :depth: 1 .. _config.class: config.class """"""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.config.class =` :ref:`t3tsref:data-type-string` Decides which PHP class should be used as TCPDF object. The class must inherit from \\TCPDF. If this setting is left empty \\TCPDF is used as class. There are three other possibilities shipped with this extension: * Bithost\\Pdfviewhelpers\\Model\\EmptyTCPDF: renders empty headers and footers * Bithost\\Pdfviewhelpers\\Model\\EmptyFPDI: renders empty headers and footers, able to load PDFs as template documents * Bithost\\Pdfviewhelpers\\Model\\BithostTCPDF: renders headers belonging to the example You can easily provide your own class in order to render custom header and footers or to customize TCPDF in any way. .. _config.language: config.language """"""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.config.language =` :ref:`t3tsref:data-type-string` Decides which language settings are used from TCPDF. All possible language codes can be found in **Resources/Private/tcpdf/examples/lang/**. .. _config.disableCache: config.disableCache """"""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.config.disableCache =` :ref:`t3tsref:data-type-boolean` Decides whether the TYPO3 frontend cache will be disabled or not. .. _config.jpgQuality: config.jpgQuality """"""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.config.jpgQuality =` :ref:`t3tsref:data-type-integer` JpgQuality being used, values from 0 - 100. .. _config.allowedImageTypes: config.allowedImageTypes """""""""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.config.allowedImageTypes =` Array Mapping of TCPDF image functions to their corresponding image file extensions. .. _document.title: document.title """""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.title =` :ref:`t3tsref:data-type-string` The title of the generated PDF document. .. _document.subject: document.subject """""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.subject =` :ref:`t3tsref:data-type-string` The subject of the generated PDF document. .. _document.author: document.author """"""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.author =` :ref:`t3tsref:data-type-string` The author of the generated PDF document. .. _document.keywords: document.keywords """"""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.keywords =` :ref:`t3tsref:data-type-string` A comma separated list of keywords for the generated PDF document. .. _document.creator: document.creator """""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.creator =` :ref:`t3tsref:data-type-string` The creator of the generated PDF document. .. _document.outputDestination: document.outputDestination """""""""""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.outputDestination =` :ref:`t3tsref:data-type-string` The TCPDF output destination for the PDF. Possible values are: ================= ====================================================================================== outputDestination Description ================= ====================================================================================== I Sending the PDF inline to the browser. D Sending the PDF as immediate file download. F Saving the PDF to the specified outputPath. FI Saving the PDF to the specified outputPath and sending it inline to the browser. FD Saving the PDF to the specified outputPath and sending it as immediate file download. E Return the PDF as base64 mime multi-part email attachment (RFC 2045). S Return the PDF as string. ================= ====================================================================================== .. _document.outputPath: document.outputPath """"""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.outputPath =` :ref:`t3tsref:data-type-string` The TCPDF output path of the document. If you are saving the file to filesystem this is a relative path from the webroot directory e.g. *fileadmin/pdfviewhelpers/projectXY.pdf*. If you are sending it inline or as file download it is simply the name of the document e.g. *projectXY.pdf*. .. _document.sourceFile: document.sourceFile """"""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.document.sourceFile =` :ref:`t3tsref:data-type-string` The sourceFile is a the path to a PDF document you want to use as a template (see also page.importPage). The path is always relative to the root directory of your TYPO3 installation. .. _page.autoPageBreak: page.autoPageBreak """""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.page.autoPageBreak =` :ref:`t3tsref:data-type-boolean` Decides whether TCPDF uses auto page break or not. You can always add a new page by adding a new tag to your template. .. _page.margins: page.margins """""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.page.margins =` Array An array of the margins for each page. .. _page.importPage: page.importPage """"""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.page.importPage =` :ref:`t3tsref:data-type-integer` Specifies which page should be used as template for the current page. Must be used together with document.sourceFile. .. _generalText.trim: generalText.trim """""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.trim =` :ref:`t3tsref:data-type-boolean` If set to true leading and trailing spaces or tabs are trimmed. .. _generalText.color: generalText.color """"""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.color =` :ref:`t3tsref:data-type-string` The text color as hex value, possible syntax are: #000 or #000000 .. _generalText.fontFamily: generalText.fontFamily """""""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.fontFamily =` :ref:`t3tsref:data-type-string` The font family being used. You can add your own fonts using your own TCPDF class. .. _generalText.fontSize: generalText.fontSize """""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.fontSize =` :ref:`t3tsref:data-type-integer` The font size being used. .. _generalText.padding: generalText.padding """"""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.padding =` Array An array of the padding for each text element. .. _generalText.alignment: generalText.alignment """"""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.alignment =` :ref:`t3tsref:data-type-string` Possible values are: 'left', 'center', 'right', 'justify' .. _generalText.paragraphSpacing: generalText.paragraphSpacing """""""""""""""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.generalText.paragraphSpacing =` :ref:`t3tsref:data-type-integer` Defines the spacing of paragraphs separated by new lines. .. _list.bulletColor: list.bulletColor """""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.list.bulletColor =` :ref:`t3tsref:data-type-string` The color of the bullet used as hex value, possible syntax are: #000 or #000000 .. _list.bulletImageSrc: list.bulletImageSrc """"""""""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.list.bulletImageSrc =` :ref:`t3tsref:data-type-string` The path to an image that should be used as bullet. .. _list.bulletSize: list.bulletSize """"""""""""""" :typoscript:`plugin.tx_pdfviewhelpers.settings.list.bulletSize =` :ref:`t3tsref:data-type-float` The size of the bullet as floating point value. Advanced Customization ---------------------- You can add custom headers and footers to all pages by providing your own TCPDF class. The more you can customize TCPDF in any way you like using your own class. E.g. you could load your own font within the constructor. *See plugin.tx_pdfviewhelpers.settings.config.class* If there is a ViewHelper missing, feel free to implement your own ViewHelper extending the AbstractContentElementViewHelper from the extension. You can have a look at the ViewHelpers in *Classes/ViewHelpers*. If you feel like your ViewHelper might be useful for everybody, feel free to create a pull request! Caching ------- The extension pdfviewhelpers does not provide any caching mechanism for the generated PDF documents. In fact caching is disabled by default because it makes not much sense to save a PDF document to the TYPO3 frontend cache. Since generating PDF documents is quite time consuming you should implement your own caching strategy by saving the generated PDF files to the filesystem and only generate them when necessary.