Stupi / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Issue with @page margin:0 and running header/footer #197

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Using header / footer with css running elements works like a charm when 
printing to a pdf.
However, when setting the page's margin to zero (i.e. stick footer header 
exactly on page borders), I am having troubles:

1.) The page's content floats into the header
2.) The page's footer is outside the page

Only using margin-left/right:0 works perfect but troubles begin with top/bottom.
Here's a sample code to see the effect:

<html><head><style> 
          div.header { 
          display: none;
          text-align: center;  
          position: running(header);
          }

          div.footer
          { 
          display: none;
          text-align: center;  
          position: running(footer);
          } 

          div.content {
            page-break-after: always;
          } 
          @page { @top-center { content: element(header) }} 
          @page { @bottom-center { content: element(footer) }} 
          @page {
            padding: 0px;
            margin: 0px;
          }            

          @media print {
            div.header {
                background: red;
                display: block;
            }
            div.footer
            {
                display: block;
                background: blue;
            }
          }
          body
          {
            padding: 0px;
            margin: 0px;
          }
          </style></head> 
          <body><div class='header'>Header</div><div class='footer'>Footer</div><div class='content'>Page1</div><div>Page2</div></body></html>

Original issue reported on code.google.com by aa...@quasado.com on 15 May 2012 at 9:18

GoogleCodeExporter commented 8 years ago
I'm having the same issue. It seems that the running element has an absolute 
position.
The draft says that the running element is positionned in the margins 
(http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#running1) but how to have a 
dynamically sized margin ?

Original comment by maxime.d...@gmail.com on 17 Jul 2012 at 8:46

GoogleCodeExporter commented 8 years ago
I'm having the same problem. Are there any solutions now???

Original comment by larz.kn...@gmail.com on 4 Jun 2013 at 7:39