DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

PDF Controller 3

Created:2010-10-13T21:40:33
Changed by:dirk
Changed:2015-11-30T17:21:46
Classification:pdfcontroller
Description:http://typo3-pdfcontroller.de/ Offer a TYPO3 page for PDF download. Individual layout with background PDF file. Extra first page is possible. PDF Controller supports TYPO3 sessions and can used on restricted pages. The PDF Generator can handle responsive backend layouts and responsive grid elements - ready-for-use together with TYPO3 Start. The PDF engine is TCPDF.
Keywords:PDF, html2ps, postscript, tcpdf
Author:Dirk Wildt - Die Netzmacher
Email:http://wildt.at.die-netzmacher.de
Website:http://die-netzmacher.de
Language:en

img-1 img-2 PDF Controller 3pdfcontroller img-3

PDF Controller 3

http://typo3-pdfcontroller.de/ Offer a TYPO3 page for PDF download. Individual layout with background PDF file. Extra first page is possible. PDF Controller supports TYPO3 sessions and can used on restricted pages. The PDF Generator can handle responsive backend layouts and responsive grid elements - ready-for-use together with TYPO3 Start. The PDF engine is TCPDF.

img-4

Version: 4.2.0 - 2015-11-30

Extension Key: pdfcontroller

Language: en

Keywords: PDF, html2ps, postscript, tcpdf

Copyright 2011-2015, Dirk Wildt - Die Netzmacher, <http://wildt.at .die-netzmacher.de>

This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3 a GNU/GPL CMS/Framework available from www.typo3.org

Introduction

What does it do?

The PDF Controller 3 converts HTML to PDF.

  • The PDF Controller manages frontend user sessions.You can use the PDF Controller on pages which are restricted for frontend users.
  • The PDF Controller 3 has both plugins
    • a user interface and
    • a button
  • The button enables a quick start.
  • The PDF engine is TCPDF for TYPO3 (t3_tcpdf)
  • The extension PDF Controller 3 Additional Fonts (pdfcontroller_fonts) extends the default fonts of the PDF Controller 3.
  • You can extend the PDF Controller respectively TCPDF with your own fonts.
  • The PDF Controller 3 has support for some other extensions:
    • The PDF Controller 3 handles backend layouts and grid elements ready- for-use, if you are using Start – the Starter Kit for a responsive TYPO3. :sup:`0 <#sdfootnote1sym>`_
    • Organiser :sup:`0 <#sdfootnote2sym>`_ news are ready-for-use.

Restrictions and Incapacities

  • The CSS compatibility is on a poor level. It is similar like CSS for HTML in e-mails (newsletters).
  • The PDF Controller respectevely TCPDF seems not to be able to care of a proper pagebreak in tables, if the content of a row hasn't enough space on the current page and content is mixed with text and images. Maybe there are some more incapacities.
  • The PDF Controller hasn't a ready-for-use TypoScript for TYPO3 file elements.
  • The PDF Controller isn't compatible with the former PDF Controller upto version 2.x.
  • The PDF Controller should run in TYPO3 7.x. But this isn't tested!
Play with it!

Play with the PDF Controller at

Manual as PDF file

You find this manual as PDF file at

Website

The PDF Controller 3 has a website. Please visit

http://typo3-pdfcontroller.de/

Forum

The PDF Controller 3 has a forum (see Forum on page 40 below).

Installation

  • Install the extensions

    • TCPDF for TYPO3 (t3_tcpdf)
    • PDF Controller 3 (pdfcontroller)
    • PDF Controller 3 Additional Fonts (pdfcontroller_fonts)
  • Include the static TypoScript templates into the static template of your root page:

    • PDF Controller [1] (pdfcontroller) :sup:`0 <#sdfootnote3sym>`_
    • PDF Controller [1.1] +tt_content optimising (pdfcontroller) :sup:`0 <#sdfootnote4sym>`_
    • ...
    • PDF Controller [2] Ext: Slick (pdfcontroller) :sup:`0 <#sdfootnote5sym>`_
    • PDF Controller [2] Ext: Start (pdfcontroller) :sup:`0 <#sdfootnote6sym>`_ , :sup:`0 <#sdfootnote7sym>`_
    • PDF Controller [2.1] Ext: Start Gridelements (pdfcontroller) :sup:`0 <#sdfootnote8sym>`_
  • Create in your library folder (or everywhere) the page (not a folder!):

    PDF Controller

  • Add to the page PDF Controller the plugin PDF Controller User Interface.Check the first tab [Check!]. See details at section "Requirements" on page 8 below.

  • Add the plugin PDF Controller Button to the page, which should be downloadable as a PDF document.

  • Configure the plugin PDF Controller Button by the TypoScript Constant Editor. SeeCONSTANT EDITOR categories

    • [PDF CONTROLLER - PAGES USER INTERFACE]
    • [PDF CONTROLLER - URL]

That's all.

Test the PDF Controller 3: Click the PDF Controller button in your frontend.

Controlling

Workflow

Usually you like to provide a PDF download for the content of your page but neither for the header nor for the footer nor for navigation elements.

Frame1 Frame1 Frame1

pdfcontrollerPrint

Therefor the PDF Controller arranges a PAGE object called pdfcontrollerPrint. It takes the content elements of the current page from the default column (colpos = 0). The pdfcontrollerPrint page has the typeNum 67426.

You can see the PAGE pdfcontrollerPrint in the frontend by calling the current page with typeNum 67426 like

http://my-domain.com/index.php?id=277&type=67426

if the current page is the page with the id 277.

If you want to change the content, you have to edit the TypoScript of the PAGE object pdfcontrollerPrint.

If you get an unexpected result in your PDF file, you should inspect the CSS code and HTML code of this page.

Don't wonder: this page hasn't any HTML head by default.

pdfcontrollerPDF

The PDF Controller User Interface is called on the current page by typeNum 67425. This page is called pdfcontrollerPDF.

The PDF Controller button generates a link like

http://my-domain.com/index.php?id=277&type=67425

