Try to customize different styles for odd- and even-numbered page headers, but failed
Posted: Fri Apr 22, 2016 7:19 am
Hi:
Does anyone try to customize styles for odd- and even-numbered page headers and footers, and had a hard time trying to customize styles? I have to say, no matter how hard and how many times I tried, I could only get one style for both odd- and even-numbered page headers.
What I wanted to do was, for the odd-page header, I wanted to insert an image on the left end and the chapter title text (current-header, I used "fo:marker" to do this) on the right end. For the even-page header, I wanted to have the second-level (current-h2) topic title on the left end, and a company image on the right. Here are the steps I followed:
1. In my customized DITA-OT, under cfg/fo/xsl, in my custom.xsl, I imported static-content.xsl.
2. I then copy the templates for "insertBodyOddHeader", "insertBodyEvenHeader","insertFirstOddHeader", "insertBodyLastHeader" from "static-content.xsl", and likewise similar templates for footers, and began my customization.
3. But, after successfully customized the odd-page header that has an image positioned on the left end, and the chapter title on the right, the even-page header looks exactly the same as the odd-page header, even if under the "insertBodyEvenHeader" template, I reversed the order, and had <fo:marker> retrive "current-h2", the even-page header still came out the same as the odd-page header.
4. I then used the default DITA-OT that came with Oxygen without any customizations to generate a PDF file, odd- and even-page headers and footers still looked exactly the same.
I began to wonder if that had something to do with FOP itself, so I used XMetaL to generate a PDF file (XMetaL came with the RenderX renderer), the generated PDF has different styles for odd- and even-page headers.
Does any of you know whether this is problem related to the renderer? If you think this is the problem with my customizations, I would be happy to send you my stylesheets offline if you are interested in taking a look, thanks.
Does anyone try to customize styles for odd- and even-numbered page headers and footers, and had a hard time trying to customize styles? I have to say, no matter how hard and how many times I tried, I could only get one style for both odd- and even-numbered page headers.
What I wanted to do was, for the odd-page header, I wanted to insert an image on the left end and the chapter title text (current-header, I used "fo:marker" to do this) on the right end. For the even-page header, I wanted to have the second-level (current-h2) topic title on the left end, and a company image on the right. Here are the steps I followed:
1. In my customized DITA-OT, under cfg/fo/xsl, in my custom.xsl, I imported static-content.xsl.
2. I then copy the templates for "insertBodyOddHeader", "insertBodyEvenHeader","insertFirstOddHeader", "insertBodyLastHeader" from "static-content.xsl", and likewise similar templates for footers, and began my customization.
3. But, after successfully customized the odd-page header that has an image positioned on the left end, and the chapter title on the right, the even-page header looks exactly the same as the odd-page header, even if under the "insertBodyEvenHeader" template, I reversed the order, and had <fo:marker> retrive "current-h2", the even-page header still came out the same as the odd-page header.
4. I then used the default DITA-OT that came with Oxygen without any customizations to generate a PDF file, odd- and even-page headers and footers still looked exactly the same.
I began to wonder if that had something to do with FOP itself, so I used XMetaL to generate a PDF file (XMetaL came with the RenderX renderer), the generated PDF has different styles for odd- and even-page headers.
Does any of you know whether this is problem related to the renderer? If you think this is the problem with my customizations, I would be happy to send you my stylesheets offline if you are interested in taking a look, thanks.