Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #26624

    I would like to know if its possible to use a different header / footer based on the page number. This is practical for printing books, where the outside edge should contain the page number. This is only possible if you can reverse the header / foot template based on even / odd page number. Thanks in advance!


    You can find general info regarding PD4ML headers/footers by the link:

    The third option allows you to define with scope attribute where a particular header/footer should appear. You may define multiple tags with different scopes.

    If you prefer to define headers/footers via API, you need to override corresponding methods of PD4PageMark. For example:
    [language=java:2gds8h30]PD4PageMark footer = new PD4PageMark() {
    public String getHtmlTemplate(int pageNumber) {
    if ( pageNumber % 2 == 0 ) {
    return “some left aligned stuff…”;
    } else {
    return “some right aligned stuff…”;

    The above example defines page-specific HTML footer. Such type of footers is not supported by PD4ML Std. For the Std verison you may override:

    PD4PageMark.getPageNumberTemplate(int pageNr);
    PD4PageMark.getPageNumberAlignment(int pageNr);
    PD4PageMark.getTitleTemplate(int pageNr);



    I am currently evaluating this software, before deciding to buy the full license. It looks like there might be a limitation with regards to headers and footers. The example above demonstrates how to define page specific content, but as far as I can see there is no way to set page specific areaHeight.

    I would like to render my first page without a header:
    [language=Java:1fdcwkd1]PD4PageMark out = new PD4PageMark();
    out.setHtmlTemplate(“…some header…”);

    The header is not displayed in the pdf, but the space it occupies (in subsequent pages) pushes the content down. Is there a way to solve this?


    It is a functional limitation of the header/footer type. PD4ML supports 3 header/footer types – see

    An inline header should solve the issue.

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

The forum ‘General questions / FAQ’ is closed to new topics and replies.