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 ?
- This topic has 6 replies, 3 voices, and was last updated Apr 21, 2020
09:22:27 by PD4ML.
-
AuthorPosts
-
March 25, 2020 at 19:12#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.March 25, 2020 at 19:31March 27, 2020 at 09:10#33894Hello,
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 KoAttached 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);
RegardsAttachments:
You must be logged in to view attached files.March 27, 2020 at 15:11#33896Do you have payment in dollars ?, I need to buy a license but I cannot pay in euros.
I will appreciate your answerMarch 27, 2020 at 17:09#33898Now 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 KoMy 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.
April 21, 2020 at 09:07#33907Hi,
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,
April 21, 2020 at 09:22#33908I 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 -
AuthorPosts
You must be logged in to reply to this topic.