> I am wanting to write a small/quick/kiss quote/invoice system that
> outputs PDF files.
...
> Would be nice if I can generate a text, html and maybe RTF version as
> well.
> Hoping to knock it over in a night. Writing the glue in Perl, just need
> a layout language. I don't think HTML will cut it.
Don't everybody laugh at once but my suggestion is groff.
Use tables, which you can manipulate with your perl.
groff -t -Tascii file.rof -> file.ascii
groff -t file.rof -> file.ps
ps2pdf file.ps -> file.pdf
etc.
Admittedly you have to read up on tbl. If you know latex, you might
find that easier.
Here's a bit of tbl. Tha blanks are tabs.
For a time sheet:
.TS
center;
c1 s s s.
=
.sp 5p
Soul destroying work done for MegaBucks Inc
.sp 5p
.T&
c1 s c c.
Date Hours Description
.sp 5p
_
.sp 5p
.T&
r1 l n l .
Mon 5th 2.5 Sat in boring meetings
Tue 6th 12 General Web surfing and chatting
.sp 5p
Total 37.5
_
.TE
Replace the working lines with something magic and your perl
can do a lot of work for you. Similarly for billable:
.TS
center;
c1 c c c.
=
.sp 5p
Qty Description Price Total
.sp 5p
_
.T&
n l n n.
.sp 5p
40 Time 12.50 $360.00
GST $36.00
_
.sp 5p
Total $496.00
_
.TE
As I say, multiple blanks should be tabs. (In vi, probably
:%s/ /^I/g
:%s/ */^I/g) but someone else will have a better way :)
Works for me. Not to start a flame war but groff is quite lightweight
compared to Tex. You are only doing one or two pages, I reckon
there's a lot less overhead.
Jamie
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug