Setting PDF Bookmarks and Properties (DITA and CSS)
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 31
- Joined: Fri Aug 24, 2018 4:27 pm
Setting PDF Bookmarks and Properties (DITA and CSS)
Post by shannonxtreme »
I'm trying to make the following happen in the PDF output:
Any help would be appreciated.
- Set the PDF bookmarks so that the mainbooktitle and booktitlealt are displayed as the top-level bookmark label in the format "mainbooktitle – booktitlealt"
- Set the Title property in the PDF output to the same format "mainbooktitle - booktitlealt"
Any help would be appreciated.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Setting PDF Bookmarks and Properties (DITA and CSS)
Hi shannonxtreme,
However, to concatenate the text content from the "mainbooktitle" and the "booktitlealt" elements and use the result in bookmarks, you should use the oxy_xpath CSS extension.
More specific, you should add the following rule in your customization CSS:
You could use the same oxy_xpath you used also as value for the "-oxy-pdf-meta-title" property, so that the concatenated string resulted from the mainbooktitle text + " - " + booktitlealt text, will be used.
Note that the selector that should be used is even the root of the document, as only the first occurrence of the meta title from the entire document is considered.
Specifically, in the customization CSS, you should use a structure like:
Regards,
Costin
Your approach - setting the bookmark-level to 1 on the booktitle is correct.Set the PDF bookmarks so that the mainbooktitle and booktitlealt are displayed as the top-level bookmark label in the format "mainbooktitle – booktitlealt"
However, to concatenate the text content from the "mainbooktitle" and the "booktitlealt" elements and use the result in bookmarks, you should use the oxy_xpath CSS extension.
More specific, you should add the following rule in your customization CSS:
Code: Select all
*[class ~= "booktitle"]{
bookmark-level:1 !important;
bookmark-label:
oxy_xpath("*[contains(@class, 'bookmap/mainbooktitle')]//text()")
" - "
oxy_xpath("*[contains(@class, 'bookmap/booktitlealt')]//text()");
}
Regarding your 2nd question, there is an "-oxy-pdf-meta-title" property that matches the publication title (the title that appears as the "Title" property for the PDF document).Set the Title property in the PDF output to the same format "mainbooktitle - booktitlealt"
You could use the same oxy_xpath you used also as value for the "-oxy-pdf-meta-title" property, so that the concatenated string resulted from the mainbooktitle text + " - " + booktitlealt text, will be used.
Note that the selector that should be used is even the root of the document, as only the first occurrence of the meta title from the entire document is considered.
Specifically, in the customization CSS, you should use a structure like:
Code: Select all
:root {
-oxy-pdf-meta-title:
oxy_xpath("//*[contains(@class, 'front-page/front-page-title')]//*[contains(@class, 'bookmap/mainbooktitle')]//text()")
" - "
oxy_xpath("//*[contains(@class, 'front-page/front-page-title')]//*[contains(@class, 'bookmap/booktitlealt')]//text()");
}
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service