java - Freemarker, PDF, Header/Footer and page-breaks -


a common use of freemarker generation of pdf.

unfortunally have generate pdf lot of pages , "they" asking me put header information , footer somethings "page 2/60" etc...

searching on web found how create macro template share common tags (like css) doesn't tell freemarker how manage multipage pdf.

in addition this, have, inside ftl, "page-break css class" cant determine when , new page created.

im using freemakrer 2.3 on java

thanks help.

you can specify header , footer (including page numbers) css. work if tool used transform xhtml pdf byte array supports paged media instructions.

in css:

@page {      @top-center {content: element(header)}      /* header */     @bottom-center {content: element(footer)}   /* enpied */ } #header {position: running(header);} #footer {position: running(footer);} #pagenumber:before {content: counter(page);} #pagecount:before {content: counter(pages);} 

in html:

<div id="header">your header here</div> <div id="footer">page <span id="pagenumber" /> / <span id="pagecount" /></div> 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -