Index in PDF Output: A, B, C, D...sub-headings for quicker access

B-E-N
Posts: 137
Joined: Thu Mar 24, 2016 5:54 pm

Index in PDF Output: A, B, C, D...sub-headings for quicker access

Post by B-E-N » Mon Jun 08, 2020 3:00 pm

Hi,

the table of contents in our PDF output contains a link to the index. The link in the TOC is simply called "Index. Now we would like our customers to be able to jump directly to the letter they are looking for.

Would it be possible to have sub-headings with each letter in the TOC?

Like this:

Index
  • A
  • B
  • C
  • D
  • E
  • etc.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: Index in PDF Output: A, B, C, D...sub-headings for quicker access

Post by Radu » Tue Jun 09, 2020 12:00 pm

Hi Ben,

I do not have a good idea about how this could be done. Are you using the XSL-FO based approach to produce the PDF or our CSS-based approach?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

B-E-N
Posts: 137
Joined: Thu Mar 24, 2016 5:54 pm

Re: Index in PDF Output: A, B, C, D...sub-headings for quicker access

Post by B-E-N » Tue Jun 09, 2020 12:01 pm

Hi Radu,

we are using XSL-FO.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: Index in PDF Output: A, B, C, D...sub-headings for quicker access

Post by Radu » Wed Jun 10, 2020 9:17 am

Hi,

This is probably feasible but you need time to investigate how this could be done, I do not have a quick solution for it.
In the XSLT stylesheet plugins/org.dita.pdf2/xsl/fo/index.xsl there is a template named createIndex which seems to iterate the index groups and create xsl:fo elements for them. You would probably need to do something similar when creating the TOC, iterate the index groups and for each of them create an entr in the TOC. You might also need to add extra IDs for each element created for an index group so that you can link to each of them from the TOC.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

B-E-N
Posts: 137
Joined: Thu Mar 24, 2016 5:54 pm

Re: Index in PDF Output: A, B, C, D...sub-headings for quicker access

Post by B-E-N » Wed Jun 10, 2020 4:27 pm

Thank you very much for looking into this and pointing me to a possible way of doing this.

We will discuss internaly if this is worth pursuing.

Post Reply