PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) General questions / FAQ PDF page headers/footers definition options

Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #27280

    Which PD4ML version do you currently use? It can be checked in Document properties of any PDF, generated with the library.

    #27281

    I’m using the PRO version.

    #27282

    I’m trying to do somthing similar this:
    PD4PageMark header= new PD4PageMark();
    header.setHtmlTemplate(“page $[page] of $[total]“);
    header.setAreaHeight(-1);
    pd4ml.setPageHeader(header);

    PD4PageMark footer = new PD4PageMark();
    footer.setHtmlTemplate(“page $[page] of $[total]“);
    footer.setAreaHeight(-1);
    pd4ml.setPageFooter(footer);

    But the pd4ml doesn’t render the footer.

    #27283

    Nobody can help me?

    #27284

    @jos.jesus wrote:

    I’m using the PRO version.

    And which version number?

    #27285

    Try to temporarily set the height parameter to any defined value:
    footer.setAreaHeight(50);
    Does it change anything?

    #27286

    I need to use scope in headers’/footers’ settings thought java API.
    After read PD4ML API reference and some samples, I noticed that there isn’t a method to set the scope attribute.
    Is it possivel?

    #27287

    I need to use scope in headers’ and footers’ settings by java API.
    After read PD4ML API reference and some samples, I noticed that there isn’t a method to set the scope attribute.
    Is it possivel?

    #27288

    There is a number of header-definition methods:
    http://pd4ml.com/cookbook/pdf_header_footer_generation.htm

    With Java API you may either merge header definition like with HTML content (the header definition needs to be before opening tag) or to customize PD4PageMark instance;

    [language=java:2irr3x0y]PD4PageMark header = new PD4PageMark() {
    public String getHtmlTemplate(int pageNumber) {
    if ( pageNumber > 1 ) {
    return “some document header stuff…”;
    } else {
    return “”;
    }
    }
    };
    pd4ml.setPageHeader(header);[/language:2irr3x0y]

    #27289

    @PD4ML wrote:

    I am using this code to display footer using java.It is showing me String of page number but image is not being attached.I want to attach image in footer.

    [language=java:1yznuj1e]PD4PageMark footer = new PD4PageMark();
    footer.setHtmlTemplate(“page $[page] of $[total]
    “);
    footer.setAreaHeight(-1);
    pd4ml.setPageFooter(footer);[/language:1yznuj1e]

    #27292

    Hi

    I am evaluating pd4ml. Do headers/footers work with the evaulation version? Here is my code:

    File pdf = new File("/tmp/test.pdf");<br /> <br /> PD4ML pd4ml = new PD4ML();<br /> <br /> try (java.io.FileOutputStream fos = new java.io.FileOutputStream(pdf))<br /> {<br /> {<br /> PD4PageMark header = new PD4PageMark();<br /> header.setHtmlTemplate("<font color="red"><i>header $[page] of $[total]</i></font><br>");<br /> header.setAreaHeight(50);<br /> pd4ml.setPageHeader(header);<br /> }<br /> {<br /> PD4PageMark footer = new PD4PageMark();<br /> footer.setHtmlTemplate("<font color="red"><i>footer $[page] of $[total]</i></font><br>");<br /> footer.setAreaHeight(50);<br /> pd4ml.setPageHeader(footer);<br /> }<br /> pd4ml.enableDebugInfo();<br /> pd4ml.render(new StringReader("<html><body>BODY<pd4ml:page.break/>BODY2<pd4ml:page.break/>BODY3</body></html>"), fos);<br /> }

    This is the version: version: PD4ML 385 (eval)

    The PDF doc has 3 pages, the evaluation version thing is there in the footer but nothing else appears in the header or the footer area. Can you please advise what I am doing wrong?

    Thank you,
    Jozsef

    #27293

    HTML header/footer templates are supported by PD4ML Pro (and derived volume licenses). As I see you evaluate PD4ML Std, which provides support for text-only header/footer.

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

    #27290

    Okay that looks like a bigger problem then estimated.

    I have the same issue too.

    I generate a complete header and footer.

    Footer:
    <pd4ml:page.footer scope="1"><br /> <div style="background-color:red;"><br /> <p style="" class="" id=""><br><br><br><br><br><br><br><br><br><br><br><br><br> </p><br /> <table align="center"><br /> <tbody><br /> <tr><br /> <td>Inhaber:</td><br /> <td></td><br /> <td></td><br /> <td></td><br /> </tr><br /> <tr><br /> <td></td><br /> <td>Max Mustermann</td><br /> <td>Straße 1</td><br /> <td>Undso weiter</td><br /> </tr><br /> </tbody><br /> </table><br /> <p></p><br /> </div><br /> </pd4ml:page.footer>

    The footer is their (yeah) BUT! 🙁 I can only see Inhaber at the bottom of the page and also head footer is VERY high. I mean 1/2 of A4

    On the other hand, the header is shown very accurate.

    The complete html code here:
    <pd4ml:page.header scope="1"><br /> <div style="width:100%;background-color:yellow;"><br /> <div><br /> <img class="" id="" style="width:100mm;max-width:100mm;margin-left:10cm;" src="data:image/*;base64,...."><br /> <p></p><br /> </div><br /> </div><br /> </pd4ml:page.header><pd4ml:page.footer scope="1"><br /> <div style="background-color:red;"><br /> <p style="" class="" id=""><br><br><br><br><br><br><br><br><br><br><br><br><br> </p><br /> <table align="center"><br /> <tbody><br /> <tr><br /> <td>Inhaber:</td><br /> <td></td><br /> <td></td><br /> <td></td><br /> </tr><br /> <tr><br /> <td></td><br /> <td>Max Mustermann</td><br /> <td>Straße 1</td><br /> <td>Undso weiter</td><br /> </tr><br /> </tbody><br /> </table><br /> <p></p><br /> </div><br /> </pd4ml:page.footer><html><br /> <head><br /> <title>Footer</title><br /> <style>.designChapter_1{}#chapter_-3343589119799051750{}.designChapter_1{}#chapter_-7878110909822710151{}</style><br /> </head><br /> <body><br /> <div class="" style=""><br /> <div class="" id="container_-6790600175644917974" style="width:10.5cm;margin-left:2cm;height:5mm;border:1px solid orange;font-size:7pt;"><br /> <p style="" class="" id="">Intelligy Science UG | Am Neumarkt 30 | 22041 Hamburg</p><br /> </div><br /> <div class="" id="container_-7299820427654925394" style="width:10.5cm;height:12.7mm;border:1px solid red;margin-left:2cm;float:left;"></div><br /> <div class="" id="container_-5695738824325508680" style="width:10.5cm;margin-left:2cm;height:27.3mm;border:1px solid blue;float:left;font-size:10pt;"><br /> <p style="" class="" id="">#kontaktFirma#<br>#kontaktVorname# #kontaktNachname#<br>#kontaktStraße# #kontaktHausnummer#<br><br>#kontaktPLZ# #kontaktOrt#</p><br /> </div><br /> <div class="" id="container_-5799771009836692084" style="border:1px solid green;margin-left:12.5cm;margin-right:1cm;font-size:9pt;text-align:left;width:20cm;float:left;margin-top:-4cm;height:-1cm;"><br /> <p style="" class="" id="">Intelligy Science<br>Straße<br>22041 Hamburg<br><br>Telefon: <br>Fax: <br><br>E-Mail: <br>Web: </p><br /> </div><br /> <div class="" id="container_-109430433127867131" style="clear:both;"></div><br /> <div class="" id="container_-4697751580106713612" style="width:7.5cm;margin-left:2cm;border:1px solid magenta;margin-top:2.5cm;height:3.5cm;"></div><br /> <div class="" id="container_-8586357502960676866" style="width:12.5cm;border:1px solid yellow;margin-left:7.5cm;margin-top:2.5cm;height:3.5cm;"></div><br /> </div><br /> <div class="designChapter_1" style=""></div><br /> <div class="designChapter_1" style=""></div><br /> </body><br /> </html>

    The version I am using is 3.9.8fx3 Pro

    Any Idea?

    #27291

    Sorry I think I found MY mistake

    #27294

    Hai everyone, how to implement this java code below into cfscript?

    PD4PageMark footer = new PD4PageMark() {
    public String getHtmlTemplate(int pageNumber) {
    if ( pageNumber % 2 == 0 ) {
    return “some left aligned stuff…”;
    } else {
    return “some right aligned stuff…”;
    }
    }
    };
    pd4ml.setPageFooter(footer);

Viewing 15 posts - 16 through 30 (of 33 total)

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