Loading...
Skip navigation

How to write a PDF template, which returns the PDF as string?

This is useful, if you like to attach the created PDF to a mail or something else.

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:fpdf="http://typo3.org/ns/CodingMs/FluidFpdf/ViewHelpers"
      data-namespace-typo3-fluid="true"><f:spaceless>
<f:format.raw>
    <fpdf:pdf destination="S">
        <fpdf:addPage orientation="P" size="A4">
            <fpdf:setFont family="Arial" style="B" size="10" />
            <fpdf:text x="10" y="10" text="Hello Pdf-World" />
            <fpdf:setXY x="40" y="40" />
            <fpdf:cell width="40" height="10" text="Hello World!" />
        </fpdf:addPage>
    </fpdf:pdf>
</f:format.raw>
</f:spaceless></html>

The important thing is, that there're no spaces and the PDF-Code is not escaped!

Documentation
TYPO3 Fluid-FPDF Extension

TYPO3 Fluid-FPDF

This extension provides you a complete set of ViewHelpers for dealing with FPDF by using Fluid. You can use the ViewHelpers easily in own Extensions just by defining the fpdf-Namespace. Additionally you're able to use the build in plugin, for displaying predefined PDF. This plugin offers you automatically all available PDFs.

Menu

Contact request

You can contact us at any time

Contact request
Screenreader label
Security question
GZ5_________UDK______
E______T____P_9___TDK
R9G___KMX___W_5______
__I____2____A_9___XOL
DKP_________45P______