[reportlab-users] UTF8 Encoded Strings

Rich Shepard rshepard at appl-ecosys.com
Wed Oct 31 12:47:52 EDT 2007


On Wed, 31 Oct 2007, Robin Becker wrote:


> I'm not sure why the textLine method should be expected to do other than

> what its documentation says eg


Robin,

It shouldn't do otherwise. But, textOut() is another option.


> The easiest way is just to add the two strings together with a separator in

> between and pass that to textLine.


Hadn't thought of that. What I did eventually come to is this:

margin = textobject.getX()
for pairs in pairData:
textobject.textOut(pairs[0])
textobject.setXPos(90)
textobject.textLine(pairs[1])
pg.drawText(textobject)
textobject.setXPos(-90)

This works (see attached pdf file). But, ...


> If as I suspect you really want this to be some kind of table ...


I don't want a table, per se, but both strings in each tuple printed on
the same line.



> .. then it's much easier to be explicit and draw the strings where you

> want using canvas.drawString method. You'll need to do explicit

> positioning, but I assume you want to do that anyway.


I'll try this approach, too.

Thanks,

Rich

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerators(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecoForm.pdf
Type: application/pdf
Size: 2798 bytes
Desc:
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071031/b257d92c/attachment.pdf>


More information about the reportlab-users mailing list