CSS-based PDF on wrong page header

Post here questions and problems related to editing and publishing DITA content.
Sunmy
Posts: 6
Joined: Fri Sep 06, 2019 10:58 am

CSS-based PDF on wrong page header

Post by Sunmy »

I’d like to display the page number at the bottom of the page instead top,
then I use the @page attributes in my CSS file, and specify:

@page {
@bottom-center {
content: counter(page);
font-family: "Arial","Microsoft YaHei", sans-serif; }
}

The page number is displayed on the bottom correctly.

But the header is still displayed and with wrong content, I don't even pecify it.
image.png
image.png (2.07 KiB) Viewed 1139 times
how to remove the hader?

And another question: can I display the section title in the TOC when publishing in PDF?
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: CSS-based PDF on wrong page header

Post by Costin »

Hi,

The default content of the page headers are defined through the default .css files that oXygen comes with. More specific, according to the "Default Page Definitions" section from the "DITA-OT CSS Publishing to PDF Plugin" User-Guide, the pages/headers are defined in the p-pages-and-headers.css file.
You could therefore override the rules from the default CSS. It is not recommended to modify the default CSS files, but use a customization CSS of your own instead, containing the overriding rules and passing the customization .css file to the transformation through the "args.css" parameter.

This way, you could hide the header content for specific pages (default pages / TOC pages, etc.), by setting the content: none; property on the appropriate selector that matches them.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Sunmy
Posts: 6
Joined: Fri Sep 06, 2019 10:58 am

Re: CSS-based PDF on wrong page header

Post by Sunmy »

Thanks, I'm currently trying to do that. :D
Post Reply