CSS-Based PDF - Creating solid color headers

mdslup
Posts: 104
Joined: Tue Mar 06, 2018 1:34 am

CSS-Based PDF - Creating solid color headers

Post by mdslup » Fri Nov 09, 2018 11:43 pm

I'm using the @page element (via @top-left, @top-right, @top-left-corner, @top-right-corner) with a gray background color to create a solid header the spans the width of the page.

However, in order to get it to cover the whole width of the page, I have to the @page margin-left and margin-right to be 0.0in. Whenever I change the margins (for example, to 0.2in), the header no longer goes all the way across the page - it results in gaps on the sides, equal to the size of the margin.

Any tips on this?

Dan
Posts: 385
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS-Based PDF - Creating solid color headers

Post by Dan » Mon Nov 12, 2018 11:12 am

Hello,
If you set the margins of a page size to zero, the page margin boxes from that side will not be visible.
In general, if you want to style the header of the page, we recommend using a background image set on the entire page, as explained here:

https://www.oxygenxml.com/doc/versions/ ... und_images

If you are using Chemistry from DITA-OT, please read:

https://www.oxygenxml.com/doc/versions/ ... aid-title6

Let us know if you need more information.

Many regards,
Dan

Post Reply