PDF [message #21319] |
Thu, 25 November 2004 03:39 |
|
rwest
Messages: 24 Registered: March 2002
Karma: 0
|
Junior Member |
|
|
Since libpdf is a commercial product with an iffy license, why not try to utilize something like FPDF (http://www.fpdf.org)?
FPDF, or Free PDF, is a class that generates pure PDF files. It's pretty easy to implement.. it's just difficult to get the formatting the way you want it to (similar with libpdf).
That way you could have PDF support without the restrictions of libpdf and the PHP compilation requirements. Because fpdf is a class library, it's just like any other piece of PHP code.
Anyhow, it is just a thought..
[Updated on: Thu, 25 November 2004 03:40] Report message to a moderator
|
|
|
|
Re: PDF [message #21331 is a reply to message #21328] |
Thu, 25 November 2004 16:20 |
Anonymous
|
|
|
|
I'm not sure if I agree that it would make it impractical. The PDF functionality (I've worked with both libpdf and fpdf class lib) never seemed to be a slow process in either case..
Sure, if one were to run FudForum on a very old and slow machine, yes it would be too slow to utilize since any PDF generation is horribly slow because it is a CPU intensive task.
For a very small project of my own, I tried out implementing the fpdf class, and I was surprised to see that, not only was it easy to implement (but somewhat of a pain to get the grid lines where you want them), it was rather robust.
The performance hit that a PDF class lib has is when it needs to generate a rather complex page, and the resulting pages from FudForum are straightforward, clean, and, generally not complex. :) (one of the things I like about FudForum as a whole!)
Anyhow, it was just a thought.. I didn't know if anyone had ever considered it...
Thanks for the response!
Ilia wrote on Thu, 25 November 2004 08:59 | Good question :)
Generating PDF is already a fairly slow process even when a PHP extension is used. Using a PHP class (much much slower) would only worsen the process and make this impractical on any significant scale.
|
|
|
|
Re: PDF [message #21335 is a reply to message #21331] |
Thu, 25 November 2004 17:26 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Most users of the forum don't have their own servers and share "their" servers with dozens of other users. This means that even if the server is fairly powerful amount of resources available to each user is still rather limited.
The FPDF library of scripts maybe fine (speed wise) for making a PDF of a small topic, however if you try to make a PDF of an entire forum or a long topic the performance hit of using PHP to make a PDF will be quite noticeable. People who are more familiar with it tell me that for complex documents the performance drop is more then 10x.
FUDforum Core Developer
|
|
|
|
Re: PDF [message #21337 is a reply to message #21336] |
Thu, 25 November 2004 20:04 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Another issue is that to enable this functionality FUDforum would need to bundle the library which is ~ 150kb in the distribution. This a fair chunk of code to include...
FUDforum Core Developer
|
|
|
|
Re: PDF [message #21347 is a reply to message #21346] |
Fri, 26 November 2004 03:42 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
without examples it is 150k, the fonts directory is pretty big.
FUDforum Core Developer
|
|
|
Re: PDF [message #21350 is a reply to message #21347] |
Fri, 26 November 2004 04:01 |
Anonymous
|
|
|
|
The fonts directory is filled with a lot of extra stuff.. if you trim it down to one font (like helvetica.php), it's only a 4k file.
Anyhow, it's no problem.. you already answered my original question more than fully. I don't want to come across like I am trying to be a pain to try to get this implemented.. :) It was just a thought that crossed my mind and I thought I would ask.
Ilia wrote on Thu, 25 November 2004 22:42 | without examples it is 150k, the fonts directory is pretty big.
|
|
|
|
|
Re: PDF [message #21398 is a reply to message #21351] |
Mon, 29 November 2004 16:08 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
I've done a code review of FPDF and after quite a few tests managed to tune FPDF to give "agreeable" speeds for FUDforum and I was also able to trim bloat from the code to make it into a compact 29k library (including fonts).
Future versions will use this for PDF generation rather then relying on libPDF who's license seems to be getting worse and worse.
FUDforum Core Developer
|
|
|
|
|
|