[reportlab-users] set font colors

Tim Roberts timr at probo.com
Wed Jan 25 18:13:52 EST 2012


Chorny, Ilya wrote:

>

> I am trying to set the font color, for example by

>

>

>

> outpdf = canvas.Canvas("analysis_report.pdf",pagesize = letter)

>

> width, height = letter

>

> outpdf.setFont("Helvetica", 10)

>

> outpdf.setFillColorCMYK(0,0,0,36)

>

>

>

> but it seems to have no effect on the color. I have tried

> RGB(187,187,187) and that gives me a blank page. Am I doing something

> wrong?

>


Yes. The color values in Postscript are floating point numbers from 0
to 1. This should make you happier:
outpdf.setFillColorCMYK(0,0,0,0.36)

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20120125/75c34b74/attachment.html>


More information about the reportlab-users mailing list