HTML to PDF / DOCX / RTF Java converter library Forums PD4ML Forums Technical questions / Troubleshooting PD4ML v3 to v4 migration: How to have the same rendering ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33888

    Hello,

    We are migrating from PD4ML v3 to v4 and we discoverd some regressions when generating PDFs.

    One of those regressions is the style “border: none” which is not taking into account in some use cases (See the attached HTML file).

    I attached the generated PDFs for both versions 3.10 and 4.0.6 for example_with_border_none.html :
    • result_pd4ml_v3.pdf
    • result_pd4ml_v4_with_new_PD4ML_class.pdf
    • result_pd4ml_v4_with_old_PD4ML_class.pdf
    When we open example_with_border_none.html with Chrome browser, the displayed result is the correct one which is different from the PD4ML v4 result.

    Could you please provide us with the migration procedure from v3 to v4 if any? Or at least how to keep the same rendering as v3?

    Attachments:
    You must be logged in to view attached files.
    #33892

    Hi Cedric,

    first please give a try to the most recent snapshot of PD4ML v4.0.8 – it should fix the border issue. I’ve attached a doc, produced on my workstation with a dev build

    Attachments:
    You must be logged in to view attached files.
    #33894

    Hello,

    Thank you for your response.

    I just tested with the recent snapshot and I confirm that it fixes the border issue 🙂

    Now the generated PDF is different from yours:
    – I have 2 pages instead of 1
    – The table is truncated in my PDF
    – The size of my PDF is 10 Ko and yours is 103 Ko

    Attached my generated doc.

    I use the PD4ML class as follow:

    PD4ML pd4ml = new PD4ML(PD4ML_LICENCE);
    pd4ml.readHTML(new ByteArrayInputStream(html.getBytes()));
    File pdf = File.createTempFile("result", ".pdf");
    FileOutputStream fos = new FileOutputStream(pdf);
    pd4ml.writePDF(fos);
    Desktop.getDesktop().open(pdf);
    

    Regards

    Attachments:
    You must be logged in to view attached files.
    #33896

    Do you have payment in dollars ?, I need to buy a license but I cannot pay in euros.
    I will appreciate your answer

    #33898

    Now the generated PDF is different from yours:
    – I have 2 pages instead of 1
    – The table is truncated in my PDF
    – The size of my PDF is 10 Ko and yours is 103 Ko

    My document embeds TTF fonts, which makes the PDF file size to grow.

    In order to solve the table truncation issue you need to trigger pd4ml.setHtmlWidth() API call passing to it a value, that roughly matches the table width in pixels.

    Do you have payment in dollars ?,

    Let me know which license you’d like to order and we’ll prepare a corresponding order link in USD.

    #33907

    Hi,

    I tried to embed the TTF to my document following the link https://pd4ml.tech/pdf-fonts/ but still have the same size (10 Ko).

    I also tried pd4ml.setHtmlWidth() for table truncation but does not solve the problem. However, pd4ml.adjustHtmlWidth(true) solved it.

    I still have 2 pages instead of one in my document.

    Could you please share the code source which you used for the document you generated?

    Regards,

    #33908

    I tried to embed the TTF to my document following the link https://pd4ml.tech/pdf-fonts/ but still have the same size (10 Ko).

    Try to invoke pd4ml.setLogLevel(255) and inspect the log output for possible font reading/embedding errors.

    I also tried pd4ml.setHtmlWidth() for table truncation but does not solve the problem. However, pd4ml.adjustHtmlWidth(true) solved it.

    adjustHtmlWidth() is an automated version of setHtmlWidth(). Just try to increase setHtmlWidth() parameter in small amounts until you achieved acceptable scale factor and layout.

    You may also run PD4ML in GUI mode and experiment with htmlWidth parameter by a resizing the app window:
    #running-pd4ml-as-a-gui-application

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

You must be logged in to reply to this topic.