Stupi / flying-saucer

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

Flying Saucer (R8)/ iText: Page numbers do not appear on each page #151

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
http://today.java.net/pub/a/today/2007/06/26/generating-pdfs-with-flying-saucer-
and-itext.html

Page-Specific Features does not work.
I expect it to print page numbers on all pages, but it only prints it on the 
first page. 
Am I missing something? 

Thanks in advance for help. 

-------------------
@page { 
size: 4.18in 6.88in;
margin: 0.25in; 
-fs-flow-top: "header";
-fs-flow-bottom: "footer";
-fs-flow-left: "left";
-fs-flow-right: "right";
border: thin solid black;
padding: 1em;
}

#header {
font: bold serif;
position: absolute; top: 0; left: 0; 
-fs-move-to-flow: "header";
}

#footer {
font-size: 90%; font-style: italic; 
position: absolute; top: 0; left: 0;
-fs-move-to-flow: "footer";
}

#pagenumber:before {
content: counter(page); 
}

#pagecount:before {
content: counter(pages);  
}
--------------------

Original issue reported on code.google.com by yf.frank...@gmail.com on 3 Jun 2011 at 9:46

GoogleCodeExporter commented 8 years ago
I can also confirm this bug. the footer only shows on the bottom of the last 
page, and not at the bottom of every page. When we enable fs-flow elements, it 
instead prints the footer at the top of the first page, but only once. If we 
remove the fs-flow elements, it prints successfully at the bottom, but only at 
the bottom of the last page. 

As a note, counters are working correctly as the last page shows Page 6 of 6.

Original comment by voodoon...@gmail.com on 14 Jul 2011 at 7:26

GoogleCodeExporter commented 8 years ago
I got the same problem.

Original comment by liyang0...@gmail.com on 4 Jan 2012 at 8:35

GoogleCodeExporter commented 8 years ago
I had the same problem:
Maybe this workaround will work:
----------------------
CSS:
----------------------
<style type="text/css" media="print">
@page {
    size: 4.18in 6.88in;
    margin: 0.25in;
    border: thin solid black;
    padding: 1em;
    @bottom-right {
        content: element(pageFooter); }
     }

    #pagenumber:before {
        content: counter(page);
    }

    #pagecount:before {
        content: counter(pages);
    }

.pageFooter{
  position: running(pageFooter);
table.footer {width]:10cm;}
table.footer td.kolom1 {width:8cm;}
table.footer td.kolom2 {font-size: 6pt;width:2cm;}
</style>
---------------------------------------------
HTML
---------------------------------------------
<div class="pageFooter">
<table class="footer"><tr><td class="kolom1"> </td><td class="kolom2"> page 
<span id="pagenumber"></span> of <span id="pagecount"></span></td></tr></table>
</div>

I add the table part because the alignment doesn't seem to work

Original comment by leo.ma...@wxs.nl on 27 Oct 2013 at 4:07

GoogleCodeExporter commented 8 years ago
FYI,

It appears that by version R8 the custom properties were deprecated (and 
removed) as CSS3 now supports these features:

[1] 
http://markmail.org/search/?q=move-to-flow#query:move-to-flow+page:1+mid:s5334tk
25paibcgi+state:results

[2] http://www.w3.org/TR/css3-page/

[3] http://www.w3.org/TR/css3-gcpm/

Original comment by christop...@gmail.com on 20 Dec 2013 at 8:08