# PDF::Writer Table of Contents problem

**URL:** <https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227>\
**Category:** Ruby\
**Created:** [August 3, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227 "2006-08-03T17:46:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 5:46pm UTC](https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227/1 "2006-08-03T17:46:26Z")

</div>

Hello,

I am having some problems with the PDF::Writer gem. I cannot get the  
table of contents to display any items.

Has anyone had this problem or used this library? I am unable to get  
feedback using their rubyforge mailing list.

I hope someone can help me.

Thanks in advance!

Tony

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227/2 "2006-08-03T17:58:27Z")

</div>

On 8/3/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am having some problems with the PDF::Writer gem. I cannot get the  
> table of contents to display any items.
> 
> Has anyone had this problem or used this library? I am unable to get  
> feedback using their rubyforge mailing list.

I’m pretty sure that I replied and I indicated that I was on vacation  
at the time.

The table of contents support is _only_ applicable to bin/techbook  
(PDF::TechBook) and requires PDF::TechBook-formatted documents. If you  
want anything else, you need to create your code based on the TechBook  
class code and implement it yourself. There is not general  
table-of-contents support in PDF::Writer as a whole.

So, what exactly are you trying to do?

-austin

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227/3 "2006-08-03T18:10:29Z")

</div>

Hey Austin,

Thanks for the reply, I must have missed your reply somehow.

Anyway, I began by using the module.pwd and modifying it to get a feel  
for how to make it work. I changed the title page, generated a pdf,  
then the content of the document, generated the pdf… and continued  
until I was able to successfully make the pdf I need with a table of  
contents and all.

Unfortunately, I would make a small change and then the table of  
contents would only show up as the only heading (black background,  
white text, etc.) and none of the other #s in the document  
would be parsed. I’ve been trying to remove any comments (#comment)  
from within and outside the .eval {{{ tags. I have no luck yet though.

Thanks again,  
Tony

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/pdf-writer-table-of-contents-problem/101227/4 "2006-08-03T18:22:29Z")

</div>

On 8/3/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> from within and outside the .eval {{{ tags. I have no luck yet though.  
> If you can send me the code (off-list), I will try to figure it out  
> this weekend.

-austin
