gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] GNUmed forms printing


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] GNUmed forms printing
Date: Tue, 20 Jun 2006 14:42:40 +0200
User-agent: Mutt/1.5.11+cvs20060403

On Tue, Jun 20, 2006 at 02:11:59PM +0200, Hilbert, Sebastian wrote:

> > - write Cheetah templates for the forms
> makes sense, some questions remain, filling in is easy but  how do you how 
> many characters at max
Cheetah templates are also Python classes so

a) do it in the template, Cheetah directly supports subscripts
b) do it in the class the template represents (effort)
c) don't supply oversized values from within GNUmed (no practical)

> > - process them in GNUmed (fill placeholders, that is)
> some kind of error checking ? 
Why, of course, "running" a Cheetah template (it is a Python
class, after all) has *at least* the Cheetah builtin error
checking. Plus any you add by subclassing the template.

> > - transform them to LaTeX using Ian's fixed position extension
> I see. cheetah basically 'compiles' a latex (any other format) file which 
> then 
> is compiled by Latex  into pdf, txt, whatever 
Yes, sort of, see below.

> > - generate PDFs from it
> doable
yes, using latex2pdf, for example

> > - use the wxPython framework to send that PDF to a printer
> doesn't work. the framework cannot process pdf directly. Only way seems to be 
> to either convert it into some kind of bitmap/postscript stream
I had hoped I can simply say something like

 setup = wx.PrinterDialog()
 wx.Print(setup, 'something.pdf')

> or send it to the printer via system calls
Sure, hand it to cups or lpr or whatever.

> > The result is that we could be maintaining form templates
> > independant of the code proper.
> YEs and no. I agree you get a templating system and abolute positioning via 
> latex bu you would have to maintain latex templates plus cheetah templates
Nope. There's just *one* template. The steps towards the template are:

- Write a LaTeX file which fills in a form with fixed data.

- Rip out the fixed data and replace it with placeholders in
  Cheetah syntax.

- Add more logic written in Cheetah to the template to handle
  loops and such.

You end up with a Cheetah template enclosing latex snippets.
Same goes for any other format. It's very powerful.

> Well, they are in the same file but hell, I don't want latex.
That's a point. Is there an equally powerful/cross platform
alternative, however ? I don't really think so.

> It's not the most readable format#
I fully agree.

> plus I don't want to fire up latex2pdf and send the pdf 
> to the printer afterwards.
I don't see the evil in that.

> If I have time I will test this but the speed penalty will be huge. 
I do agree this worries me, too.

> here ist where reportlab could come into play. simply write cheetah templates 
> that output reportlab templates and let reportlab output pdf and or svg, png
Yep, you'd write a reportlab template and transform it into
Cheetah containing reportlab. There will only be ONE
template left.

> Additional benefit beeing able to output form and content seperately
> as well as generate bitmap for on screen display.
> 
> Last but not least reportlab 'templates' will be able to be handled by Joe 
> Average plus there is a tkinter designer around that takes care of the 
> absolute positioning
Sounds reasonable.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]