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).

  1. 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.

  1. 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}

<pdf:document outputDestination="I" title="Bithost Example">
        <pdf:page autoPageBreak="1">
                <pdf:headline color="#333">Different color</pdf:headline>
        </pdf:page>
</pdf:document>

Properties in plugin.tx_pdfviewhelpers.settings

Property Data type Default
config.class string Bithost\Pdfviewhelpers\Model\EmptyFPDI
config.language string ger
config.disableCache boolean 1
config.jpgQuality integer 100
config.sRGBMode boolean 0
config.allowedImageTypes Array See static TypoScript template
config.fonts.subset boolean 1
config.fonts.addTTFFont Array  
document.title string Default document title
document.subject string Autogenerated PDF, By Bithost GmbH
document.author string Bithost GmbH
document.keywords string  
document.creator string TYPO3 EXT:pdfviewhelpers
document.outputDestination string I
document.outputPath string document.pdf
document.sourceFile string  
page.autoPageBreak boolean 0
page.margins Array {top: 15, right: 15, bottom: 15, left: 15}
page.importPage integer  
page.orientation string P
generalText.trim boolean 1
generalText.removeDoubleWhitespace boolean 1
generalText.color string #000
generalText.fontFamily string helvetica
generalText.fontSize integer 11
generalText.fontStyle string R
generalText.padding Array {top: 0, right: 0, bottom: 0, left: 0}
generalText.alignment string L
generalText.paragraphSpacing integer 2
text.trim boolean See generalText
text.removeDoubleWhitespace boolean See generalText
text.color. string See generalText
text.fontFamily string See generalText
text.fontSize integer See generalText
text.fontStyle string See generalText
text.padding Array See generalText
text.alignment string See generalText
text.paragraphSpacing integer See generalText
headline.trim boolean See generalText
headline.removeDoubleWhitespace boolean See generalText
headline.color string See generalText
headline.fontFamily string See generalText
headline.fontSize integer See generalText
headline.fontStyle string See generalText
headline.padding Array {top: 6, right: 0, bottom: 3, left: 0}
headline.alignment string See generalText
headline.paragraphSpacing integer See generalText
list.trim boolean See generalText
list.removeDoubleWhitespace boolean See generalText
list.color string See generalText
list.fontFamily string See generalText
list.fontSize integer See generalText
list.fontStyle string See generalText
list.padding Array {top: 0, right: 0, bottom: 2, left: 1}
list.alignment string L
list.bulletColor string #000
list.bulletImageSrc string  
list.bulletSize data-type-float 1.5
html.styleSheet string  

Property details

config.class

plugin.tx_pdfviewhelpers.settings.config.class = 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

plugin.tx_pdfviewhelpers.settings.config.language = string

Decides which language settings are used from TCPDF. All possible language codes can be found in Resources/Private/tcpdf/examples/lang/.

config.disableCache

plugin.tx_pdfviewhelpers.settings.config.disableCache = boolean

Decides whether the TYPO3 frontend cache will be disabled or not.

config.jpgQuality

plugin.tx_pdfviewhelpers.settings.config.jpgQuality = integer

JpgQuality being used, values from 0 - 100.

config.sRGBMode

plugin.tx_pdfviewhelpers.settings.config.sRGBMode = boolean

Enable sRGBMode, see TCPDF documentation for further information.

config.allowedImageTypes

plugin.tx_pdfviewhelpers.settings.config.allowedImageTypes = Array

Mapping of TCPDF image functions to their corresponding image file extensions.

config.fonts.subset

plugin.tx_pdfviewhelpers.settings.config.fonts.subset = boolean

Decides whether to subset the used fonts or not. When this is set to true it is not possible to edit the generated PDF if the font is not present in the users system, but the file size gets smaller.

config.fonts.addTTFFont

plugin.tx_pdfviewhelpers.settings.config.fonts.addTTFFont = Array

Possibility to add custom fonts, please have a look at the dedicated chapter Custom Fonts.

document.title

plugin.tx_pdfviewhelpers.settings.document.title = string

The title of the generated PDF document.

document.subject

plugin.tx_pdfviewhelpers.settings.document.subject = string

The subject of the generated PDF document.

document.author

plugin.tx_pdfviewhelpers.settings.document.author = string

The author of the generated PDF document.

document.keywords

plugin.tx_pdfviewhelpers.settings.document.keywords = string

A comma separated list of keywords for the generated PDF document.

document.creator

plugin.tx_pdfviewhelpers.settings.document.creator = string

The creator of the generated PDF document.

document.outputDestination

plugin.tx_pdfviewhelpers.settings.document.outputDestination = 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

plugin.tx_pdfviewhelpers.settings.document.outputPath = 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

plugin.tx_pdfviewhelpers.settings.document.sourceFile = 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

plugin.tx_pdfviewhelpers.settings.page.autoPageBreak = boolean

Decides whether TCPDF uses auto page break or not. You can always add a new page by adding a new <pdf:page> tag to your template.

page.margins

plugin.tx_pdfviewhelpers.settings.page.margins = Array

An array of the margins for each page.

page.importPage

plugin.tx_pdfviewhelpers.settings.page.importPage = integer

Specifies which page should be used as template for the current page. Must be used together with document.sourceFile.

page.orientation

plugin.tx_pdfviewhelpers.settings.page.orientation = string

Defines the orientation of the current page and the following pages. Possible values are P (portrait) and L (landscape).

generalText.trim

plugin.tx_pdfviewhelpers.settings.generalText.trim = boolean

If set to true leading and trailing spaces or tabs are trimmed.

generalText.removeDoubleWhitespace

plugin.tx_pdfviewhelpers.settings.generalText.removeDoubleWhitespace = boolean

If set to true double spaces within text elements are removed.

generalText.color

plugin.tx_pdfviewhelpers.settings.generalText.color = string

The text color as hex value, possible syntax are: #000 or #000000

generalText.fontFamily

plugin.tx_pdfviewhelpers.settings.generalText.fontFamily = string

The font family being used. You can add your own fonts using your own TCPDF class.

generalText.fontSize

plugin.tx_pdfviewhelpers.settings.generalText.fontSize = integer

The font size being used.

generalText.fontStyle

plugin.tx_pdfviewhelpers.settings.generalText.fontStyle = string

The font style being used. Possible values are: R (regular), B (bold), I (italic), U (underline)

generalText.padding

plugin.tx_pdfviewhelpers.settings.generalText.padding = Array

An array of the padding for each text element.

generalText.alignment

plugin.tx_pdfviewhelpers.settings.generalText.alignment = string

Possible values are: ‘L’ (left), ‘C’ (center), ‘R’ (right), ‘J’ (justify)

generalText.paragraphSpacing

plugin.tx_pdfviewhelpers.settings.generalText.paragraphSpacing = integer

Defines the spacing of paragraphs separated by new lines.

list.bulletColor

plugin.tx_pdfviewhelpers.settings.list.bulletColor = string

The color of the bullet used as hex value, possible syntax are: #000 or #000000

list.bulletImageSrc

plugin.tx_pdfviewhelpers.settings.list.bulletImageSrc = string

The path to an image that should be used as bullet.

list.bulletSize

plugin.tx_pdfviewhelpers.settings.list.bulletSize = data-type-float

The size of the bullet as floating point value.

html.styleSheet

plugin.tx_pdfviewhelpers.settings.html.styleSheet = string

The path to a style sheet being used in the HtmlViewHelper. The path is relative to the webroot directory, e.g. “fileadmin/pdf_style.css”.