views:

30

answers:

2

Dear,

Does anyone have any idea how to use the tag so the table of content comes onto the 1st page and all text is coming behind. This is what i've got so far, it generates the table of content behind my text...

pdf.html

<htmL>
<body>
<div>
   <pdf:toc />
</div>
<pdf:nextpage>
<br/>
<h1> test </h1>
    <h2> second </h2>
    some text
<h1> test_two </h1>
    <h2> second </h2>
    some text
</body>
</html>

I can't seem to get everything in the right position, even with the it doesn't seem to work... any help or documentation somewhere? The PISA docs are rly crappy with details actually...

Btw 1 more extra thing, is it possible to make this table of content jump to the right page? If yes how does this works?

Regards,

+1  A: 

I found I couldn't get that pagebreak to work for me, so I used inline CSS and, specifically, the page-break property to fix it.

In your case, this should do the trick:

<div style="page-break-after:always;>
   <pdf:toc />
</div>
<h1> test </h1> ...etc...
stevejalim
+1  A: 

As far as the links are concerned, there may be a way to automatically generate them, but I found it easier to manually create a table of contents using links and anchors:

<h1>Table of Contents</h1>
<ul>
    <li><a href="section1">The name of section 1</li>
    <li><a href="section2">The name of section 2</li>
</ul>

<h2>The name of section 1</h2>
    <a name="section1"></a>

<h2>The name of section 2</h2>
    <a name="section2"></a>

There's obviously some duplication, but I haven't found it difficult to maintain for my documents. It depends how long or complicated you expect yours to became.

The bigger downside is that this option won't include page numbers.

Steve's comment about the page-break property is correct. I personally used a separate CSS file with

h2 {
    page-break-before:always;
}

so that all of my sections would start on a new page.

AndrewF