.. ================================================== .. 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, header and footer, 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 = EXT:pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/Roboto.ttf } opensans { path = EXT:pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/OpenSans.ttf } } } } document { title = Full Feature Show Case Title subject = No Subject keywords = full, feature, show, case outputDestination = inline outputPath = fullfeatureshowcase.pdf } header { posY = 10 } page { margin { top = 25 right = 15 bottom = 25 left = 15 } } generalText { color = #555 } text { types { header { color = #8C8C8C } quote { fontStyle = italic alignment = center padding { top = 10 right = 50 bottom = 10 left = 50 } } } } headline { fontFamily = courier fontStyle = bold types { h1 { fontSize = 28 color = #ff642c } h2 { fontSize = 22 color = #ff642c } h3 { fontSize = 14 fontFamily = helvetica fontStyle = bold } } } list { color = #000 fontStyle = bold bulletColor = #BEDB39 padding { left = 2 } } } module.tx_pdfviewhelpers < plugin.tx_pdfviewhelpers .. _fullfeatureshowcase_php: PHP --- :: , 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 BasePDF { /** * @return void */ public function basePdfHeader() { } /** * @return void */ public function basePdfFooter() { $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 -------------- :: Bithost GmbH - Milchbuckstrasse 83 CH-8057 Zürich hallo@bithost.ch - www.bithost.ch Full Feature Show Case 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. ThisisalongtextWITHOUTautomatichyphenationbeingactivated. ThisisalongtextWITHautomatichyphenationbeingactivated. This text has increased lineHeight as well as increased characterSpacing. Custom fonts Custom font Open Sans automatically converted from TTF file. Custom font Roboto automatically converted from TTF file. Custom font Roboto even colored! Styled lists Text types It is possible to create an arbitrary amount of default text settings and easily apply them using the type attribute. This is a h1 headline This is a h2 headline This is a h3 headline This could be a quote style. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Only this page will have a different header Images in different sizes Images with different alignment 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
Position ViewHelpers This text will be rendered at position x={pdf:getPosX()} and y={pdf:getPosY()} PageNumber ViewHelpers We are on page {pdf:getPageNumberAlias()} of {pdf:getTotalNumberOfPagesAlias()} pages. Avoid page break inside EXT:pdfviewhelpers tries to avoid page breaks inside ViewHelpers that are wrapped with an AvoidPageBreakInsideViewHelper. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 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. That is why all these elements are rendered on the next page.
.. _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: 500px :align: left :alt: Full Feature Show Case rendered PDF | .. figure:: _assets/output_3.png :width: 700px :align: left :alt: Full Feature Show Case rendered PDF | .. figure:: _assets/output_4.png :width: 500px :align: left :alt: Full Feature Show Case rendered PDF | .. figure:: _assets/output_5.png :width: 500px :align: left :alt: Full Feature Show Case rendered PDF |