Welcome to WebmasterWorld Guest from 3.227.3.146

Forum Moderators: coopster & jatar k

TCPDF Documentation?

documentation or examples how to use TCPDF

     
12:28 pm on Jul 24, 2019 (gmt 0)

New User

joined:July 16, 2019
posts: 10
votes: 0


Hi:

I have a CRM which I developed using MySQL / PHP and some javaScript on the client-side. I want to be able to output some pages in pdf rather than HTML (PHP) and have found that TCPDF works pretty well.

The problem is there does not seem to be any documentation. So, little things like aligning text (centering on page) is not working as I expect.

Does anyone know if there is any good documentation or tutorials for TCPDF?

Alternatively, what is the simplest way to output a pdf document from PHP to a browser?

Thanks
7:41 am on July 25, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


It might be easier to use this :

[pecl.php.net...]

With the documentation here:

[php.net...]
2:25 pm on Aug 6, 2019 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12555
votes: 3


Hey SeanF,

Welcome to WebmasterWorld. I have used many different PDF rendering packages over the years and I'll agree with Dimitri, there are many easier options nowadays. I used FPDF originally which is comparable to packages like TCPDF. It takes a lot more thought, planning and programming than some of the alternatives today. My preference is to create the HTML and then let your PDF rendering engine of choice do the conversion. I noticed with a quick search that there is an open source html2pdf rendering package based on TCPDF, if you choose to try this route:

[github.com...]
5:23 pm on Aug 7, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


I'll agree with Dimitri

Thank you :) ... so now you have your third vote.
9:53 pm on Aug 7, 2019 (gmt 0)

New User

joined:July 16, 2019
posts: 10
votes: 0


Thanks, all... I will look into that.
11:04 pm on Aug 7, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:10572
votes: 1125


I generally do all my layout/formatting in the one aspect I have 100% control: the html. All I ever want a PDF conversion do is faithfully replicate that layout. So ... I look for the simplest solution to a single problem rather than look at solutions with more bells and whistles than I really need.

That said, I don't do much in the "on the fly" pdf conversion side ... generally do those off line because my content is largely very static. And in that regard this isn't a real solution, other than the initial statement: control what you can and keep the rest of the process as simple as possible.