Page 1 of 1

CSS-based PDF on wrong page header

Posted: Fri Sep 06, 2019 12:00 pm
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 1134 times
how to remove the hader?

And another question: can I display the section title in the TOC when publishing in PDF?

Re: CSS-based PDF on wrong page header

Posted: Fri Sep 06, 2019 5:01 pm
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

Re: CSS-based PDF on wrong page header

Posted: Wed Sep 11, 2019 1:01 pm
by Sunmy
Thanks, I'm currently trying to do that. :D