TCPDF: a PHP library to convert web pages to PDF

Published by TheJoe on

Estimated reading time: 2 minutes


This article was published more than a year ago, there may have been developments.
Please take this into account.

Today we talk about software that carries on his shoulders 8 years of programming and mature to the point to be used as default in Joomla, one of the main CMS open source used today by millions of satisfied users around the world.

People used to working with Joomla surely know icons that (unless they are disabled from the theme in use) appear aligned on the right of each title Articles. Usually if I see three: “PDF“, “Print” and “Send to a friend“. The report below.

The icon “Send to a friend” does nothing send the link to the email address news that will put, l’icona “Print” open a page formatted correctly for printing, while the icon “PDFallow download in PDF format Article. The icon “PDF” I have always intrigued me and so I investigated a bit '.

To export PDF Joomla leans to PHP class call “TCPDF“. The project “TCPDF” was born in 2002 and is now being used by million people worldwide, also thanks to the popularity that Joomla has helped to build. The software is released under open source license, and that is why it is distributed as an integral package of Joomla. From the benefits indicated by site (The Lunga list) we can mention:

  • requires no libraries external to the operation,
  • supports i charset “UTF-8“, “Unicode” and “Right-to-left” (scrittura araba),
  • supports native image formats JPG, PNG and SVG, also when used with GD or ImageMagick supports the formats supported by these,
  • supports modes “Grayscale“, “RGB“, “CYMK“, “Spot colors” e the transparencies,

To see some example of the operation refer to page “demo” the official site.

Look here:  Tutorial: even out the color in a simple way with Gimp

In conclusion TCPDF is a software in my opinion not always useful. Often in personal sites (but it also happens in those professional) it tends to include any type of content, even the less useful as counter accessi, persone online the surveys of all kinds. Keep in mind that this information will not serve almost never users, then let us ask ourselves the question whether to include the contents between TCPDF or if it can be considered a finesse for a few.


I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.


Roscosbazzeguti · 2 February 2014 at 5:22 PM

I do not know if it is relevant but it is driving me crazy….
Tcpdf and I tried to do what the examples are works fine but for my internal site I was hoping to do this:
A form with mask 3-4 fields that once filled in instead of sending me the data to the data base molds them to me in a letter in pdf precompiled. In short, a “sort-merge”.
I would be enough just to know if you can do and to see a limit examples.
Thank you very much for the eventual availability

    Giovanni Mauri · 3 February 2014 at 11:37 AM

    Unfortunately you are not a big help. “Visits” this software years ago and since then I have not altered.

    Among the examples in the official site I see that there is one called “forms and javascript” that seems to do what you ask. In any case, you should contact one of the developers (, you will definitely be more help.

    Forgive the question, but you are creating from scratch a management?

      Roscosbazzeguti · 5 February 2014 at 10:53 AM

      Then you say that the example creates a PDF with editable fields to be filled in (if I'm not mistaken).
      While, for the last question, I wanted to make a form, for the internal site to my office, that filled, I created a PDF of an application for leave / sickness with data from those who fill (and the PDF I needed for those, and there are, want to keep the document).
      Thanks anyway (I already have everything I lack the PDF creation from the letters in html)

      Giovanni Mauri · 6 February 2014 at 5:44 PM

      You could not save the fields in a database and dredge them up with tcpdf?

      Roscosbazzeguti · 10 February 2014 at 9:22 AM

      I tried to use tcpdf with other databases to see how it worked but I know that the mechanism is completely beyond me( I can not get it to work) and as store data that I need to print I do not need stored as “usa e getta” cm ² say that solve print PDF creator doing what comes to video.
      Thanks anyway

Powerpad · 27 December 2013 at 6:05 PM

We have integrated with powerpad iText ® XMLWorker that allows us to create PDF editions of the content on the websites of our clients. The HTML pages generated by the portal LAMP is converted to a rest service java / jboss that uses the library itext.

    Giovanni Mauri · 4 January 2014 at 9:08 AM

    Unfortunately I never had the pleasure of trying PowerPad, CMS advertises that she. It will certainly be an original product, interactive and performance, but the prerogative of the blog (apart from a few rare exceptions) è open source.

    I would be happy to write a review PowerPad, he publicly rilasciaste source code.

    A question: 'm not an expert of licenses, but I see that iText is released under the AGPL. Leggo su wikipedia “The code to provide not only what will be covered by the AGPL, but also all the modules it uses”. This also includes her second PowerPad?

davideatflickr · 22 April 2011 at 3:18 PM

pdflib 😀

TheJoe · 22 April 2011 at 1:17 PM

Well, depends on what you need to do.. what have you found of commercial?

davideatflickr · 22 April 2011 at 10:45 AM

è solo una curiosità lato prestazionionale 😀
there is something better but unfortunately with commercial license : (

TheJoe · 22 April 2011 at 10:19 AM

In fact little change between the two libraries.. are more or less the same thing..

How are both open source license, fpdf is also freely redistributable as “Appendix” also to applications of commercial type.

If we want to tell the whole truth both libraries are developed by the same person: Olivier Plathey, who declined to release the “engine” (FPDF) under the BSD license (or similar) because he had a large expansion, while for bugfixes and new features has created an open source project all over again (tcpdf) use and redistribute only on projects as open source.

davideatflickr · 22 April 2011 at 9:14 AM

the Provera, ho usato always fpdf
this seems like a good substitute.. 🙂

Leave a Reply

Avatar placeholder

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.