PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post here questions and problems related to editing and publishing DITA content.
paulkhillier
Posts: 15
Joined: Wed Jun 27, 2018 12:44 am

PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post by paulkhillier »

Hello Oxygen Users and Team,

I am using DITA Map PDF - based on DITA & CSS (WYSIWYG) to style PDF output for our software release notes. When generating the bookmarks, I have bookmaptitlealt at the top level, followed by about release notes, TOC, and parts at the next level. The problem is, the bookmaptitle alt is displayed again below the contents bookmark (not clickable/no link). I have tried many selector cominations to try to remove it with no luck. Any suggestions?


Code: Select all

/* PDF Bookmarks */


@media print {

*[class ~= "bookmap/booktitlealt"] {
bookmark-level: 1;
bookmark-label:content(before) content(text);
}

[b][color=#FF0000]*[class ~= "bookmap/booktitlealt"] > *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 1;
bookmark-label: none;
}[/color][/b]

*[class ~= "toc/title"] {
bookmark-level: 2;
bookmark-label:content(before) content(text);
}

*[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-label:content(before) content(text);
}

*[class~="topic/topic"] > *[class~="topic/title"][navtitle] {
bookmark-label:content(before) attr(navtitle);
}

*[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 2;
}

*[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 3;
bookmark-state:closed;
}

*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 4;
}

*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 5;
bookmark-label: none;
}

*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 6;
bookmark-label: none;
}

*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 7;
bookmark-label: none;
}

*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 8;
bookmark-label: none;
Costin
Posts: 828
Joined: Mon Dec 05, 2011 6:04 pm

Re: PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post by Costin »

Hi paulkhillier,

In order to investigate this, we would appreciate if you could send (on our official support email address - support@oxygenxml.com) a sample DITA Map in a minimal form, on which you apply the CSS rules and reproduce the issue, together with the PDF output (or at least a screenshot depicting the issue in the PDF output).

As a remark: I noticed one of your CSS rules reads:

Code: Select all

[b][color=#FF0000]*[class ~= "bookmap/booktitlealt"] > *[class~="topic/topic"] > *[class~="topic/title"] {
bookmark-level: 1;
bookmark-label: none;
}[/color][/b]
This could create issues, as the selector seems to try matching the title of a topic included in the subtitle, which I doubt is possible.

I look forward to receiving your sample files on the support email.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
paulkhillier
Posts: 15
Joined: Wed Jun 27, 2018 12:44 am

Re: PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post by paulkhillier »

Hi Costin,

Thank you for your assistance on this issue. As requested, the DITA Map and an extract of the cover page / PDF bookmarks has been sent to the support inbox.

With regards,

Paul Hillier
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post by Dan »

I understand that you need in fact the title of the product to be placed a the top of the bookmarks tree.

The booktitlealt is duplicated by the transformation process in the TOC structure so that it can be shown there if needed. Your selector matches both the element from the front page and the one from the TOC that is why it duplicates the bookmark.

Please replace the first two selectors from your CSS with these:

Code: Select all


*[class ~= "bookmap/booktitlealt"] {
bookmark-level: 1;
bookmark-label:content(before) content(text);
}

*[class ~= "toc/toc"] *[class ~= "bookmap/booktitlealt"] {
bookmark-level: 1;
bookmark-label: none; /*This will remove the second booktitle bookmark*/
}
Let us know if you need more information.

Many regards,
Dan
paulkhillier
Posts: 15
Joined: Wed Jun 27, 2018 12:44 am

Re: PDF Bookmarks - Bookmaptitlealt duplicated - DITA Map PDF - based on DITA & CSS (WYSIWYG)

Post by paulkhillier »

Thanks for the explanation and code example, this worked perfectly.

With regards,

Paul Hillier
Post Reply