[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Advice Mixing PHP and Lua?
- From: Bertrand Mansion <lua@...>
- Date: Tue, 27 Oct 2009 22:12:26 +0100
On Tue, Oct 27, 2009 at 9:02 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> On Oct 27, 2009, at 8:34 PM, Patrick wrote:
>>
>> > Actually the only thing I am really suck with is FPDF. I want to
>> > generate PDF quotes for my small business.
>>
>> Perhaps something like lpdf would help?
>>
>> http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpdf
>>
>> lpdf is a binding for PDFlib:
>
> FPDF explicitly avoids PDFlib.
>
> Looking at the code in FPDF, it seems to be easy to convert to pure Lua,
> but of course I know no PHP. If anyone knows PHP and can confirm that it'd
> be easy to convert to pure Lua, I could try it.
>
Hi Luiz,
FPDF is very popular in the PHP world because it is free and easy to
use. Its pseudo OO code is ugly though.
But TCPDF, which is even more useful is even uglier, probably the
ugliest code I have seen in PHP ever. But it does the job quite well
and has lots of features. I produce this kind of documents with it :
http://www.intermedes.com/voyage/2010/174-chili-du-cap-horn-atacama.pdf
The best PHP PDF class in terms of "code beauty" is Zend_PDF.
Unfortunately it is incomplete as for example it doesn't support
cells. But its API is nice and powerful. You might want to have a look
at it before you start working on a pure Lua PDF module.
If you are more familiar with Python, there are at least two FPDF
ports in Python:
http://juanfernandoe.googlepages.com/
http://www.sistemasagiles.com.ar/trac/browser/pyfpdf/FPDF.py
There are also some Ruby ports:
http://code.zhdk.ch/projects/leihs/browser/trunk/lib/fpdf/fpdf.rb
http://github.com/edwinmoss/rfpdf
It would be nice to have such a thing in Lua, indeed :)
--
Bertrand Mansion
Mamasam