Configuration Reference

Template

Override plugin.tx_web2pdf.view to use you own template. Default template is found in EXT:web2pdf/Resources/Private/Templates/Pdf/GeneratePdfLink.html

TypoScript Reference

  • PDF Configuration can be set in constant editor or TypoScript setup

  • Include Static Typoscript Template in BackendModule "Templates"

  • Example Footer and Header HTML files can be found in partialRootPath/Pdf/Header.html (with pagenum and date)

The following settings are available in plugin.tx_web2pdf.settings:

Field:

Description:

Default:

pdfPageFormat

PDF page format (e.g A4 or A5)

A4

pdfPageOrientation

Page orientation. Possible values:

  • L = Landscape

  • P = Portrait

P

pdfLeftMargin

Margin left

15

pdfRightMargin

Margin right

15

pdfTopMargin

Margin top

15

pdfBottomMargin

Margin bottom

15

pdfStyleSheet

Which style sheet media should be loaded (all is always included)

allAndPrint

pdfDestination

PDF download destination. Possible values:

  • attachment - download generated PDF file

  • inline - show generated PDF file in browser

attachment

useCustomHeader

If set, a custom page header will be added to the PDF document. The template of the header is located in Resources/Private/Partials/Pdf/Header.html

0

useCustomFooter

If set, a custom page footer will be added to the PDF document. The template of the footer is located in Resources/Private/Partials/Pdf/Footer.html

0

pdfPregSearch

Array of search patterns used with preg_replace to replace content in the generated PDF

empty

pdfPregReplace

Array of replacements used for pdfPregSearch

empty

pdfStrSearch

Array of search strings used with str_replace to replace content in the generated PDF

empty

pdfStrSearch

Array of replacements used for pdfStrReplace

empty

Example for replacements

There are two replacements options: StringReplacement AND/OR PregReplacement SearchString and ReplacementString need to have the same key

Can be set via TypoScript using following options:

plugin.web2pdf.settings {
        pdfPregSearch {
                1 =
        }

        pdfPregReplace {
                1 =
        }

        pdfStrSearch {
                1 =
        }

        pdfStrReplace {
                1 =
        }

}

Example: Replace Hello with Good Night

plugin.web2pdf.settings {

        pdfStrSearch {
                1 = Hello
        }

        pdfStrReplace {
                1 = Good Night
        }
}