DITA to PDF output - Alternate Header

Post here questions and problems related to editing and publishing DITA content.
Pandounours
Posts: 9
Joined: Tue Jun 29, 2021 2:27 pm

DITA to PDF output - Alternate Header

Post by Pandounours »

I read the documentation here: https://www.oxygenxml.com/doc/versions/ ... s_css.html

Default Page

The default page imposes a header that contains the publication title, chapter, and section title. They alternate on the left or right side of the page:

How do I get the header to stay in the same position?

Someone has a solution to have a background on the header and footer ?
julien_lacour
Posts: 481
Joined: Wed Oct 16, 2019 3:47 pm

Re: DITA to PDF output - Alternate Header

Post by julien_lacour »

Hello,

You will find more information in our user-guide together with some How-To topics.
https://www.oxygenxml.com/doc/versions/ ... nd_footers

You can also check the topic about How To Debug the CSS.

If you want both left and right headers to be the same, you can check and keep the rule that interests you (for example the right footer) and set it for the left footer using the :left pseudo-class. Also make sure your new rule override the default left rule by setting for example display: none on unnecessary page margin boxes.

Regards,
Julien
Pandounours
Posts: 9
Joined: Tue Jun 29, 2021 2:27 pm

Re: DITA to PDF output - Alternate Header

Post by Pandounours »

Thanks, it work well. And for background color ? Any idea ?
julien_lacour
Posts: 481
Joined: Wed Oct 16, 2019 3:47 pm

Re: DITA to PDF output - Alternate Header

Post by julien_lacour »

Hello,

For this you also need to use the page margin boxes, like this:

Code: Select all

@page {
  @top-left {
    background-color: red;
  }
}
If the color does not appear, it means that the content of the page margin box is empty, you can correct that by adding

Code: Select all

content: "";
In the CSS rule (for the corners for example).

Regards,
Julien
Post Reply