CSS-Based PDF question about footers
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 167
- Joined: Tue Mar 06, 2018 1:34 am
CSS-Based PDF question about footers
I'm using the @page attributes to create headers and footers.
For example, in my @bottom-left I specify
@bottom-left {
content: "Part number: XXX";
}
I'd like to have the "XXX" be in a different color, but I can't figure out how to do that. Any tips?
For example, in my @bottom-left I specify
@bottom-left {
content: "Part number: XXX";
}
I'd like to have the "XXX" be in a different color, but I can't figure out how to do that. Any tips?
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: CSS-Based PDF question about footers
Hello,
This can be done using an SVG image that contains the text "Part Number" with a color, like this:
Then use it from the CSS:
The color of the "XXX" text can be controlled from the CSS property. The rest from the SVG.
However currently the vertical-align is working as expected on images, so the image will be a bit out of alignment. I recommend to write us on the support email address to get access to a nightly build.
Many regards,
Dan
This can be done using an SVG image that contains the text "Part Number" with a color, like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="60pt" height="10pt" font-size="10pt" alignment-baseline="after-edge" font-family="SansSerif" > <!-- The height is as big as the font -->
<desc>Part number</desc> <!-- Use the same value as the text, so the PDF document will be accessible (the screen readers will use it) -->
<style type="text/css">
.txt { fill: red; } <!-- Add here the styles for the entire text. -->
.italic-blue {font-style:italic; fill: blue;} <!-- You can also style fragments of the text also.. -->
</style>
<text x="0" y="0.8em" class="txt">Part <tspan class="italic-blue">number</tspan>:</text> <!-- Used 0.8em to emulate the text baseline. -->
</svg>
Code: Select all
@page {
@top-left {
font-family:SansSerif;
font-size: 10pt;
content: url("part_no.svg") " XXX";
color: blue;
vertical-align:middle;
}
}
However currently the vertical-align is working as expected on images, so the image will be a bit out of alignment. I recommend to write us on the support email address to get access to a nightly build.
Many regards,
Dan
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