[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Advice Mixing PHP and Lua?
- From: Javier Guerra <javier@...>
- Date: Tue, 27 Oct 2009 15:25:22 -0500
On Tue, Oct 27, 2009 at 3:17 PM, Stefan <firstname.lastname@example.org> wrote:
>> 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.
> The PDF dialect that FPDF creates appears to be a slightly older one, which
> is basically a red-headed stepchild of Postscript. This means that it is
> just a fancy text template/generation engine. It shouldn't be TOO hard to
> port it over... (famous last words)
i can confirm that FPDF does very little more than just outputting
some text to a file. this is as "PDF" as any other, it's just not
binary-encoded. i think the only non-obvious thing to do is to
remember the file offsets where each page begins, so that at
file-closing time you can add the 'directory' part.
the second enhancement is not to repeat an embedded image, but to
create a 'resource' and use its definition on each usage.
(disclaimer, this is from hazy memory of reading several iterations of
the adobe specs, and the source of FPDF and Redland libs)