Running Heads in PDF

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Running Heads in PDF

Post by Boreas »

Hello,

I have another question on PDF customization. Presently when I generate my PDF, I have in the header the name of the current section. I would like to add the superordinated level of the current section.

The file to change is cfg/fo/xsl/static-content.xsl
I understand that I need to add something to :

Code: Select all


<heading>
<fo:inline xsl:use-attribute-sets="__body__odd__header__heading">
<fo:retrieve-marker retrieve-class-name="current-header"/>
</fo:inline>
</heading>
to call the previous level....but what exactly.

Thanks again, PDF customization is one bumpy ride but with your precious help,I was able to get the layout I want.

Regards
Carole
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Running Heads in PDF

Post by Radu »

Hi Carole,

I'm not sure how to approach this. So ideally you should also ask around on the DITA Users List.

Possibly you would need to search in all the PDF plugin's XSLs for places where the marker:

Code: Select all

<fo:marker marker-class-name="current-header">
is defined and define another marker class name for the upper-header.
Then use fo:retrieve-marker to also retrieve that newly defined marker class name.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Running Heads in PDF

Post by Boreas »

Hello,
There was, indeed, available info on the Web, but I needed to figure out how the second current heading was called in the DITA-OT. I actually found it by accident...
In any case, perhaps my code does not meet standards, or can be shroten, don't hesitate to correct.

So:

In ...plugins/nameofplugin/cfg/fo/xsl/static-content.xsl

I added under the

Code: Select all

<xsl:template name="insertBodyOddHeader">
.....
<heading>
<fo:inline xsl:use-attribute-sets="__body__odd__header__heading">

the following:

Code: Select all

<!-- Add 2 Running heads-->                                
<fo:retrieve-marker retrieve-class-name="current-header"
retrieve-position="first-including-carryover"
retrieve-boundary="page-sequence"
text-align="center" font-size="10pt" font-weight="bold"/>

<!-- Add separator between each heads-->
<param ref-name="current-header"/> / <param ref-name="current-h2"/>

<fo:retrieve-marker retrieve-class-name="current-h2"
retrieve-position="last-ending-within-page"
retrieve-boundary="page-sequence"
text-align="left" font-size="10pt" font-weight="bold"/>
If you whant it to appear on the even page header, insert the code under the even page header section, etc. If you add 3 running heads, you will need to add a separator between H2 and H3: make sure to use the appropriate ref-name.

Regards

Carole
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Running Heads in PDF

Post by Radu »

Hi Carole,

Thanks for posting a possible solution for this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply