[reportlab-users] Transparency

Robin Becker robin at reportlab.com
Wed Aug 19 05:47:43 EDT 2009


> Great - thanks a lot for implementing this!


> It doesn't seem to work completely. The first problem is simple (stroke

> opacity in shapes is applied incorrectly - see the attached patch). The

> second problem is that opacity doesn't seem to work on String objects. I

> haven't tracked that one down yet.


thanks for the patch it was cut 'n paste error bah :(

Not sure why string opacity shouldn't work; we're just setting an extended
graphics state so it should apply to all fills/strokes etc etc. Of course text
does have a separate kind of existence in PDF.

I have changed the original test in test_platypus_general.py to output some
strings using canvas.drawString and the opacity stuff seems to work there at
least in the acrobat viewer (see attached).

I suppose the String objects must be doing something special. The renderPDF
drawString seems to use canvas beginText ...endText to draw the string, but that
seems to be what canvas drawString does.

> Other than that, a simple test script seems to work, but it doesn't when

> incorporated into our application. I'll see if I can figure out what the

> problem is and let you know.

Robin Becker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_pdfgen_general_spots.zip
Type: application/x-zip-compressed
Size: 1700 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090819/6123045d/attachment.bin>

More information about the reportlab-users mailing list