The best HTML to PDF library for PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: The best HTML to PDF library for PHP?

Post by Benjamin »

GIF images are generally tiny, especially if you are only using 8 or less colors.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: The best HTML to PDF library for PHP?

Post by Christopher »

But it would be for an entire printable page with text and layout lines/borders. That sounds large even for GIF. One of the points of Postscript/PDF is to make these kinds of documents much smaller.
(#10850)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: The best HTML to PDF library for PHP?

Post by Benjamin »

I bet you a beer it weighs in at less than 30K.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: The best HTML to PDF library for PHP?

Post by Christopher »

astions wrote:I bet you a beer it weighs in at less than 30K.
I am not a betting man, but I am mighty thirsty! :drunk:
(#10850)
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: The best HTML to PDF library for PHP?

Post by Darhazer »

At the end we came up with using PDF Tookit, and a PDF file with a form. The idea is to fill the form and to flatten the file after that. In the middle of the next week I should have a working code, so I can post it.

---
:offtopic:
This was my 256th post :drunk:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: The best HTML to PDF library for PHP?

Post by Christopher »

Darhazer wrote:At the end we came up with using PDF Tookit, and a PDF file with a form. The idea is to fill the form and to flatten the file after that. In the middle of the next week I should have a working code, so I can post it.
That fill the form and to flatten sounds like it will do what I need to do. Thanks Darhazer! I will download and give it a try too.
(#10850)
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: The best HTML to PDF library for PHP?

Post by Darhazer »

pdftk is really easy to use, but I have problems with non-latin characters. I'm trying to fill form with Cyrillics. I'm using http://www.pdfhacks.com/forge_fdf/ for creating the FDF, because I have no the fdf extension compilled. The cyrillics are lost.
OK, I removed the encoding from the forge_fdf source, and encode my strings in UTF16BE:
$fdf_data_strings['SomeValue'] = chr(254) . chr(255) . iconv('utf-8', 'utf-16be', $someVar);
If I don't flatten the file, everything seems OK.
But when I use the flatten option, the cyrillics are gone again.

Any ideas on this?

The problems were:
* version of phptk with static linked iText - I was developing on fc8 and itext was removed from yum due to licensing issues. on fc10 there is pdftk and itext in yum
* incorrect font in the pdf file
Post Reply