Page 1 of 1
How to get pdf bookmarks in Prince pdf-WYSIWYG transformation?
Posted: Wed Feb 15, 2017 10:41 pm
by berkeley
I'm using Oxygen XML Author 18.1 build 2016112217 and I'm trying to configure the WYSIWYG transformation so that the pdf generated with the Prince CSS processor has bookmarks.
I've tried adding:
*[class~='topic/topic'] { prince-bookmark-level: 1 }
*[class~='topic/topic'] > *[class~='topic/title'] { prince-bookmark-level: 2 }
or:
h1 { prince-bookmark-level: 1 }
h2 { prince-bookmark-level: 2 }
to p-styling.css based on
https://www.princexml.com/doc/8.1/pdf-bookmarks/. I also tried setting p-styling.css in the args.css parameter in the scenario settings since CSS I had in p-styling.css didn't seem to be implemented automatically. But none of this has had an effect.
Thanks for your help,
Justine
Re: How to get pdf bookmarks in Prince pdf-WYSIWYG transformation?
Posted: Thu Feb 16, 2017 3:19 pm
by Dan
Hello Justine,
You can use the following CSS snippet (it will be included in oXygen 19):
Code: Select all
@media print {
*[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 1;
-ah-bookmark-level: 1;
}
*[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 2;
-ah-bookmark-level: 2;
}
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 3;
-ah-bookmark-level: 3;
}
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 4;
-ah-bookmark-level: 4;
}
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 5;
-ah-bookmark-level: 5;
}
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 6;
-ah-bookmark-level: 6;
}
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] {
prince-bookmark-level: 7;
-ah-bookmark-level: 7;
}
}
A good practice is to save this all the customization outside the oXygen installation directory (let say on the Desktop), then alter the transformation scenario "args.css" parameter to point to this additional CSS. In this way you will not loose the file when you upgrade to a new oXygen version.
Many regards,
Dan
Re: How to get pdf bookmarks in Prince pdf-WYSIWYG transformation?
Posted: Thu Feb 16, 2017 7:45 pm
by berkeley
Thanks, Dan. I hadn't put it in the @media {} container and that did the trick.