.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../Includes.txt .. _example: Example ======= .. _intro: Intro ----- There is an example being shipped with this extension, you will find the code in **Resources/Public/Example**. Be aware that the static TypoScript template must be included for this example! .. _typoscript: TypoScript ---------- :: page = PAGE page { 10 = FLUIDTEMPLATE 10 { file = EXT:pdfviewhelpers/Resources/Public/Example/Bithost.html } } plugin.tx_pdfviewhelpers.settings { config { class = Bithost\Pdfviewhelpers\Model\BithostTCPDF language = eng } document { title = Bithost document subject = Autogenerated PDF, By Bithost GmbH author = Bithost GmbH keywords = Example, Test, Just to show how it works creator = TYPO3 pdfviewhelpers outputPath = bithost_example.pdf } } .. php: PHP --- A custom PHP class is needed if you want to add header and footer to all the pages or if you want to customize the behaviour of TCPDF in any way. :: , Bithost GmbH * Esteban Marin , Bithost GmbH * * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***/ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; /** * BithostTCPDF * * @author Markus Mächler , Esteban Marin */ class BithostTCPDF extends \TCPDF { /** * @return void */ public function Header() { $extPath = ExtensionManagementUtility::extPath('pdfviewhelpers'); $address = "Bithost GmbH \nMilchubckstrasse 83 \nCH-8057 Zürich \n\nhallo@bithost.ch \n044 585 28 20 \n\nwww.bithost.ch"; $this->SetTextColor(140, 140, 140); $this->SetFontSize(11); $this->Image($extPath . 'Resources/Public/Images/logo.png', 15, 15, 56, 24, '', '', '', FALSE, 300, '', FALSE, FALSE, 0, FALSE, FALSE, FALSE, FALSE); $this->MultiCell(null, null, $address, 0, 'R', FALSE, 1, 0, 45, TRUE, 0, FALSE, TRUE, 0, 'T', FALSE); } /** * @return void */ public function Footer() { } } .. _fluid: Fluid Template -------------- :: {namespace pdf=Bithost\Pdfviewhelpers\ViewHelpers} Zurich, now Welcome to the extension pdfviewhelpers Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Some more information Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren est Lorem ipsum dolor sit amet. Esteban Marín, Markus Mächler Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. PDF Output ---------- .. figure:: ../../Resources/Public/Images/example_pdf.png :width: 600px :align: left :alt: Bithost Example Rendered PDF document