TypoScript Reference
Settings inheritance
To avoid redundancy there is an inheritance structure within the settings. There are basically three levels top down:
- plugin.tx_pdfviewhelpers.settings.document|page|generalText: The top level are global settings for document, page and generalText (all textual output).
- 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.
- Fluid ViewHelper attributes: The bottom level are Fluid ViewHelper attributes. All TypoScript settings 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\BasePDF |
config.disableCache_ | boolean | 1 |
config.exitAfterPdfContentOutput_ | boolean | 0 |
config.jpgQuality_ | integer | 100 |
config.sRGBMode_ | boolean | 0 |
config.allowedImageTypes_ | Array | See static TypoScript template |
config.fonts.subset_ | boolean | 1 |
config.fonts.addTTFFont_ | Array | See static TypoScript template |
config.fonts.outputPath_ | string | typo3temp/pdfviewhelpers/fonts/ |
document.title_ | string | |
document.subject_ | string | |
document.author_ | string | |
document.keywords_ | string | |
document.creator_ | string | TYPO3 EXT:pdfviewhelpers |
document.outputDestination_ | string | inline |
document.outputPath_ | string | document.pdf |
document.sourceFile_ | string | |
document.unit_ | string | mm |
document.unicode_ | boolean | 1 |
document.encoding_ | string | UTF-8 |
document.pdfa_ | boolean | 0 |
document.pdfua_ | boolean | 0 |
document.language_ | string | ger |
document.hyphenFile_ | string | hyph-de-ch-1901.tex |
page.autoPageBreak_ | boolean | 0 |
page.margin_ | Array | {top: 15, right: 15, bottom: 15, left: 15} |
page.importPage_ | integer | |
page.importPageOnAutomaticPageBreak_ | boolean | 1 |
page.orientation_ | string | portrait |
page.format_ | string | A4 |
page.keepMargins_ | boolean | 0 |
page.tableOfContentPage_ | boolean | 0 |
header.posY_ | integer | 5 |
footer.posY_ | integer | -10 |
avoidPageBreakInside.breakIfImpossibleToAvoid_ | boolean | 0 |
generalText.trim_ | boolean | 1 |
generalText.removeDoubleWhitespace_ | boolean | 1 |
generalText.color_ | string | #000 |
generalText.fontFamily_ | string | helvetica |
generalText.fontSize_ | integer | 11 |
generalText.fontStyle_ | string | regular |
generalText.lineHeight_ | t3tsref:data-type-float | 1.25 |
generalText.characterSpacing_ | t3tsref:data-type-float | 0 |
generalText.padding_ | Array | {top: 0, right: 0, bottom: 0, left: 0} |
generalText.alignment_ | string | left |
generalText.paragraphSpacing_ | integer | 2 |
generalText.paragraphLineFeed_ | boolean | 0 |
generalText.autoHyphenation_ | boolean | 0 |
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.lineHeight | t3tsref:data-type-float | See generalText |
text.characterSpacing | t3tsref:data-type-float | See generalText |
text.padding | Array | See generalText |
text.alignment | string | See generalText |
text.paragraphSpacing | integer | See generalText |
text.paragraphLineFeed | boolean | See generalText |
text.autoHyphenation | boolean | 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.lineHeight | t3tsref:data-type-float | See generalText |
headline.characterSpacing | t3tsref:data-type-float | See generalText |
headline.padding | Array | {top: 6, bottom: 3} |
headline.alignment | string | See generalText |
headline.paragraphSpacing | integer | See generalText |
headline.paragraphLineFeed | boolean | See generalText |
headline.autoHyphenation | boolean | See generalText |
headline.addToTableOfContent | boolean | 0 |
headline.tableOfContentLevel | integer | 0 |
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.lineHeight | t3tsref:data-type-float | See generalText |
list.characterSpacing | t3tsref:data-type-float | See generalText |
list.paragraphLineFeed | boolean | See generalText |
list.padding | Array | {bottom: 2, left: 1.5} |
list.alignment | string | left |
list.bulletColor_ | string | #000 |
list.bulletImageSrc_ | string | |
list.bulletSize_ | t3tsref:data-type-float | 1.5 |
list.autoHyphenation | boolean | See generalText |
image.alignment_ | string | left |
image.fitOnPage_ | boolean | 1 |
image.padding_ | Array | {bottom: 2} |
image.processingInstructions_ | Array | {} |
html.autoHyphenation | boolean | See generalText |
html.styleSheet_ | string | |
html.listIndentWidth_ | t3tsref:data-type-float | |
html.padding_ | Array | {top: 0, right: 0, bottom: 2, left: 0} |
graphics.line.padding_ | Array | {top: 4, right: 0, bottom: 5, left: 0} |
graphics.line.style_ | Array | {width: 0.25, color: #000} |
tableOfContent.page_ | integer | 1 |
tableOfContent.numbersFont_ | string | |
tableOfContent.filter_ | string | . |
tableOfContent.name_ | string | |
tableOfContent.htmlMode_ | boolean | 0 |
tableOfContent.fontFamily_ | string | |
tableOfContent.fontSize_ | t3tsref:data-type-float | |
tableOfContent.lineHeight_ | t3tsref:data-type-float | |
tableOfContent.characterSpacing_ | t3tsref:data-type-float | |
tableOfContent.padding_ | Array | {bottom: 2} |
htmlBookmarkTemplate.level_ | integer | 0 |
htmlBookmarkTemplate.sanitizeWhitespace_ | boolean | 1 |
bookmark.level_ | integer | 0 |
bookmark.fontStyle_ | string | |
bookmark.color_ | string |
Property details
config.class
plugin.
string
Decides which PHP class should be used as TCPDF object. You can easily provide your own class in order to render custom header and footers or to customize TCPDF in any way. Your provided class must inherit from Bithost\Pdfviewhelpers\Model\BasePDF.
config.disableCache
plugin.
boolean
Decides whether the TYPO3 frontend cache will be disabled or not.
config.exitAfterPdfContentOutput
plugin.
boolean
Decides whether the PHP method exit
is called after the PDF content has been sent to the browser.
This might solve issues when additional content is echoed and appended to the PDF document. However it might also lead to other unexpected behaviour so be careful.
config.jpgQuality
plugin.
integer
JpgQuality being used, values from 0 - 100.
config.sRGBMode
plugin.
boolean
Enable sRGBMode, see TCPDF documentation for further information.
config.allowedImageTypes
plugin.
Array
Mapping of TCPDF image functions to their corresponding image file extensions.
config.fonts.subset
plugin.
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.
Array
Possibility to add custom fonts, please have a look at the dedicated chapter Custom Fonts.
config.fonts.outputPath
plugin.
string
Path to directory where font files of custom fonts should be stored. This folder can safely be deleted and will automatically be re/created if it does not exist.
document.title
plugin.
string
The title of the generated PDF document.
document.subject
plugin.
string
The subject of the generated PDF document.
document.author
plugin.
string
The author of the generated PDF document.
document.keywords
plugin.
string
A comma separated list of keywords for the generated PDF document.
document.creator
plugin.
string
The creator of the generated PDF document.
document.outputDestination
plugin.
string
The TCPDF output destination for the PDF. Possible values are:
outputDestination | Description |
---|---|
I / inline | Sending the PDF inline to the browser. |
D / download | Sending the PDF as immediate file download. |
F / file | Saving the PDF to the specified outputPath. |
FI / file-inline | Saving the PDF to the specified outputPath and sending it inline to the browser. |
FD / file-downloa | Saving the PDF to the specified outputPath and sending it as immediate file download. |
E / email | Return the PDF as base64 mime multi-part email attachment (RFC 2045). |
S / string | Return the PDF as string. |
document.outputPath
plugin.
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.
string
The sourceFile is a the path to a PDF document you want to use as a template (see also page.importPage).
document.unit
plugin.
string
The measurement unit used. Possible values are pt
, mm
, cm
and in
.
document.unicode
plugin.
boolean
Determines whether the input text is unicode or not.
document.encoding
plugin.
string
Charset encoding (used only when converting back html entities).
document.pdfa
plugin.
boolean
Sets the document to PDF/A mode if true.
document.pdfua
plugin.
boolean
Enables experimental support for PDF/UA. Please note that this feature is very much incomplete, feel free to contribute any improvements on this!
document.language
plugin.
string
Decides which language settings are used from TCPDF. All possible language codes can be found in Resources/Private/tcpdf/examples/lang/
.
document.hyphenFile
plugin.
string
The name of the hyphen file used for the automatic hyphenation. This needs to be set according to the language of your document.
All possible values can be found in the directory pdfviewhelpers/Resources/Private/Hyphenation/
.
Example values are: hyph-de-1996.tex
, hyph-en-gb.tex
, hyph-nl.tex
, hyph-fr.tex
page.autoPageBreak
plugin.
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.margin
plugin.
Array
An array of the margin for each page. The default unit is millimeters.
page.importPage
plugin.
integer
Specifies which page should be used as template for the current page. Must be used together with document.sourceFile.
page.importPageOnAutomaticPageBreak
plugin.
boolean
Determines whether a PDF template that is used on a page is also rendered when an automatic page break occurs.
page.orientation
plugin.
string
Defines the orientation of the current page and the following pages. Possible values are P
/ portrait
and L
/ landscape
.
page.format
plugin.
string
Defines the format of the current page. Possible values are e.g. A0
- A12
, to see all possible values you have to check \TCPDF_STATIC::$page_formats
. You can also provide numeric values as fluid array e.g. {0:210,1:75}
to set unusual page sizes.
page.keepMargins
plugin.
string
If true overwrites the default page margins with the current margins.
page.tableOfContentPage
plugin.
string
If true the page will be rendered as a table of content page, e.g. it can be moved to the front.
header.posY
plugin.
integer
Defines the header position relative to the top of the page.
avoidPageBreakInside.breakIfImpossibleToAvoid
plugin.
boolean
If set to true this ViewHelper inserts a page break even if the content does not fit on one page, meaning a page break is unavoidable.
generalText.trim
plugin.
boolean
If set to true leading and trailing spaces or tabs are trimmed.
generalText.removeDoubleWhitespace
plugin.
boolean
If set to true double spaces within text elements are removed.
generalText.color
plugin.
string
The text color as hex value, possible syntax are: #000
or #000000
generalText.fontFamily
plugin.
string
The font family being used. A list of available fonts and a configuration to add your own fonts is available in the chapter custom fonts.
generalText.fontSize
plugin.
integer
The font size being used.
generalText.fontStyle
plugin.
string
The font style being used. Possible values are: R
/ regular
, B
/ bold
, I
/ italic
, U
/ underline
generalText.lineHeight
plugin.
t3tsref:data-type-float
Sets the line height with respect to the font size.
generalText.characterSpacing
plugin.
t3tsref:data-type-float
Sets the spacing between individual characters
generalText.padding
plugin.
Array
An array of the padding for each text element. The default unit is millimeters.
generalText.alignment
plugin.
string
Possible values are: L
/ left
, C
/ center
, R
/ right
, J
/ justify
generalText.paragraphSpacing
plugin.
integer
Defines the spacing of paragraphs separated by new lines.
generalText.paragraphLineFeed
plugin.
boolean
Add new lines char after each paragraph (in justified text keeps left align the last line of each paragraph).
generalText.autoHyphenation
plugin.
boolean
A boolean value indicating whether to use TCPDF's automatic hyphenation or not. You can also add soft hyphens yourself to your text with "­". If you use automatic hyphenation please make sure that you configure "config.hyphenFile" to match your language.
headline.addToTableOfContent
plugin.
boolean
If true the headline will be added to the table of content.
headline.tableOfContentLevel
plugin.
integer
Indicating the level of the headline in the table of content. Starting from 0
as top level, 1
for second, 2
for third level and so on.
list.bulletColor
plugin.
string
The color of the bullet used as hex value, possible syntax are: #000
or #000000
list.bulletImageSrc
plugin.
string
The path to an image that should be used as bullet.
list.bulletSize
plugin.
t3tsref:data-type-float
The size of the bullet as floating point value.
image.alignment
plugin.
string
Possible values are: L
/ left
, C
/ center
, R
/ right
image.fitOnPage
plugin.
boolean
If true the image will automatically be rescaled to fit on page.
image.padding
plugin.
Array
The padding around the image.
image.processingInstructions
plugin.
Array
An array of processing instructions that is passed to the method ImageService->applyProcessingInstructions
. A possible configuration looks like this:
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
}
html.styleSheet
plugin.
string
The path to a style sheet being used in the HtmlViewHelper. The can be provided relative to the webroot directory, e.g. "fileadmin/pdf_style.css".
html.padding
plugin.
Array
The padding around the html element.
graphics.line.padding
plugin.
Array
Defines the padding around a line. The default unit is millimeters.
graphics.line.style
plugin.
Array
An array defining line styles, please see the https://tcpdf.org/examples/example_012/ for all possible values.
tableOfContent.page
plugin.
integer
Indicates at what place in the document the table of content will be rendered.
tableOfContent.numbersFont
plugin.
string
The font used to render the numbers. Note that a monospaced font must be used in order to guarantee correct alignment.
tableOfContent.filter
plugin.
string
The filter used to fill up the space between the entry title and the page number.
tableOfContent.name
plugin.
string
The name used for the table of content bookmark.
tableOfContent.htmlMode
plugin.
boolean
If true the table of content is rendered in HTML mode.
tableOfContent.fontFamily
plugin.
string
The fontFamily
for the entries. Also see See generalText.
tableOfContent.fontSize
plugin.
t3tsref:data-type-float
The fontSize
of the top most level. Also see See generalText.
tableOfContent.lineHeight
plugin.
t3tsref:data-type-float
The lineHeight
used for the table content entries. Also see See generalText.
tableOfContent.characterSpacing
plugin.
t3tsref:data-type-float
The characterSpacing
used for the table content entries. Also see See generalText.
tableOfContent.padding
plugin.
Array
The cell padding
used for the table content entries.
htmlBookmarkTemplate.level
plugin.
integer
The bookmark entry level to which the HTML template should apply.
htmlBookmarkTemplate.sanitizeWhitespace
plugin.
boolean
If true the input will be trimmed and whitespaces between HTML tags will be removed.
bookmark.level
plugin.
boolean
The table of content level for the bookmark.
bookmark.fontStyle
plugin.
boolean
The fontStyle
this individual bookmark. Also see See generalText.
bookmark.color
plugin.
boolean
The fontStyle
this individual bookmark. Also see See generalText.