Page 1 of 1

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

Posted: Wed Jun 27, 2018 5:04 pm
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;

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

Posted: Thu Jun 28, 2018 11:10 am
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

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

Posted: Thu Jun 28, 2018 4:49 pm
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

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

Posted: Fri Jun 29, 2018 2:31 pm
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

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

Posted: Tue Jul 03, 2018 5:13 pm
by paulkhillier
Thanks for the explanation and code example, this worked perfectly.

With regards,

Paul Hillier