There isn't any need to configure the PAGE object pdfcontrollerPDF. Don't touch this TypoScript code!

Requirements

There isn't any special system requirement.

If you are using restricted pages – access for frontend users only – you have to set some TYPO3 frontend configurations for a proper session management.

Check it by the Plugin!

You can check your system supported by the plugin PDF Controller 3 User Interface. See

  • first tab [Check!] and
  • the last tab [Debugging]
[Check!]

Check for [FE][lockHashKeyWords]

[FE][lockHashKeyWords] must be empty.

You can configure the property by

  • Modul: System > Install > All configuration
  • Look for "lockHashKeyWords"

$TYPO3_CONF_VARS['FE']['lockHashKeyWords'] = '';

Check for [FE][lockIP]

[FE][lockIP] must be 0.

You can configure the property by

  • Modul: System > Install > All configuration
  • Look for "lockIP"

$TYPO3_CONF_VARS['FE']['lockIP'] = '';

PDF Properties

You can controll PDF properties by

  • the plugin / flexform
  • the TypoScript Constant Editor and
  • TypoScript directly.
Plugin / Flexform

You can configure by the plugin /flexform in principle

  • path to your PDF template file
  • PDF page margins
  • PDF page margins for the fist page
  • Default fonts :sup:`0 <#sdfootnote9sym>`_
  • CSS properties for a a -tag
  • images scaling factor

Layout Restrictions

CSS

The CSS compatibility is on a poor level. It is similar like CSS for HTML in e-mails (newsletters).

Any CSS by default

Please take care of the default TypoScript configuration:

pdfcontrollerPrint.config.disableAllHeaderCode is disabled by default.This effects both:

  • any CSS isn't included by default
  • pdfcontrollerPrint.includeCSS will ignored.
Include your CSS
CSS properties
Rules

The CSS compatibility is on a small level. It is similar like CSS for HTML in e-mails (newsletters).

Please take care of some rules

/*

* Don't use:

* h1, h2 { ...

* Use only:

* h1 { ...

* h2 { ...

*

* Isn't supported:

* * a

* * color : Use the PDF Controller user interface (flexform). See tab [tags].

* * text-decoration : Use the PDF Controller user interface (flexform). See tab [tags].

* * border : There isn't any alternate. But see the details at margin below.For a border-top or a border-bottom you can use a empty line <p>&nbsp;</p>.For a border-left and a border-right you can use an empty column like<td>&nbsp;</td>, if it is within a table.

* * line-height : There isn't any alternate.

Internal note: :TODO: TCPDF::setCellHeightRatio( )

* * list-style-type : There isn't any alternate.

Internal note: :TODO: TCPDF::setListIndentWidth( ), TCPDF::setLIsymbol( )

* * margin : Use TypoScript plugin.tx_pdfcontroller.settings.pdf.css.margin

* You can add every tag

* Internal note: TCPDF::setHtmlVSpace( )

* * padding : There isn't any alternate. But see the details at margin above.

*/

Sample

body {

color: green;

font-family: helvetica;

}

h1 {

color: orange;

font-family: times;

font-size: 24pt;

text-decoration: underline;

}

h2 {

color: brown;

font-family: courier;

font-size: 16pt;

}

p {

color: red;

font-family: helvetica;

font-size: 12pt;

}

Pagebreak

@media print {

h1 {

page-break-before:always;

}

div {

page-break-before:auto;

}

#content {

page-break-before:avoid;

}

}

CSS property explanation:

http://wiki.selfhtml.org/wiki/CSS/Eigenschaften/Druckausgabe (German)

HTML

HTML should be simple as possible.

DIV

Don't try to configure DIV-tags. There isn't any chance. The will handled like P-tags.

TABLE
CAPTION

Avoid the TABLE property CAPTION. CAPTION will handled as a column – like a TD tag. CAPTION will destroy your TABLE layout.

Mixed units

Avoid to mix units! For example: It isn't recommended to use per cent and pixels for the width of TD-tags within the same TABLE.

Optimisation by the PDF Controller

The PDF Controller optimises some HTML, if you include the static template:

PDF Controller [1.1] +tt_content optimising (pdfcontroller)

Images
Move <div> to <table>

Images are wrapped with <div>-tags by default. But <table>-tags are the proper one. See the TypoScript code snippet below.

[globalVar = GP:type = {$plugin.pdfcontroller.pages.print.typeNum}]

## images

tt_content.image {

20 {

1 {

layout {

default {

element := appendString ( <br /> )

}

}

}

layout {

# above-center

default {

value (

<table cellspacing="0" cellpadding="0" style="width:100%;" class="columns01">

<tr>

<td>

###IMAGES###

</td>

</tr>

<tr>

<td>

###TEXT###

</td>

</tr>

</table>

)

override >

}

# above-right

...

}

renderMethod = simple

rendering {

simple {

imageStdWrapNoWidth.wrap = |

imageStdWrap.dataWrap = |

caption.wrap = <p>|<br /><br /></p>

}

}

}

}

[global]

Constant Editor

PDF CONTROLLER - BUTTON

button.icon

Property

button.icon

Data type

string

Description

Path to the button icon.

Default: EXT:pdfcontroller/Resources/Public/Images/pdf.png

PDF CONTROLLER - CONFIG

config.disableAllHeaderCode

Property

config.disableAllHeaderCode

Data type

boolean

Description

disableAllHeaderCode: If is set, none of the features of the PAGE object is processed but the content of the page. There isn't nor <HTML>-tag neither a default CSS among others.

Default: 1

PDF CONTROLLER – PAGES PDF

This effects the PAGE object pdfcontrollerPDF

pages.pdf.typeNum

Property

pages.pdf.typeNum

Data type

string

Description

typeNum: type number for the PAGE, which generates the PDF. Recommended 67425. Use another number, if you are still using 67425.

Default: 67425

PDF CONTROLLER – PAGES PRINT

This effects the PAGE object pdfcontrollerPrint

pages.print.typeNum

Property

pages.print.typeNum

Data type

