HTML to PDF / DOCX / RTF Java converter library Forums PD4ML Forums Technical questions / Troubleshooting Page number not full when converting HTML to PDF

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #34417


    I am using v4.0.9fx5 to convert HTML documents to PDF.

    Documents have footer with page number using “$[page]”. Unfortunately page number upper than 9 are not full. Only the first digit is print -eg “1” instead of “10”, “11” or “101”.

    I tried to use “$[page]/$[total]” but I still have a strange print. Anyway I would like to use “$[page]” on my final print.

    Any help is welcome.


    Note 1: I am upgrading from v4.0.8 and it worked well using this version.
    Note 2: The attachment is a example of my trouble. I try without css and with. First line is “$[page]” and second is “$[page]/$[total]”

    You must be logged in to view attached files.

    Having the same issue with pd4ml 4.0.9fx5. Any update on it?


    Having the same issue with pd4ml 4.1.0. Any update on it please ?


    Hi! The issue has been fixed on 2021-10-28 in v4.0.10. Also the most recent v4.1.0 snapshot has to include the bugfix.
    Please give it a try.


    I’m converting from html to pdf using Java (Using pd4ml 4.0.10 in maven):
    For eg:
    public static void convert(String inputFile, File output) throws InvokeException, IOException { PD4ML pd4ml = new PD4ML(); PageSize pageSize = new PageSize(600, 842); pd4ml.setPageSize(pageSize); PageMargins pageMargins = new PageMargins(70, 36, 56, 36); pd4ml.setPageMargins(pageMargins); File file = new File(inputFile); FileInputStream is = new FileInputStream(file); pd4ml.readHTML(is, null,; FileOutputStream outputStream = new FileOutputStream(output); pd4ml.writePDF(outputStream, "pdf"); }

    Html for the footer:
    <pd4ml:page.footer scope="1"> <section class="export-page-footer"> <tr > <td class="right"> <span class="pagenum">pag. $[page]</span> </td> </tr> </section> </pd4ml:page.footer>

    Still shows me as:
    pag. 1 for all pages from 10-19, after pag.9
    and pag. 2 for all pages from 20-29, etc..

    Any help would be appreciated.



    This issue is not yet fixed in 4.0.10 and still persists in 4.0.13. Is there any plan to fix?



    Created HELPD-385 ticket


    Hi, I generated a pdf file with headers and footers but when rotating a page, the headers and footers are also rotated. How to avoid header and footer rotation when switching from landscape to portrait orientation ?

    PD4ML version : 4.0.9fx5 (also tried with 4.1.0-SNAPSHOT)

    Thank you for your help

    You must be logged in to view attached files.
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.