.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../../Includes.txt .. _fullfeatureshowcase: Full Feature Show Case ====================== .. _fullfeatureshowcase_intro: Intro ----- This example is showing some of the features of the extension pdfviewhelpers including typography, custom fonts, lists, images, html, layout and settings inheritance. .. _fullfeatureshowcase_typoscript: TypoScript ---------- :: pdfpage = PAGE pdfpage { 10 = FLUIDTEMPLATE 10 { file = EXT:pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/Template.html } # ensure there is no other output apart from the pdf # take a look at the generated pdf file (end!) in a text editor to verify there is no other output # like warnings, error messages or html code config { disableAllHeaderCode = 1 xhtml_cleaning = 0 admPanel = 0 } } plugin.tx_pdfviewhelpers.settings { config { class = Bithost\Pdfviewhelpers\Model\FullFeatureShowCase jpgQuality = 80 fonts { addTTFFont { roboto { path = typo3conf/ext/pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/Roboto.ttf } opensans { path = typo3conf/ext/pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/OpenSans.ttf } } } } document { title = Full Feature Show Case Title subject = No Subject keywords = full, feature, show, case outputDestination = I outputPath = fullfeatureshowcase.pdf } page { margins { top = 20 right = 15 bottom = 20 left = 15 } } generalText { color = #555 } headline { fontFamily = courier fontStyle = B } list { color = #1F8A70 fontStyle = I bulletColor = #BEDB39 } } .. _fullfeatureshowcase_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! ***/ /** * FullFeatureShowCase * * @author Markus Mächler , Esteban Marin */ class FullFeatureShowCase extends \FPDI { /** * @return void */ public function Header() { $header1 = "Bithost GmbH - Milchbuckstrasse 83 CH-8057 Zürich"; $header2 = "hallo@bithost.ch - www.bithost.ch"; $this->SetTextColor(140, 140, 140); $this->SetFontSize(11); $this->MultiCell(null, null, $header1, 0, 'L', FALSE, 1, 15, 10, TRUE, 0, FALSE, TRUE, 0, 'T', FALSE); $this->MultiCell(null, null, $header2, 0, 'R', FALSE, 1, 15, 10, TRUE, 0, FALSE, TRUE, 0, 'T', FALSE); $this->SetDrawColor(140, 140, 140); $this->Line(15, $this->y + 5, $this->w - 15, $this->y + 5); } /** * @return void */ public function Footer() { $this->SetY(-20); $this->SetDrawColor(140, 140, 140); $this->Line(15, $this->y, $this->w - 15, $this->y); $this->SetY(-17); $this->SetTextColor(140, 140, 140); $this->SetFontSize(11); $this->Cell($this->w - 15, 10, 'Page '.$this->getAliasNumPage() . ' of '.$this->getAliasNbPages(), 0, false, 'C', 0, '', 1, false, 'T', 'M'); } } .. _fullfeatureshowcase_fluid: Fluid Template -------------- :: {namespace pdf=Bithost\Pdfviewhelpers\ViewHelpers} Full Feature Show Case Randomly showing some features of pdfviewhelpers. Typography Bold text Italic text Underlined text Colored text Alignment Left Alignment Center Alignment Right Text with special padding. 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. Text with normal paragraph spacing. Shown here. Text with extended paragraph spacing. Shown here. Text with even more extended paragraph spacing. Shown here. Custom fonts Custom font Open Sans automatically converted from TTF file. Custom font Roboto automatically converted from TTF file. Custom font Roboto even colored! Strangely styled lists Image in different sizes HTML content being styled externally

Headline 1

Headline 2

Headline 3

A Link to click

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.

Table

Head 1 Head 2 Head 3
Content 1 Content 2 Content 3
More Content 1 More Content 2 More Content 3
Content 1 Content 2 Content 3
.. _fullfeatureshowcase_output: PDF Output ---------- .. figure:: _assets/output_1.png :width: 500px :align: left :alt: Full Feature Show Case rendered PDF .. figure:: _assets/output_2.png :width: 700px :align: left :alt: Full Feature Show Case rendered PDF .. figure:: _assets/output_3.png :width: 500px :align: left :alt: Full Feature Show Case rendered PDF Rendered PDF document