integer

Description

typeNum: type number for the PAGE, which is optimised for printing. Recommended 67426. Use another number, if you are still using 67426.

Default: 67426

pages.print.header

Property

pages.print.header

Data type

string

Description

header: My header content.

Default: See @ TypoScript at plugin.tx_pdfcontroller.settinmgs.master_templates.print...

pages.print.strftime

Property

pages.print.strftime

Data type

string

Description

time format: PHP function strftime. Example for German language: Gedruckt am %d.%m.%y um %T Uhr

Default: printed at %y/%m/%d %T

PDF CONTROLLER – PAGES USER INTERFACE

pages.userinterface.pid

Property

pages.userinterface.pid

Data type

integer

Description

Page ID*: *OBLIGATED: ID of the page, which contains the PDF user interface.

PDF CONTROLLER – URL

url

Property

url

Data type

string

Description

Url*: *OBLIGATED: Domain of your website with ending slash. F.e: http://die-netzmacher.de/

Default: http://my-example.com

PDF CONTROLLER – VIEW

templateRootPath

Property

templateRootPath

Data type

string

Description

Templates: Path to the templates

Default: EXT:pdfcontroller/Resources/Private/View/Templates/

partialRootPath

Property

partialRootPath

Data type

string

Description

Partials: Path to the partials

Default: EXT:pdfcontroller/Resources/Private/View/Partials/

layoutRootPath

Property

layoutRootPath

Data type

string

Description

Layouts: Path to the layouts

Default: EXT:pdfcontroller/Resources/Private/View/Layouts/

Reference

PAGE

pdfcontrollerPDF
pdfcontrollerPDF

Property

pdfcontrollerPDF

Data type

PAGE

Description

pdfcontrollerPDF < plugin.tx_pdfcontroller.settings.master_templates.pdf
pdfcontrollerPrint
pdfcontrollerPrint

Property

pdfcontrollerPrint

Data type

PAGE

Description

pdfcontrollerPrint < plugin.tx_pdfcontroller.settings.master_templates.print

tt_content

tt _content.image
tt_content.image

Property

tt_content.image

Data type

Array

Description

[globalVar = GP:type = {$plugin.pdfcontroller.pages.print.typeNum}]
  ## images
  tt_content.image {
    20 {
      1 {
        layout {
          default {
            element := appendString ( <br /> )
          }
        }
      }
      layout {
        # above-center
        default {
          value (
            <table cellspacing="0" cellpadding="0" style="width:100%;" class="columns01">
              <tr>
                <td>
                  ###IMAGES###
                </td>
              </tr>
              <tr>
                <td>
                  ###TEXT###
                </td>
              </tr>
            </table>
)
          override >
        }
        # above-right
        ...
      }
      renderMethod = simple
      rendering {
        simple {
          imageStdWrapNoWidth.wrap = |
          imageStdWrap.dataWrap = |
          caption.wrap = <p>|<br /><br /></p>
        }
      }
    }
  }
[global]

tx_pdfcontroller: PDF Controller User Interface

plugin.tx_pdfcontroller.settings is the former plugin.tx_pdfcontroller_pi1.

settings.flexform
flexform

Property

flexform

Data type

array

Description

All values of the flexform can processed and changed by TypoScript.

This is a sample for changing the path to PDF template.

The path is configured by the flexform and is by default:

typo3conf/ext/pdfcontroller/Resources/Public/Pdf/typo3-pdfcontroller.p df

If you want to become familiar with all available flexform values , please take alook into the files of the folder:

