[reportlab-users] set default unit possible ?
Remy C. Cool
reportlab-users@reportlab.com
Thu, 12 Dec 2002 07:59:43 +0100
I'll look into that, thanks for the quick answer.
Remy Cool
On Wednesday 11 December 2002 22:00, Andy Robinson wrote:
> > Is it possible to set a default unit with a stylesheet ?
> >
> > It's a bit of a hassle to append * mm/cm/inch to every value that
> > needs a unit in parsing an xml file with paragraphs.
>
> No it isn't at the moment. In our 'Report Markup Language'
> product, we allow people to do things like 16cm, 2in etc.
> by having a function 'readLength' which is applied to
> many tags and their attributes. But if no units are given
> then it is assumed to be in points. IMHO this is reasonable.
>
> It should be easy for you to subclass paragraph and insert
> a one-line 'hook' after the XML is parsed and before anything
> is done with it, and then iterate over all tags converting
> relevant attributes by a conversion factor.
>
> Best Regards,
>
> Andy Robinson