Loading...
Skip navigation
Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.

Fluid FPDF Tutorial Debugging

<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>

    <!-- show all border and debug information -->
    <fpdf:variable.set name="debug" value="1"/>
    <fpdf:variable.set name="debugText" value=""/>

    <fpdf:addPage>

        <!-- Automatic page break -->
        <fpdf:variable.set name="autoPageBreak" value="10"/>
        <fpdf:setAutoPageBreak margin="{autoPageBreak}"/>

        <!-- Set margins -->
        <fpdf:variable.set name="marginTop" value="32"/>
        <fpdf:variable.set name="marginLeft" value="9"/>
        <fpdf:variable.set name="marginRight" value="{fpdf:math.subtract(a: 210, b: 10)}"/>
        <fpdf:variable.set name="marginBottom" value="{fpdf:math.subtract(a: 297, b: autoPageBreak)}"/>
        <fpdf:variable.set name="marginLeftAndRight" value="20"/>
        <fpdf:variable.set name="marginTopAndBottom" value="{fpdf:math.sum(a: marginTop, b: autoPageBreak)}"/>
        <fpdf:setTopMargin margin="{marginTop}"/>
        <fpdf:setLeftMargin margin="{marginLeft}"/>
        <fpdf:setRightMargin margin="{marginRight}"/>

        <!-- Content width & height -->
        <fpdf:variable.set name="contentWidth" value="{fpdf:math.subtract(a: 210, b: marginLeftAndRight)}" />
        <fpdf:variable.set name="contentHeight" value="{fpdf:math.subtract(a: 297, b: marginTopAndBottom)}" />


        <!-- Print debug lines for margin -->
        <f:if condition="{debug}">
            <fpdf:setDrawColor hex="#FF0000"/>
            <fpdf:setLineWidth width="0.05"/>
            <!-- Margins -->
            <fpdf:line x1="{marginLeft}" x2="{marginLeft}" y1="0" y2="297.00"/>
            <fpdf:line x1="{marginRight}" x2="{marginRight}" y1="0" y2="297.00"/>
            <fpdf:line x1="0" x2="210.00" y1="{marginTop}" y2="{marginTop}"/>
            <fpdf:line x1="0" x2="210.00" y1="{marginBottom}" y2="{marginBottom}"/>
        </f:if>

<fpdf:variable.set name="debugText">{debugText}Before values:
x: {fpdf:getX()}
y: {fpdf:getY()}
</fpdf:variable.set>

        <fpdf:setXY x="{marginLeft}" y="{marginTop}" />
        <fpdf:setFont family="Arial" style="B" size="16" />
        <fpdf:cell width="40" height="10" text="Hello World!" border="{debug}" />

<fpdf:variable.set name="debugText">{debugText}After values:
x: {fpdf:getX()}
y: {fpdf:getY()}
</fpdf:variable.set>

        <!-- Print debugging output -->
        <f:if condition="{debug}">
            <fpdf:addPage />
            <fpdf:variable.set name="debugText">================================================================================
DEBUGGING:
================================================================================
{debugText}</fpdf:variable.set>
            <fpdf:setFont family="Courier" style="" size="10" />
            <fpdf:multiCell width="{contentWidth}" height="4" text="{debugText}" border="{debug}" />
        </f:if>

    </fpdf:addPage>
</fpdf:pdf>
</html>
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
_W__________M9U______
LH_____C______P___352
_5____ZEY___BUX______
_A_____Q____9_____NSN
XXF_________8KZ______