Configuration/Flexforms/Pdf/*.xml

Sample

The snippet below enables to use a PDF draft for a job depending on the company, who offers the job. Each company has a different logo. If a company uid isn't defined in the TypoScript, there will be an error prompt in the frontend.

plugin.tx_pdfcontroller {
  settings {
    flexform {
      template {
        filepath = TEXT
        filepath {
          data = GP:tx_browser_pi1|jobUid
        }
        filepath >
        filepath = CONTENT
        filepath {
          table = tx_org_headquarters
          select {
            pidInList = {$plugin.org.sysfolder.headquarters}
            join = tx_org_mm_all ON tx_org_mm_all.uid_local = \
                   tx_org_headquarters.uid
            where {
              data = GP:tx_browser_pi1|jobUid
              noTrimWrap = |tx_org_mm_all.uid_foreign = | \
                        AND tx_org_mm_all.table_local = 'tx_org_headquarters' \
                        AND tx_org_mm_all.table_foreign = 'tx_org_job'|
            }
            orderBy = tx_org_headquarters.title
          }
            // tx_org_news.title croped and linked
          renderObj = CASE
          renderObj {
            key {
              field = uid
            }
            default = TEXT
            default {
              value = Company {field:title} (uid #{field:uid}) isn't part \
                      of TypoScript. Please see: Home/Jobs/Detail [109] > \
                      +ext_pdfcontroller_074
              noTrimWrap = |: ||
              insertData = 1
            }
            8 = TEXT
            8 {
              value = fileadmin/jobofferByCompany08.pdf
            }
            12 = TEXT
            12 {
              value = fileadmin/jobofferByCompany12.pdf
            }
            ...
          }
        }
      }
    }
  }
}
settings.master_templates
master_templates

Property

master_templates

Data type

array

Description

plugin.tx_pdfcontroller {
  settings {
    master_templates {
      pdf = PAGE
      pdf {
        config {
          ... <- Please inspect code by the TypoScript Object Browser
        }
        typeNum = {$plugin.pdfcontroller.pages.pdf.typeNum}
        10 = COA
        10 {
          ... <- Please inspect code by the TypoScript Object Browser
        }
      }
      print = PAGE
      print {
        config {
          ... <- Please inspect code by the TypoScript Object Browser
        }
        typeNum = {$plugin.pdfcontroller.pages.pdf.typeNum}
        10 = COA
        10 {
          ... <- Please inspect code by the TypoScript Object Browser
        }
      }
    }
  }
}
settings.pdf.css.margin
pdf.css.margin

Property

pdf.css.margin

Data type

array

Description

plugin.tx_pdfcontroller {
  settings {
    pdf {
      css {
        margin {
            // bottom, top
          div =
          div {
              // value: 0, times: 0
            bottom =
            bottom {
              value = 0
              times = 0
            }
              // value: 0, times: 0
            top =
            top {
              value = 0
              times = 0
            }
          }
            // bottom, top
          h1 < .div
            // bottom, top
          h2 < .div
            // bottom, top
          h3 < .div
            // bottom, top
          ol < .div
          ol {
              // value: 1, times: 3
            bottom =
            bottom {
              value = 1
              times = 3
            }
          }
            // bottom, top
          p < .div
            // bottom, top
          ul < .ol
        }
      }
    }
  }
}
settings.pdf.filename
pdf.filename

Property

pdf.filename

Data type

COA

Description

plugin.tx_pdfcontroller {
  settings {
    pdf {
      filename = COA
      filename {
          // page : title
        10 = TEXT
        10 {
          stdWrap {
            data = page : title
            htmlSpecialChars = 1
          }
          wrap = |
        }
          // date
        30 = TEXT
        30 {
          data      = date : U
          strftime  = %Y%m%d%H%M%S
          wrap      = _|
        }
          // extension pdf
        50 = TEXT
        50 {
          value = pdf
          wrap  = .|
        }
      }
    }
  }
}
settings.pdf.pageproperties
pdf.pageproperties

Property

pdf.pageproperties

Data type

array

Description

plugin.tx_pdfcontroller {
  settings {
    pdf {
      pageproperties {
          // page : author
        documentAuthor = CONTENT
        documentAuthor {
          table = pages
          select {
            where = 1 OR (uid = {page:uid} AND pid >= 0)
            where {
              insertData = 1
            }
            max = 1
          }
          renderObj = TEXT
          renderObj {
            field = author
          }
        }
          // page : keywords
        documentKeywords < .documentAuthor
        documentKeywords {
          renderObj {
            field = keywords
          }
        }
          // page : description
        documentSubject < .documentAuthor
        documentSubject {
          renderObj {
            field = description
          }
        }
          // page : title
        documentTitle < .documentAuthor
        documentTitle {
          renderObj {
            field = title
          }
        }
      }
    }
  }
}
settings.pid.userinterface
pid.userinterface

Property

pid.userinterface

Data type

integer

Description

plugin.tx_pdfcontroller {
  settings {
    pid {
      userinterface = {$plugin.pdfcontroller.pages.userinterface.pid}
    }
  }
}
settings.typeNum
typeNum

Property

typeNum

Data type

array

Description

plugin.tx_pdfcontroller {
  settings {
    typeNum {
      pdf   = {$plugin.pdfcontroller.pages.pdf.typeNum}
      print = {$plugin.pdfcontroller.pages.print.typeNum}
    }
  }
}
view
view

Property

view

Data type

array

Description

plugin.tx_pdfcontroller {
  view {
    templateRootPath = {$plugin.tx_pdfcontroller.view.templateRootPath}
    partialRootPath = {$plugin.tx_pdfcontroller.view.partialRootPath}
    layoutRootPath = {$plugin.tx_pdfcontroller.view.layoutRootPath}
  }
}

tx_pdfcontroller_pi2: PDF Controller Button

button
button

Property

button

Data type

IMAGE

Description

plugin.tx_pdfcontroller_pi2 {
  button = IMAGE
  button {
    wrap = |&nbsp;
    file = {$plugin.pdfcontroller.button.icon}
    altText {
      stdWrap {
        cObject = TEXT
        cObject {
          value = Download content as PDF file
          lang {
            de = Inhalt als PDF-Datei herunterladen
            en = Download content as PDF file
          }
        }
      }
    }
    titleText < .altText
    imageLinkWrap = 1
    imageLinkWrap {
      enable = 1
      typolink {
        parameter {
          cObject = COA
          cObject {
              // url
            10 = TEXT
            10 {
              data = page:uid
            }
              // target
            20 = TEXT
            20 {
              value       = _blank
              noTrimWrap  = | "|"|
            }
              // class
            30 = TEXT
            30 {
              value       = -
              noTrimWrap  = | "|"|
            }
              // title
            40 = TEXT
            40 {
              value = Download content as PDF file
              lang {
                de = Inhalt als PDF-Datei herunterladen
                en = Download content as PDF file
              }
              noTrimWrap  = | "|"|
            }
          }
        }
        additionalParams  = &type={$plugin.pdfcontroller.pages.pdf.typeNum}
          // #i0024, 150904, dwildt, 4+
        addQueryString    = 1
        addQueryString {
          exclude = id, cHash
        }
        ATagParams        = rel="nofollow"
      }
    }
  }
  text = TEXT
  text {
    ... <- See next section below
  }
}
text
text

Property

text

Data type

TEXT

Description

plugin.tx_pdfcontroller_pi2 {
  text = TEXT
  text {
    value = PDF Download
    lang {
      de = PDF Download
      en = PDF Download
    }
    typolink {
      ... <- See typolink from button in the section from above
    }
  }
}

Extensions

Grid elements (by Start)
start.gridelements.1 to 6
start.gridelements.x

Property

start.gridelements.x

Data type

array

Description

start.gridelements {
  1 {
    columns.default.wrap.noTrimWrap = |<td class="columns |">|
    columns.default.wrap2 = |</td>
    wrap.stdWrap.cObject.10.value = <table class="row columns01
    wrap.stdWrap.cObject.30.value = "><tbody><tr>|</tr></tbody></table>
  }
  ...
}

tt_content.gridelements_pi1.20.10.setup.1 < start.gridelements.1
tt_content.gridelements_pi1.20.10.setup... < start.gridelements...
start.structure.inlineCss
structure.inlineCss

Property

structure.inlineCss

Data type

array

Description

start {
  structure {
    inlineCss {
      pdfcontroller = TEXT
      pdfcontroller {
        value (
<style>
  table.columns01 { width:100%; }
  table.columns02 { width:100%; }
  table.columns03 { width:100%; }
  table.columns04 { width:100%; }
  table.columns05 { width:100%; }
  table.columns06 { width:100%; }

  table.columns01 tr td { width:100%; }
  table.columns02 tr td { width:49%; }
  table.columns03 tr td { width:32%; }
  table.columns04 tr td { width:23.5%; }
  table.columns05 tr td { width:18.4%; }
  table.columns06 tr td { width:15%; }

  table.columns02 tr td.space { width:2%; }
  table.columns03 tr td.space { width:2%; }
  table.columns04 tr td.space { width:2%; }
  table.columns05 tr td.space { width:2%; }
  table.columns06 tr td.space { width:2%; }

  .align-center { text-align:center; }
  .align-left { text-align:left; }
  .align-right { text-align:right; }

  .csc-header-alignment-center { text-align:center; }
  .csc-header-alignment-left { text-align:left; }
  .csc-header-alignment-right { text-align:right; }
</style>
)
      }
    }
  }
}
Start – Starter Kit for a responsive TYPO3
PAGE
pdfcontrollerPrint

Property

pdfcontrollerPrint

Data type

PAGE

Description

pdfcontrollerPrint >
pdfcontrollerPrint < plugin.tx_pdfcontroller.settings.extensions.start.master_templates.print
settings.extensions.start.master_templates.print
master_templates.print

Property

master_templates.print

Data type

PAGE

Description

plugin.tx_pdfcontroller {
  settings {
    extensions {
      start {
        master_templates {
          print = PAGE
          print {
            ... -> Please inspect it by the TypoScript Object Browser
          }
        }
      }
    }
  }
}

Fonts

Install custom fonts

This is an example for TTF-fonts (True Type Fonts) only.

See details at:

Create a font directory

Create a font directory like

  • fileadmin/myfonts :sup:`0 <#sdfootnote10sym>`_
  • typo3conf/ext/myextension/fonts :sup:`0 <#sdfootnote11sym>`_
Sample directories
  • TCPDF tools/var/www/mytypo3/typo3conf/ext/t3_tcpdf/tcpdf/tools$
  • TTF-files source folder (input folder in the samle below: -i)~/Downloads/
  • TTF-files destination folder (output folder in the samle below: -o)/var/www/mytypo3/typo3conf/ext/pdfcontroller_fonts/fonts
Move *.ttf to TCDF font definition files

name@server :/var/www/mytypo3/typo3conf/ext/t3_tcpdf/tcpdf/tools$

./tcpdf_addfont.php -b -t TrueTypeUnicode -f 32 -o /var/www/typo3_62.local/typo3conf/ext/pdfcontroller_fonts/fonts

-i ~/Downloads/Noto_Sans/NotoSans-BoldItalic.ttf

Update the PDF Controller Interface

Tab [Fonts] > field "Relative path to my fonts directory"

Enter your path. I.e: fileadmin/myfonts :sup:`0 <#sdfootnote12sym>`_

Run the PDF Controller

Run the PDF Controller in the frontend once.

Remove installed Fonts
  • Remove the extension PDF Controller Fonts (pdfcontroller_fonts)
  • Update the extension TCPDF for TYPO3 (t3_tcpdf)

Debugging

You can get a report for debugging and development purposes in the frontend and the backend.

Please us the tab [Debugging] of the plugin of the PDF Controller 3 User Interface.

If you are enabling the DRS (Development Reporting System), you will get a report in the devlog. :sup:`0 <#sdfootnote13sym>`_

Mode

Production (default)

Get your website content as PDF file.

Test: Display HTML

Get your website content as HTML file. You can check, which HTML will delivered to the PDF generator.

Test: TCPDF example 61 "XHTML+CSS" (HTML)

TCPDF provides a lot of samples on the TCPDF website.

This test enables you to check, if your server generates the needed HTML of the TCPDF webiste.

You can compare the HTML code – especially the CSS code – with the HTML code, which you are using for PDF generating. If something isn't running proper, maybe you are able to find the unproper HTML code or the unproper CSS code.

Test: TCPDF example 61 "XHTML+CSS" (PDF)

TCPDF provides a lot of samples on the TCPDF website. This test enables you to check, if your server generates the same PDF like the server of the TCPDF webiste. It should be the same PDF file. If it isn't, maybe the PDF Controller doesn't run proper.

PDF file for comparison: http://www.tcpdf.org/examples/example_061.pdf

Development: Display TypoScript

This dsiplays the TypoScript, which is the base for TYPO3 for rendering the HTML or PDF file.

If something isn't running proper, maybe you are able to find the unproper TypoScript code.

DRS (Development Reporting System)

You need the extension

Developer Log (devlog)

If you are enabling the DRS (Development Reporting System), you will get a report in the devlog.

All: errors, warnings and infos

The PDF Controller sends all prompts to devlog.

Session-management

The PDF Controller sends prompts to devlog in context with the session management.

The PDF Controller prompts the

URL with theFE_SESSION_KEY

among others, if a fe_user is logged in.

You can check, if this URL is proper:

  • Take a browser without any current session.
  • Copy this URL into the address field of the Browser.
  • If the Browser displays the content for fe_users, which are logged in, everything seem's to be proper.
  • If it displays content for fe_users, which aren't logged in, the URL isn't proper.

3rd party!

The PDF Controller supports third party extensions respectevely third party extensions supports the PDF Controller.

Suppor means:

  • Usually the HTML code is optimised for a responsive layout.
  • But TCPDF can't handle the CSS of a responisve layout in principle.

The PDF Controller optimise HTML and CSS of the third party extension from below. Optimisation doesn't mean, that you will get a one-to-one layout.

Grid Elements

The PDF Controller optimises the HTML of the grid elements, if they are arranged by Start – Starter Kit for a responsive TYPO3. The optimisation is ready-to-use. If you are using your own grid elements, you can adapt the PDF Controller to you needs by configuring your TypoScript.

Frame1

Organiser – TYPO3 for Lobby and Organisers

The news modul of the Organiser – TYPO3 for Lobby and Organisers – has a template for the PDF Controller. A TYPO3 integrator hasn't nothing to do: news in list views and news in single views are optimised for the PDF Controller by default.

See samples for a list view:

Select a news from the list view, to check a single view in HTML and PDF.

If you are using the Organiser, you need it from version 7.5.x

img-6 img-7 img-8 img-9

Illustration above: organiser news list view in HTML (left) and as PDF file

Slick – responsive Carousel and Slider

If you like to optimise content, which is delivered by Slick – responsive Carousel and Slider –, please use the static template

PDF Controller [2] Ext: Slick (pdfcontroller)

Start – Starter Kit for a responsive TYPO3

If you like to optimise content, which is delivered by Start – Starter Kit for a responsive TYPO3 –, please use the static templates

  • PDF Controller [2] Ext: Start (pdfcontroller)
  • PDF Controller [2.1] Ext: Start Gridelements (pdfcontroller)

Frame1

What's new

4.x

Flexform values

[4.2.0]

Flexform values got the TypoScript property Content Object. See the sample at:

Reference: pdfcontrollerPDF on page 16 above

Grid Elements

[4.1.1]

Template for the Grid Eelements of Start – Starter Kit for a responsive TYPO3.

Session handling

[4.0.0]

The PDF Controller handels sessions. You can use it on restricted pages.

Slick – responsive Carousel and Slider

[4.1.2]

Template for Slick – responsive Carousel and Slider.

Start – Starter Kit for a responsive TYPO3

[4.1.1]

Template for Start – Starter Kit for a responsive TYPO3.

tt_content optimisation

[4.1.0]

Template

TYPO3 7.x

[4.0.0]

The PDF Controller should run in TYPO3 7.x. But this isn't tested!

3.x

Corporate Design

[3.1.0]

Background of any generated PDF is a PDF file. This PDF file can designed individually.

Extra first page

[3.1.0]

Background of any generated PDF is a PDF file. If your PDF file contains two pages, the first page is only used for the first page of the generated PDF file.

TCPDF

[3.1.0]

New PDF engine tcpdf.

Upgrades

From 3.x to 4.x

Save plugin values before the Upgrade

Please save your plugin values, before you upgrade the PDF Controller by the extension manager.

TypoScript

TypoScript is moved from plugin.tx_pdfcontroller_pi1 to plugin.tx_pdfcontroller.settings.

Keep it in mind, if you have to update the setup of your TypoScript.

Plugin

Set selected plugin to [PDF Controller: User Interface].

Compare the saved plugin values from above with the current plugin values. Adapt the current values to your needs.

From 2.x to 3.x

The PDF Controller 3 has a new PDF engine: TCPDF. The former engine was HTML2PS.

Therefor an upgrade isn't possible. Sorry for the trouble.

Further Information

Other extensions published by Die Netzmacher

  • img-10 +AOE Linkhandler Configurator: Configure the AOE linkhandler supported by userinterfaces. Out-of-the-box templates for cal, org, tt_news and tt_products. Don't edit page TSconfig any longer. http://typo3.org/extensions/repository/view/linkhandlerconf/
  • img-11 autositemap: A smart site-map optimised for the footer. It groups menus in columns. Great menus will get two columns. Configuration is based on TypoScript HMENU. http://typo3.org/extensions/repository/view/autositemap/
  • img-12 Browser – TYPO3 without PHP. Develop your TYPO3 extension 8 times faster! You need one line TypoScript for a result list with a search form, a record browser and an index browser. Images are wrapped self-acting. SEO, Search Engine Optimization, is integrated. http://typo3-browser.de/
  • img-13 Caddy – the TYPO3 shopping cart. You can use it for your own needs. You need a database with products or any other items only. You can install Caddy out of the box with one mouse click – see Quick Shop below. http://typo3-caddy.de/
  • img-13 Deal! – TYPO3 Quick Shop interface for the marketplace ebay. Manage all items with TYPO3 and publish it on ebay. Amazon is under construction. http://typo3-deal.de/
  • img-14 Duty – collection of helpful scheduler tasks. Here: remove deprecated files from directories. http://typo3.org/extensions/repository/view/duty/
  • img-15 Flip it! offers lovely and smooth page flip transitions. It enables you to run over pages in PDF documents like in a real magazine. It is based on flash. Flipt it! can convert PDF documents to swf files automatically. http://typo3.org/extensions/repository/view/flipit/
  • img-16 Jobmarket is a catalogue with job offers. Views, the a-z-browser, the page-browser, the search, social bookmarks and a lot of other stuff can configured by the Browser plugin with the mouse. http://typo3-job-market.de/
  • img-17 Organiser – TYPO3 for the lobby and the organisers. Handle news, events, staff, headquarters, locations, workshops and a calendar with one extension. Sell online tickets! Install the Organiser with one mouse click! http://typo3-organiser.de/
  • img-13 Quick Shop – the fastest shop in the history of TYPO3. Install it with one mouse click! Quick Shop is based on the browser (see above) and powermail. http://typo3-quick-shop.de/
  • img-3 PDF Controller: Offer a TYPO3 page for PDF download. Individual layout with background PDF file. TYPO3 sessions are supported. Handling of responsive backend layouts and grid elements possible. PDF engine is TCPDF. http://typo3-pdfcontroller.de/
  • img-18 Radial Search (Umkreissuche) – Enable the browsing through your data by geo location. 'Your data must have a latitude and a longitude. Address data can geocoded automatically by the Browser - TYPO3 without PHP. http://typo3.org/extensions/repository/view/radialsearch/
  • img-18 Route – Publish your routes with GoogleMaps or OpenStreetMap. Routes have points of interest (POI). You can categorise and filter both: routes and POI. Address data can geocoded automatically. http://typo3-route.de/
  • img-19 seo_dynamic_tag: Search Engine Optimization for the title tag, the canonical tag and the meta tags author, description and keywords. Configuration by a user interface. http://typo3.org/extensions/repository/view/seo_dynamic_tag/
  • img-20 Slick - jQuery Carousel: Fully responsive. Scales with its container. Separate settings per breakpoint. Uses CSS3 when available. Swipe enabled. Desktop mouse dragging. Infinite looping. Fully accessible. http://typo3-slick.de/
  • img-21 Start is installing and managing a responsive TYPO3. Provides a dozen ready-to-use backend layouts and some grid-layouts. Template is included for a responsive newsletter. Based on the responsive framework Foundation (Zurb). http://start-typo3-responsive.de/
  • img-22 TSconfig Pages and Users by extManager (extkey: tsconf): Configure the the eight most commonly used TSconfig porperties with the mouse - like page tree uids, activated extended view, activated clipboard, ... http://typo3.org/extensions/repository/view/tsconf/

SEO - Search Engine Optimisation

You are optimising your website for search engines in principle, that your content will be found and indexed in a meaningful context.

But if your are offering an HTML page for PDF download and for optimised printing, you don't like the a twice or triple indexing - because of performance.

rel="nofollow"

Links to the pdf controller shouldn't indexed by default.

The <a> tag has the property rel="nofollow"

This effects that search engines doesn't follow the link - they don't download your PDF document. They don't index it.

That's what you want.

If you have a need to index PDF documents by search engines, please remove the TypoScript ATagParams. See the snippet below.

TypoScript snippet

plugin.tx_pdfcontroller_pi2 {

button = IMAGE

button {

...

imageLinkWrap {

enable = 1

typolink {

...

ATagParams = rel="nofollow"

}

}

}

}

Credits

Netconsult AG

[3.0.0]

Thanks to the Netconsult AG, who contracted a part the integration of TCDPDF for TYPO3 (t3_tcpdf) into the PDF Controller.

NetConsult AG, Bern, Switzerland http://www.netconsult.ch/

typo3-lisardo.de

[2.0.0]

Peter Linzenkirchner contracted a part of the 2.0 upgrade:

http://www.typo3-lisardo.de/

web-arts.ch

[2.0.0]

Angelo Previtali contracted a part of the 2.0 upgrade:

http://www.web-arts.ch/

TYPO3 Security Team

[1.1.1]

Thanks to the TYPO3 Security Team for a commendable support - especially to Franz G. Jahn.

Helpful suggestions

Forum

If you have helpful suggestions, feel free to publish any question, bug or code snippet on

http://forum.typo3-pdfcontroller.de/

Posts are welcome in English and German.

Change log

4.2.0 Feature * #i0038: Flexform values got the TypoScript property Content Object

4.1.6 Improvement * #i0037: locallang* #i0036: Manual: section upgrade 3.x -> 4.x

4.1.5 Improvement * #i0035: favicon* #i0034: Improvement tt_content.image caption

4.1.4 Improvement * #i0033: Extension description

4.1.3 Improvement * #i0031: tt_content optimisation: image caption got the wrap <p class="caption">|<br /></p>

4.1.2 New Features * #i0030: slick optimisation for tt_content.images Improvement * #i0029: tt_content optimisation added for image layout: 1, 2, 8, 9, 10, 17, 18* #i0028: td.space for grid elements Bugfix * #i0027: <tr> was missing in typoscript for grid elements

4.1.1 New Feature * #i0025: Support for Start: grid layouts* #i0024: addQueryString Improvement * #i0023: Flexform tab sDEF is removed* #i0022: Suggests pdfcontroller_fonts

4.1.0 New Feature * #i0021: Constant for config.disableAllHeaderCode* #i0020: Template for tt_content optimisation* #i0019: Support for startEffected files:* Configuration/TypoScript/Extensions/Start (new)* Resources/Private/Extensions/Start/Templates (new)

4.0.6 Improvement * #i0018: Check for [ 'FE' ][ 'lockIP' ]* #i0017: _ffValue: error prompt* #i0016: Labeling *.xlf

4.0.5 Improvement * #i0015: Update Manual

4.0.4 Improvement * #i0014: Flexform with DRS

4.0.3 Update * #i0013: Manual with CSS sample for images

4.0.2 Update * #i0012: Manual with CSS sample

4.0.1 Bugfix * #i0011: XML: missing tagResources/Private/Language/de.locallang_db.xlf

4.0.0 Major Features * #i0010: Preparation for TYPO3 7.x* #i0009: Session handling

3.1.1 Improvement * #i0008: Constant Editor: new property url. Bugfix * #i0007: PHP Warning: in_array() expects parameter 2 to be array,null given in Classes/Userfunc/Flexforms/Controller.php line 181

3.0.0 Feature * #i0005: Constant Editor: page.pdf_button. Id of the page, which contains the PDF Controller button.Moved* plugin.tx_pdfcontroller_pi2.page.pdf_controller > plugin.pdfcontroller.pages.userinterface.id* plugin.tx_pdfcontroller_pi2.realUrl.print > plugin.pdfcontroller.realUrl.print* plugin.tx_pdfcontroller_pi2.typeNum.print > plugin.pdfcontroller.pages.print.typeNum

2.0.4 Manual * #i0004: Update

2.0.3 SECURITY FIX! * #i0003: Fix against Cross-Site ScriptingDone by Christian Bernet, http://www.bernetimux.ch/

2.0.2 Bugfix * #i0001: Class t3lib_extMgm is moved to TYPO3CMSCoreUtilityExtensionManagementUtility Improvement * #i0002: state is moved from alpha to beta

2.0.0 Major Feature * #62278: Upgrade TYPO3 6.2#62285: PHP 5.4 E_ALL & ~E_STRICT#62289: PHP 5: Call to undefined method FPDF::GetFontAscender()#62281: Warning in case of [FE][pageNotFoundOnCHashError]#53019: Depracted require() functions for Typo3 6.2* #47107: Manual: Configuration in case of HTML5 (HTML4)

1.4.3 Manual * #00000: Note frontend user sessions

1.4.1 Bugfix * #00000: Wrong TypoScript snippet is now proper in the manual

1.3.0 Bugfix * #36862: Additional Parameter has to encoded since TYPO 4.6Marker ###ADDITIONALPARAMS### is handled by rawUrlEncode( )Effected file:* pi2/class.tx_pdfcontroller_pi2.php Improvement * #00000: Two master template are added. One for a rawUrlEncode case, one for a realUrl case.* #00000: DRS got prompts for marker and typolink* #00000: Manual is updated

1.2.1 Bugfix * #36857: Missing index in systemcheck.php: JPG SupportEffected file:* res/html2ps_v2043/public_html/demo/systemcheck.php

1.2.0 New Features

* #36513: Enable Batch ProcessingCoded by Jonas Goetze http://forge.typo3.org/users/4345* #36228: Display PHP error messages – configurable by the plugin / flexformCoded by Ulfried Herrmann http://herrmann.at.die-netzmacher.de

1.1.4 Bugfix

* #34939: Get rid of PHP notice logsThanks to Alexander Krimm for the bug report

1.1.3 Improvement

* #34858: Usage of $ICON_TYPES is deprecated since 4.4.Thanks to Rene Staecker http://forge.typo3.org/users/1993

1.1.2 Bugfix

* #00000: SQL error in the query in context with development toolsThanks to Borries Jensen, who send the Bugfix.

* #00000: After clearing the dirs cache, out and temp each folder get a file index.html

1.1.1 New Feature * #33851: SEO rel="nofollow" Improvements * #00000: pi1/flexform_locallang.xml

1.1.0 Security fix

1.0.1 Improvements * #32516: Systemcheck should check fonts in directory of pdfcontroller_fonts* #32513: typeNum print template is configurable by the TypoScript constant editor* #32482: PDF Controller suggests to install Fonts

Bugfixes * #32518: Wrong field name for proxy in the flexform. Thanks to Borries Jensen* #31191: Missing folders temp and out. Thanks to Borries Jensen* #31190: Parameter are missing - without RealURL only. Thanks to Borries Jensen

1.0.0 Initial release

Illustration Index

Illustration 1: PDF Controller 3: Responsive TYPO3 to PDF 3

Illustration 2: Example for more than one page: first page can designed differently. 3

Illustration 3: PDF Controller 3 flexform 4

Illustration 4: index.php?id=x&type=0 7

Illustration 5: ... &type=67426 7

Illustration 6: ... =67425 7

Illustration 7: The PDF Controller 3 can move responsive HTML output to PDF, which is based on one of the six grid elements provided by Start. 31

Illustration 8: The PDF Controller 3 can move responsive HTML output to PDF, which is based on one of the 12 backend layouts provided by Start. 33

Alphabetical Index

67425

typeNum 7, 14

67426

typeNum 7, 14

Bugs 36

Button

icon 14

IMAGE 23

TEXT 24

config

disableAllHeaderCode 14

CSS 10

a 9, 11

align 25

border 11

Content Element 10

csc-header 25

disableAllHeaderCode 10

div 19

File 10

h1 19

h2 19

h3 19

HTML 12

inlineCss 25

line-height 11

list-style-type 11

margin 11, 19

ol 19

Own CSS 10

p 19

padding 11

Pagebreak 11

properties 11

rules 11

Sample 11

table 25

text-align 25

ul 19

Development

Production 29

Test

HTML 29

TCPDF sample 29

TypoScript 29

DRS 30

FE_SESSION_KEY 30

Session management 30

filename 20

Flexform 9

Typoscript 17

Fluidtemplates

Constant Editor 15

Fonts 28

default fonts 9

PDF Controller Additional Fonts 6

footer 18

Forum 40

Grid elements 25, 31

tt_content 25

HTML 12

CSS 10

DIV 12

TABLE 12

CAPTION 12

units 12

Images 13

Scaling factor 9

tt_content 16

margin

CSS 19

master-templates 18

PAGE 18

pdf 18

print 18

Organiser 32

PAGE

master-templates 18

pdfcontrollerPDF 7, 16

Constant Editor 14

pdfcontrollerPrint 7, 16

Constant Editor 14

PDF Controller Additional Fonts 6

PDF Properties

a-tag 9

author 21

default fonts 9

description 21

documentAuthor 21

documentKeywords 21

documentSubject 21

documentTitle 21

images scaling factor 9

keywords 21

page margins 9

pageproperties 21

PDF template 9

title 21

pdfcontrollerPDF

Constant Editor 14

typeNum 14

pdfcontrollerPrint

Constant Editor 14

copyright 14

header 14

Start 27

strftime 14

typeNum 14

Plugin 9

Requirements

Check 8

lockHashKeyWords 8

lockIP 8

Plugin 8

SEO 38

nofollow 38

Session management 30

Slick 32

Start 33

master 27

pdfcontrollerPrint 27

TCPDF 6

tt_content

gridelements 25

image 13, 16

Slick 26

slickslideshow 26

typeNum 22

67425 7, 14

67426 7, 14

TypoScript

flexform 17

Templates 6

url 15

User interface

pid 14, 21

view 22

0 You need Start from version 2.0.2. Currently it is a developer version only. Therefor it isn't available in the TYPO3 repository but in the SVN repository. https://forge.typo3.org/projects/extension-start/wiki . I try to publish Start 2.0.2 in the TER soon.

0 Organiser – TYPO3 for the Lobby and the Organisers: http://typo3-organiser.de

0 Position must be below the templates of CSS Styled Content and Grid Elements.

0 Optional: moves <div> to <table> in the image content element. Only in context with generating PDF.

0 Position must be below the templates of Slick.

0 Oprional: moves <div> to <table> in the fluid templates of the extension TYPO3 responsive Starter (start). Only in context with generating PDF.

0 Position must be below the templates of Start.

0 Recommended, if you are using the grid elements, which are delivered by Start.

0 Default fonts are used, if there isn't set any font by CSS

0 The absolute path must contain letter in lower case only!

0 dito

0 dito

0 You need the extension Developer Log (devlog)

45