Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26726

    Dear supporter,
    I have a question about header height issue.
    Here is my code

    PD4PageMark header = new PD4PageMark();
    
    // date time..
    Date today = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
    
    header.setAreaHeight(15);
    //header.setPagesToSkip(2);
    header.setTitleTemplate(" "+formatter.format(today)+"  ");
    header.setTitleAlignment(PD4PageMark.RIGHT_ALIGN);
    header.setFontSize(10);
    
    ImageIcon logo = new ImageIcon(_logoPath);
    int logo_width = logo.getIconWidth();
    int logo_height = logo.getIconHeight();
    
    header.setWatermark("file:"+_logoPath,new Rectangle(10,15,logo_width,logo_height), 100);
    
    _pdf.setPageHeader(header);
    
    PD4PageMark footer = new PD4PageMark();
    footer.setAreaHeight(20);
    footer.setPageNumberTemplate("$[page] / $[total]");
    footer.setPageNumberAlignment(PD4PageMark.CENTER_ALIGN);
    footer.setInitialPageNumber(1);
    footer.setPagesToSkip(0);
    footer.setFontSize(10);
    
    ImageIcon watermark = new ImageIcon(_watermarkPath);
    int watermark_width = watermark.getIconWidth();
    int watermark_height = watermark.getIconHeight();
    
    footer.setWatermark("file:"+_watermarkPath,new Rectangle(_width/2-(watermark_width/2),_height/2-(watermark_height/2),watermark_width,watermark_height), 30);
    
    _pdf.setPageFooter(footer);

    My question is when i set header height first page and other pages have different height. This is same situation in PD4ML html_header example.

    Any way to have same header height overall pages?

    Kind regards,
    Gabriel

    #29001

    Most probably the first page header height difference effect is caused by the <body> top margin. Try to define:

    BODY { margin-top: 0; margin-bottom: 0 }

    #29002

    It works.
    Thanks for quick replay.

    Kind regards,
    Gabriel

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

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