Vertical text on cover
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 13
- Joined: Sat Jun 23, 2018 12:52 am
Vertical text on cover
Hi,
I've spent a few hours putting together a bare bones DITA -> PDF template using Chemistry, and I'm impressed with how intuitive things have been so far. However I'm stuck on a specific thing.
We're putting some metadata on the cover. Let's say, for example, "AA123456 revision 1".
The difficult bit (for me!) is that it has to be presented vertically (top to bottom, left-to-right).
Is there a way of doing that ?
Any help is welcome
(I haven't yet tried to lift the metadata from the map's topicmeta yet, but that will be the next step).
Thanks!
I've spent a few hours putting together a bare bones DITA -> PDF template using Chemistry, and I'm impressed with how intuitive things have been so far. However I'm stuck on a specific thing.
We're putting some metadata on the cover. Let's say, for example, "AA123456 revision 1".
The difficult bit (for me!) is that it has to be presented vertically (top to bottom, left-to-right).
Is there a way of doing that ?
Any help is welcome

(I haven't yet tried to lift the metadata from the map's topicmeta yet, but that will be the next step).
Thanks!
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Vertical text on cover
You can collect the metadata and keep it into a string variable. For example, to collect the value of the "author" element :
Please note that the string-set property accepts multiple string definitions separated by commas. Do not define the property twice on the same element, it will get overwritten by the last value.
Then, use this value from a page margin box:
In this way you can display meta information to the side of the page. If your usecase is different, please let us know.
Many regards,
Dan
Code: Select all
:root {
string-set: author oxy_xpath('//*[contains(@class, "bookmap/bookmeta")]/*[contains(@class, "topic/author")]/text()');
}
Then, use this value from a page margin box:
Code: Select all
@page front-page{
@right-top {
content: string(author) ;
transform: rotate(90deg); /* Or -90deg */
background-color:yellow;
}
}
Many regards,
Dan
-
- Posts: 13
- Joined: Sat Jun 23, 2018 12:52 am
Re: Vertical text on cover
Thank you Dan, this works just fine.
Here's the small adjustment I made for my own case (I'll remove the yellow background at the end):
Now, I've tried including metadata from a map rather than a bookmap, by slightly altering your example, and it doesn't show anything:
I probably made a rookie mistake.
Do you have any suggestions? And what can I read to know more about this?
Thank you so much.
Here's the small adjustment I made for my own case (I'll remove the yellow background at the end):
Code: Select all
@page front-page{
@bottom-right-corner {
content: string(author);
transform: rotate(-90deg);
background-color:yellow;
}
}
Now, I've tried including metadata from a map rather than a bookmap, by slightly altering your example, and it doesn't show anything:
Code: Select all
:root {
string-set: author oxy_xpath('//*[contains(@class, "map/topicmeta")]/*[contains(@class, "topic/author")]/text()');
}
Do you have any suggestions? And what can I read to know more about this?
Thank you so much.
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Vertical text on cover
This expression worked for me:
In the map there was:
Code: Select all
:root {
string-set: author oxy_xpath('//*[contains(@class, "front-page/front-page")]/*[contains(@class, "map/topicmeta")]/*[contains(@class, "topic/author")]/text()');
}
Code: Select all
<map>
<title>The Art of Bike Repair</title>
<topicmeta>
<author>John Doe</author>
</topicmeta>
....
[code]
In case you need to debug other XPath expressions:
[list]
[*] Begin by transforming your document and using your customization CSS.
[*] In the output folder, next to the PDF file you will find a [MAP_NAME].merged.xml file (if you are using the pdf-css-html5 transformation, the [MAP_NAME].merged.html file).
[*] Open the merged file in the oXygen XML Editor.
[*] Activate the XPath builder: WindowShow ViewXPath/XQuery BuilderPaste here your XPath expression and press the execute button. Check is it returns the expected results.[/list]
The XPath builder has a function that allows it to display the document path of the current element from the editor (Settings ButtonUpdate on cursor move). Alternatively you can right-click the element in the merged document and use the Copy XPath action, then paste in the XPath builder.
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