Skip to main navigation Skip to main content Skip to page footer

Fluid FPDF Tutorial Footer

In this tutorial we want to reuse a footer template on each PDF page. For that you need to create an additional Template, we call it simply Templates/Pdf/Footer.html. This template could look like this:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
      xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
      xmlns:fpdf="http://typo3.org/ns/CodingMs/FluidFpdf/ViewHelpers"
      data-namespace-typo3-fluid="true">

    <!-- Page numbers -->
    <fpdf:setXY x="160" y="280" />
    <fpdf:cell text="{fpdf:pageNo()}/|nb|" align="R" width="40" />

</html>

Additionally we need a FPDF template like usual. In this template we need to define the path to the footer template in the <fpdf:pdf tag. Our testing template looks like this:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
      xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
      xmlns:fpdf="http://typo3.org/ns/CodingMs/FluidFpdf/ViewHelpers"
      data-namespace-typo3-fluid="true">
<fpdf:pdf footerTemplate="EXT:fluid_fpdf/Resources/Private/Templates/Pdf/Footer.html">
    <fpdf:setFont family="Arial" style="" size="15" />

    <fpdf:addPage />

    <fpdf:addPage />

    <fpdf:addPage />

    <fpdf:addPage />

</fpdf:pdf>
</html>
Dokumentation

TYPO3 Fluid-FPDF

Diese Erweiterung bietet Dir einen vollständigen Satz von ViewHelpern für den Umgang mit FPDF mithilfe von Fluid. Du kannst die ViewHelper einfach in eigenen Erweiterungen verwenden, indem Du einfach den fpdf-Namespace definierst. Zusätzlich kannst du das eingebaute Plugin verwenden, um vordefinierte PDF anzuzeigen. Dieses Plugin bietet Dir automatisch alle verfügbaren PDFs.

Menü