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

Stop! Playing in the meantime?
Stop! Playing in the meantime?
Stop! Playing in the meantime?

Stop! Playing in the meantime?

Break the highscore

Press Start
Contact request
Screenreader label
Security question
FBS_________7XA______
__K____E____Z_J___UKK
GZX___N8U___P6L______
A______Z____U_9___7B7
7B7_________BF9______