# Question about pdf/writer

**URL:** <https://www.ruby-forum.com/t/question-about-pdf-writer/119636>\
**Category:** Ruby\
**Created:** [November 8, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636 "2007-11-08T20:09:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 8, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/1 "2007-11-08T20:09:24Z")

</div>

hey there all,

i am using ruby to make some pdf charts, but there is also a data table  
i  
need to put in there.  
i am using pdf/writer and so far so good, but i can’t find anywhere that  
i  
can change the color of the table text.  
Anyone help me out on this?

thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2007, 1:15am UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/2 "2007-11-09T01:15:03Z")

</div>

On 11/8/07, shawn bright [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i am using ruby to make some pdf charts, but there is also a data table i  
> need to put in there.  
> i am using pdf/writer and so far so good, but i can’t find anywhere that i  
> can change the color of the table text.  
> Anyone help me out on this?

You do it by changing the fill color prior to starting the table (IIRC).

-austin

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2007, 4:15pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/3 "2007-11-09T16:15:37Z")

</div>

On Nov 8, 6:00 pm, Austin Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## -austin
> 
> Austin Z. \* removed\_email\_address@domain.invalid \*[http://www.halostatue.ca/](http://www.halostatue.ca/)  
> \* removed\_email\_address@domain.invalid \*[You are in a maze of twisty little passages, all alike. // halo • statue](http://www.halostatue.ca/feed/)  
> \* removed\_email\_address@domain.invalid

Right, thanks Austin, sorry. I did not ask my question very clearly. I  
need to be able to make one row of text one color, the next row of  
text another color, etc… This i can’t find out how to do. All of it  
needs to be in the same table.

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2007, 5:12pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/4 "2007-11-09T17:12:25Z")

</div>

On Nov 9, 10:10 am, nephish [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Right, thanks Austin, sorry. I did not ask my question very clearly. I  
> need to be able to make one row of text one color, the next row of  
> text another color, etc… This i can’t find out how to do. All of it  
> needs to be in the same table.

You can get alternating row colors with SimpleTable, but that’s about  
all… These are the shade\_color and shade\_color2 attributes.

If you have more questions about this or other things you encounter in  
PDF::Writer, please join our mailing list. I have trouble keeping up  
on RubyTalk these days 🙂

[http://rubyforge.org/mailman/listinfo/ruby-pdf-discuss](http://rubyforge.org/mailman/listinfo/ruby-pdf-discuss)

Also, as an aside, as of ruport-util 0.9, you might get a lot of love  
out of Ruport for this kind of thing, if you’re willing to poke around  
a bit.

-greg

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/5 "2007-11-09T17:26:27Z")

</div>

On Nov 9, 10:08 am, Gregory B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> current implementation) to set text color for individual rows.  
> Patches welcome though!

ok, gents, thanks for all your help, will keep poking around. Would  
love to help with patches, maybe will some day, but am still a newbie.  
Thanks again  
sk

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [November 9, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/question-about-pdf-writer/119636/6 "2007-11-09T17:13:35Z")

</div>

On Nov 9, 11:07 am, Gregory B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Nov 9, 10:10 am, nephish [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Right, thanks Austin, sorry. I did not ask my question very clearly. I  
> > need to be able to make one row of text one color, the next row of  
> > text another color, etc… This i can’t find out how to do. All of it  
> > needs to be in the same table.

Whoops, I misunderstood. I don’t think it will be possible (with the  
current implementation) to set text color for individual rows.  
Patches welcome though!
