HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) HTML/CSS rendering issues PD4PageMark and header/footer height for different pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26750

    Hi there,

    I’m currently evaluating PD4ML and all going well apart from the following issue. I have extended PD4PageMark to supply different HTML for the first page header/footer from the subsequent pages. For example, each header/footer would be defined by:

    <br /> public class DifferingPageMarker extends PD4PageMark {<br /> <br /> protected String firstPageHtml;<br /> protected String otherPageHtml;<br /> <br /> public DifferingPageMarker(String firstPageHtml, String otherPageHtml) {<br /> super();<br /> this.firstPageHtml = firstPageHtml;<br /> this.otherPageHtml = otherPageHtml;<br /> setAreaHeight(-1);<br /> }<br /> <br /> @Override<br /> public String getHtmlTemplate(int pageNumber) {<br /> if(pageNumber == 1) {<br /> return firstPageHtml;<br /> }<br /> return otherPageHtml;<br /> }<br /> }<br />

    The problem is that the subsequent footer/headers seem to adhere to the first page header/footer heights – so if the first header/footer is large/small, the second header/footer takes up the same space, even if the content is smaller/larger.

    Any help would be appreciated – am I not supplying the height correctly? Should I be doing this in a different way?

    Kind Regards,
    Rob

    #29056

    You are faced with a limitation of header/footer API of PD4ML. If you need different header or footer heights depending on page, you have to use inline definitions and

    See http://pd4ml.com/cookbook/pdf_header_footer_generation.htm

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.