PDF index not generated from Table of Contents

Hello,

I am trying to generate an index in an exported PDF from an ODT file. My ODT contains a table of contents via Insert → Table of Contents and Index. The ToC displays correctly. However, when I export to PDF the viewer does not have a navigable PDF in the user interface.

I’m not referring to the ToC that is viewable within the document itself, but the index that is supposed to be generated from that and visible within the PDF renderer’s integrated user interface.

I have tried File → Export as PDF → General, and tried checking “Tagged PDF”, “Export outlines”, and “Export placeholders”. I also tried under the “Links” tab for PDF options checking “Export bookmarks as named destinations”. But none of these seem make any difference.

I am using version: 25.2.5.2 (X86_64) / LibreOffice Community. Any help appreciated.

In your existing pdf, if you open it in Adobe Reader, click the Bookmarks icon down the left side to see the outline (your desired pdf index I think).
AdobeBookmarksIcon

If you want it to show on first opening then, in the PDF Options dialogue that appears when you click File > Export as > Export as PDF, click on the Initial View tab and select Outline and page. See PDF Export Initial View

Thank you, but I’ve already verified in my PDF renderer (I’m not on Windows or macOS) that no index is present in the metadata. I also already have “Outline and page” already selected in “Initial view”.

Can you see the bookmarks in this pdf?
BookWithLayout.pdf (51.3 KB)

They are visible in Xreader and Firefox

Yes, works no problem. See screenshot.

So it isn’t a pdf reader issue.

How did you create the headings for TOC? Did you use the built-in Heading 1, Heading 2, etc. Styles?
Can you provide a sample of say 3 or 4 pages in .odt but with the original text replaced with x using Find and Replace?

Definitely not a reader issue since lots of other PDFs, including your sample, show an index in the UI.

I created the ToC via Insert → Table of Contents and Index, which I think is what was recommended in the documentation. All of the different sections show up correctly in it and use Heading 1, 2, etc for style.

I’ve attached a minimal and the exported PDF.
Test.odt (17.4 KB)
Test.pdf (33.9 KB)

I see that the document has been converted from Word and also that the Headings were created in Word from style normal, not from the relevant heading style so they never have an Outline level.

I would be inclined to copy everything and paste as unformatted text into a new document and apply styles to the clean document. It might be enough to paste as Rich Text Formatting (RTF) to tidy up the styles. The sample below pasted as rtf and TOC applied
Test124936PastedRTF.odt (12.8 KB)

Thanks EarnestAI. I tried copying and pasting into a fresh ODT file, saving, and exporting to PDF like before. Still no index rendering in the UI for my PDF viewer. Your sample does, however, display it when I export to PDF. Unfortunately this isn’t really a solution though. I think this might be a bug, perhaps?

Did you click Edit > Paste Special > Paste Special > Rich Text Formatting (RTF)?
I tested on only your small sample so it might not apply so well to a larger document although testing again it seems that HTML also removes a lot of the damaged styles in your document.

Trying to fix your sample document by simply applying the appropriate outline levels to the Heading styles creates other issues and doesn’t address the other parts of the styles that are damaged.

I think it is a result of styles not being correctly applied in Word.

@kiplingw ,

If you assign an outline level to the paragraph template Heading 1, the display in the PDF will also work.

1 Like

Thanks both of you. @PKG, your solution worked.