t3brightside/form-pdf

TYPO3 form finisher to write form data into pre-existing PDF file.

Maintainers

Package info

github.com/t3brightside/form_pdf

Homepage

Type:typo3-cms-extension

pkg:composer/t3brightside/form-pdf

Transparency log

Statistics

Installs: 11 105

Dependents: 0

Suggesters: 0

Stars: 7

Open Issues: 1

3.0.0-beta-1 2026-08-06 11:58 UTC

This package is auto-updated.

Last update: 2026-08-06 11:59:25 UTC


README

Packagist Software License Brightside

TYPO3 form finisher to write form data into pre-defined PDF file.

  • Sends PDF as an attachment in user and receiver e-mails
  • Provides link to the PDF file in the confirmation message & deletes file after clicking the link
  • Adds scheduler task to remove the file after certain amount of time if link is not clicked

Installation

Install with composer (recommended)

composer require t3brightside/form-pdf

How it works

The PDF file is generated using mPDF PHP library.

It uses pre-defined PDF Template file as layout and inserts pre-defined HTML with form data and layout.

PDF Template

It is possible to prepare PDF layout with office software. You can find PDF layout example here.

HTML Template

HTML template contains fluid-styled markers of form values. You can find HTML example here. This example related to default contact form.

Usage

    • TYPO3 13 and above: Include the site set "Form PDF" in backend module Site -> Site Management or as dependency in your site package, file EXT:my_sitepackage/Configuration/Sets/Site/config.yaml:

      dependencies:
        - wco/wco-form-api-finisher
      
    • TYPO3 12.4: Include static record "Form PDF" to TypoScript record.

  1. Prepare 2 records: PDF Template, HTML templates.

new record

  1. Add PDF Finisher at the first position in the form.

finisher

  1. Select already created PDF Template and HTML Template.

  2. "Attach PDF to receiver mail": when checked, then PDF is attached to admin mail.

  3. "Attach PDF to user mail": when checked, then PDF is attached to user mail.

  4. "Open PDF in new window": when checked, the confirmation message is appended with "Click to open PDF." link.

  5. When the link "Click to open PDF." is clicked, then PDF is removed from filesystem.

  6. "Store PDF on server (FAL)": when checked, the generated PDF is additionally written to a FAL storage folder so it can be linked from an e-mail (see below) or referenced from downstream code. The transient/one-shot download flow (option 7) is independent and unchanged.

Store the generated PDF on the server and link to it in mails

By default form_pdf attaches the generated PDF to the e-mail(s). For larger PDFs, or when receivers prefer a stable link over an attachment, the PDF can be persisted to a FAL storage and referenced from the mail template instead:

  1. On the PdfFinisher, enable Store PDF on server (FAL) (storeOnServer: true) and set a FAL folder identifier as FAL storage path (storagePath, e.g. 1:/form_pdf/). The folder is auto-created if missing. A Stored filename pattern (filenamePattern) supports the placeholders {timestamp} (unix), {datetime} (YmdHi), {date} (Y-m-d) and {formIdentifier}.

  2. On the corresponding e-mail finisher (EmailToReceiver / EmailToSender), enable attachAsLink: true. The PDF is then not attached to that e-mail; instead, two variables are assigned to the FluidEmail template:

    • {pdfLink} — absolute public URL to the stored PDF
    • {pdfFilename} — the filename as stored

    Example FluidEmail snippet:

    <p>Ihre Bestätigung als PDF:
      <a href="{pdfLink}">{pdfFilename}</a>
    </p>

Notes and constraints:

  • Enabling attachAsLink: true without storeOnServer: true throws a FinisherException — misconfiguration is intentionally loud rather than silently falling back to an attachment.
  • storagePath must point to a publicly reachable FAL storage — the extension emits File::getPublicUrl() as-is. Token-protected downloads are out of scope for this feature.
  • Form submissions can contain sensitive data. Consider whether the target storage folder is web-indexable before enabling this in production.

Available options at a glance

Option Where Default Purpose
storeOnServer PdfFinisher false Enable persistent FAL storage
storagePath PdfFinisher '' FAL folder identifier, e.g. 1:/form_pdf/
filenamePattern PdfFinisher '{timestamp}-{formIdentifier}.pdf' Stored filename; placeholders: {timestamp}, {datetime}, {date}, {formIdentifier}
attachAsLink EmailFinisher false Assign pdfLink/pdfFilename to the template instead of attaching

For Developer

Templating

Confirmation template is ConfirmationWithLink.html. It is possible to rewrite it from another location by configuration

TYPO3:
    CMS:
        Form:
            prototypes:
                standard:
                    finishersDefinition:
                        Confirmation:
                            options:
                                templateRootPaths:
                                   20: 'fileadmin/templates/form/Confirmation/'

Extending

It extends core finishers

  • EmailFinisher.php
  • ConfirmationFinisher.php

Sources

Author

Mykola Orlenko - mykola.orlenko@web-spectr.com

Development and maintenance

Brightside OÜ – TYPO3 development and hosting specialised web agency