DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Usage¶
Main PDF ViewHelper¶
If you've included the Namespace into your template, you can access the PDF-Viewhelpers as following
<pdf:pdf>
<!-- YOUR HTML CONTENT -->
</pdf:pdf>
Arguments¶
ViewHelper Argument | Type | Additional Information |
---|---|---|
outputFilename | string | The default filename as output when forceDownload is activated or the user saves the file |
forceDownload | bool | This forces the browser to download the rendered pdf |
basePath | string | The base path for file inclusion like CSS, JS etc. |
utf8encode | bool | Completely encodes given code as UTF-8 |
utf8decode | bool | Completely decodes given code with UTF-8 |
paperSize | string | The paper size e.g. A4 |
orientation | string | Paper orientation, e.g. portrait or landscape |
variables | array | An array with variables |
remoteUrlsEnabled | bool | Enables DOMPDF to load external contents into the PDF |
options | array | Options for DOMPDF as array |
debug | bool | Debug Mode to show the html code that i going to be rendered |
Page Break ViewHelper¶
Use the Page Break ViewHelper to force a page break at the location.
<pdf:pdf>
<h1>Page 1</h1>
<pdf:pdf.pageBreak />
<h1>Page 2</h2>
</pdf:pdf>
Example - Simple¶
<pdf:pdf outputFilename="filename.pdf"
forceDownload="true"
paperSize="A4">
<h1>Table of contents</h1>
<ul>
<li>Topic 1</li>
<li>Topic 2</li>
<li>Topic 3</li>
<li>Topic 4</li>
</ul>
<pdf:pdf.pageBreak />
Page Two!
</pdf:pdf>
Example - Layout¶
<pdf:pdf outputFilename="filename.pdf"
forceDownload="0"
basePath="http://www.mydomain.com/"
remoteUrlsEnabled="1"
utf8encode="0"
debug="0"
paperSize="A4">
<link rel="stylesheet" type="text/css" href="typo3conf/ext/template/Resources/Public/Css/styles.css" />
<f:format.html parseFuncTSPath="">{content}</f:format.html>
</pdf:pdf>