Bug 90495

Summary: PDF: Manually-added ToC entries don't show up in PDF bookmarks
Product: LibreOffice Reporter: FS <bz_lo>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: klasse, stgohi-lobugs
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: ODT file with headings, manual ToC entries and a ToC
PDF created from example ODT, missing manual ToC entries

Description FS 2015-04-07 09:49:57 UTC
Created attachment 114667 [details]
ODT file with headings, manual ToC entries and a ToC

LO Writer allows for creating Tables of Content (ToC). ToC entries are created by default from two sources:

a. paragraphs with "Heading [1-10]" paragraph style;
b. manually-added index entries (Menu Insert -> Indexes and tables -> Entry, Index Type: Table of Content)
c. optionally: other, selected paragraph styles.

When exporting a odt file to PDF, LibreOffice creates a bookmark structure by default. LO creates that structure based on Headings (above: a.), but it seems to ignore ToC entries that are based on index marks (above: b.).

Expected behaviour:
ToC entries should appear as PDF bookmarks in the exported PDF, regardless they are based on headings (paragraph style sheet) or on manually inserted index marks.

Current behaviour:
LO creates a bookmark structure solely based on the headings.

Steps to reproduce:
- create new writer document;
- insert some text, assign "Heading 1" style;
- insert another paragraph, assign "Text Body" style;
- select some content inside the text paragraph (single word);
- mark selected word as ToC entry (Menu Insert -> Indexes and tables -> Entry, Index Type: Table of Content);
- optionally: create a ToC. In that ToC, the heading and the manual ToC entry should appear;
- export as PDF, make sure that the "Export Bookmarks" option ("General" Tab, section "General") is active;
- the resulting PDF has only one ToC entry (the heading); a ToC entry for the "manual" entry is missing.

Alternatively, use the attached odt / export it as PDF and compare the LO Writer ToC with the PDF bookmark structure.

Maybe this bug is connected with https://bugs.documentfoundation.org/show_bug.cgi?id=73295 ?

The attached file is a simple odt document with some headings and two manual ToC entries. The manual entries appear in the ToC inside LO, but they don't appear in an exported PDF.
Comment 1 FS 2015-04-07 09:53:41 UTC
Created attachment 114668 [details]
PDF created from example ODT, missing manual ToC entries
Comment 2 A (Andy) 2015-04-07 10:54:24 UTC
Reproducible with LO 4.4.1.2, Win 8.1

But could it be that this is linked to the fact that the manual entries in the ToC have no links to the corresponding paragraphs (-> move the mouse cursor over the ToC entries -> already happens in the ODT file, not pdf specific)?
Comment 3 tommy27 2016-04-16 07:23:40 UTC Comment hidden (obsolete)
Comment 4 FS 2016-04-22 08:19:35 UTC
Bug still present in Version: 5.0.5.2 Build ID: 1:5.0.5~rc2-0ubuntu2 - tested with Ubuntu Linux x86_64. Same behaviour as already described.
Comment 5 Johnny_M 2016-07-27 19:34:10 UTC
(In reply to A (Andy) from comment #2)
> But could it be that this is linked to the fact that the manual entries in
> the ToC have no links to the corresponding paragraphs (-> move the mouse
> cursor over the ToC entries -> already happens in the ODT file, not pdf
> specific)?

True, those "manual entries" lack hyperlinks already (i.e. before the PDF export) in the attached "test_headings_index_entries.odt" file.
Comment 6 Johnny_M 2016-07-27 20:43:35 UTC

*** This bug has been marked as a duplicate of bug 73295 ***
Comment 7 Timur 2017-12-25 16:55:06 UTC

*** This bug has been marked as a duplicate of bug 65463 ***