470,815 Members | 1,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

pyRTF and cells

Hello,
I have been playing around with pyRTF module for generating rtf
documents.
Its a very nice tool that fits my basic needs. However I have a problem
controlling cells in
a table.

I am not able to
1. do an align right of contents inside a cell
2. set backgroundcolor of a cell
3. I wonder if there is a property to set cell height (?)

Do you guys have any input on this?

/R

Mar 15 '06 #1
2 2377
Raja Raman Sundararajan wrote:
Hello,
I have been playing around with pyRTF module for generating rtf
documents.
Its a very nice tool that fits my basic needs. However I have a problem
controlling cells in
a table.

I am not able to
1. do an align right of contents inside a cell
2. set backgroundcolor of a cell
3. I wonder if there is a property to set cell height (?)

Do you guys have any input on this?


Yes. The correct approach is to:

a) do a Google search on "RTF specification", find the latest version of
the RTF specs, and read through them to determine whether what you want
to do is supported by RTF itself. If it is, then:

b) Ask Simon Cusack, the author of PyRTF, whether PyRTF supports these
attributes or if not, the best way to go about adding support for them, or

c) just add the features yourself to PyRTF and send Simon a copy of your
modified code.

Cheers,

Tim C

Mar 15 '06 #2
Yeah, thats a good approach.
I have been fiddling around to implement that feature in elements.py
and RTF specification from msdn
However, I have not been successful thus far.

To answer my first question:
1. do an align right of contents inside a cell

Its not possible by speficying alignment in the Cell instance

However, if you really want this feature then create a Paragraph and
then set alignment=2 for the ParagraphPropertySet object
Snippet:

p = Paragraph( ss.ParagraphStyles.Normal, ParagraphPS(alignment=2)
)
p.append(<some text here>)
c1 = Cell(p)

Mar 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by mrid via DotNetMonster.com | last post: by
3 posts views Thread by E.Doxtator | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.