There are a number of really good (and free) PDF generation libraries
for PHP - I've been using FPDF/FPDI for a while now.
Unfortunately FPDF doesn't support kerning when drawing text. Neither
it would seem do TCPDF, Haru PDF or the R&OS PDF class.
Does anyone know of a PDF generation library in PHP that does support
font kerning? I also need it to be able to import PDF templates (a la
PDI) and to be able to rotate text being drawn.
PDFLib does all this and more, but at US$2000 per server it's a bit
pricey when all I need is that one feature.
Kind regards,
James McGlinn
__________________________________
CTO
Eventfinder Limited
Suite 106, Heards Building
2 Ruskin Street, Parnell, Auckland 1052
Phone: +649 365 2342
Mobile: +6421 633 234
james....@eventfinder.co.nz | www.eventfinder.co.nz
> I remember kerning was on Zend Framework's Zend_PDF class TODO list
> last
> year. I'm not sure if it has made it through yet, and definately
> can't find
> any reference to it in the official docs. But might be worth digging a
> little deeper on ZF.
Thanks Aaron, it does look like it's been suggested as a potential
future enhancement for Zend_PDF but doesn't appear to have made it to
the top of the list just yet.
In the meantime I'm extracting the kerning data out of the truetype
files and setting the character spacing manually for each letter.
It's a bit of a hack and makes alignment more challenging, but does
the trick.
> i worked with a (admittedly ugly) hack with generating Latex and
> then compile a PDF out of that. this worked fine for me but is ages
> ago and i have no real pointer to it. if you are unfamiliar with tex
> it might be not a good option, if you are, do some templateing and
> scripting and you should get what you want.
Thanks Lenz, I haven't used TeX but investigated doing the same thing
with the pslib extension. Ended up deciding against it just because
it looked immature (some functions are documented but unimplemented)
and I wasn't sure I'd end up with a better solution after writing the
EPS to file, converting to PDF, then reading back in. Sometimes
better the devil you know!