How to … convert HTML-Content to PDF File in TYPO3

How to

On this nice evening i show you how to install and let the extension run …

Extension: pdf_generator2

TYPO3: Version 4.2.9

1. After you’ve downloaded the extension, go to the Extension-Manger in your Backend -> Install pdf_generator2

1.1 Don’t forget to click the “update” Button after installing. Because the following Errormessage will appear when forget clicking the “update” Button:

Error while trying the pdfconversion  Maybe the gen_pdf.php script was not executed at all

update

2. Then go to your Root Template and insert the following lines:

lib.pdf = TEXT
lib.pdf.value = generate pdf
lib.pdf.postUserFunc = tx_pdfgenerator2->makePdfLink
lib.pdf.postUserFunc.target = _blank
 

3. I use TemplaVoila and just mapped a small TypoScriptObject: lib.pdf

4. After cleaning the cache, update the database reference index my new link appears hot and sexy!!!

5. Possible Error:

I use a local XAMPP Installation where the PEAR Package is included. Something will go wrong whis this two modules (pdf_generator2 and PEAR):

Fatal error:  Cannot redeclare readmap()
(previously declared in ...\Xampp\php\PEAR\fpdf\font\makefont\makefont.php:8)

So i just rename temporary the folder PEAR to PEAR_old and everthing works fine. (But it tooks me 2 hours to fix this little bug)

In the next days i will write something about detailed configuration!

Related posts:

  1. Problems after upgrading TYPO3 4.2 to 4.3 with stylesheets and images
  2. How to … update TYPO3 4.2
  3. Zimplit – a small, free Content-Management-System
  4. How to … sort the feuserlist in TYPO3

4 Responses to “How to … convert HTML-Content to PDF File in TYPO3”


  1. 1 David

    Hi.
    I’ve followed all your writings but still not working.
    Not taking care of css, even basique (removing all styles…)

    Do you have a special configuration (setup, constants, TSconfig, etc.) ?

  2. 2 blumentritt

    Hi David,

    thanks for your post. What exactly isn’t working?

    My TS-Setup for PDF generating is all what you see in the upper blogpost.

  3. 3 baldo

    Hello,
    in my typo3 the error “Error while trying the pdfconversion Maybe the gen_pdf.php script was not executed at all” appear after click the “update” Button after installing too.
    Other possibles solutions?
    Thanks

  4. 4 blumentritt

    Some more hints for the magic “pdf_generator2″ :)

    - deactivate the extension “sourceopt”
    - if you are using templavoila, install the extension “tv_pdfgen”

Leave a Reply

*