HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › PageSize and HtmlWidth
- This topic has 7 replies, 2 voices, and was last updated Nov 02, 2020
06:39:05 by nina_birych.
-
AuthorPosts
-
October 23, 2020 at 07:18#33998
Hello,
Could you please explain how correlate PageSize and HtmlWidth settings of PD4ML class?
Are there some rules specifying that, for example HtmlWidth should be less than PageSize’s width?
Currently we have the following defaults in our code:
pd4ml.setPageSize(new PageSize(595, 842)); pd4ml.setHtmlWidth(850);
And now we face issues with that defaults for some html files, PD4ML just get stuck and doesn’t reply, no errors are logged. But if I set HtmlWidth to 849 which is still greater than PageSize’s width – everything works fine.
We didn’t face such issues with PD4ML 4.0.9fx1, issue appears when I switch to PD4ML 4.0.9fx2-SNAPSHOT, so I also preparing a sample to report an issue. But I’m wondering if this is correct usage of PD4ML or not, so probably we should modify our defaults as well?
October 23, 2020 at 09:52#33999I’ve reported an issue describing the use case in more details.
October 23, 2020 at 11:23#34000Could you please explain how correlate PageSize and HtmlWidth settings of PD4ML class?
PageSize is the target page format, which dimensions given in physical units (mm, in, pt etc). htmlWidth can bee seen as a width of a virtual “web browser” frame. htmlWidth is mapped to pageSize.width (minus horizontal margins).
See /pd4ml-v4-programmers-manual/#customizing
PD4ML just get stuck and doesn’t reply
We’ll analyze and reply regarding the issue via the Helpdesk
October 23, 2020 at 12:37#34001PageSize is the target page format, which dimensions given in physical units (mm, in, pt etc). htmlWidth can bee seen as a width of a virtual “web browser” frame. htmlWidth is mapped to pageSize.width (minus horizontal margins).
See /pd4ml-v4-programmers-manual/#customizing
Thank you for the link, it made things more clear for me.
So, as I understand, there is no any strict recommendation that HtmlWidth should be less than PageSize.width, it just impacts the scale how PDF is generated (the more HtmlWidth the smaller scale). Correct?October 23, 2020 at 13:04#34002So, as I understand, there is no any strict recommendation that HtmlWidth should be less than PageSize.width, it just impacts the scale how PDF is generated (the more HtmlWidth the smaller scale). Correct?
No. htmlWidth value should take into account only the HTML content. Let’s say you have a 1000px-wide HTML table. If you define htmlWidth=850, the not fitting 150px of the table are going to be cut in the rendered layout. The visible 850px will be mapped to the target paper width, independently if the format is A1 or A4 or A6.
October 27, 2020 at 07:07#34003Thank you for clarification.
But it should not fail anyway, regardless of htmlWidth value passed. For now I see that different documents are not getting converted with various htmlWidth values (e.g. Doc1 gets converted fine with htmlWidth=842 but gets stuck with 850, Doc2 gets converted with htmlWidth=850 but gets stuck with 842 (or any other), and so on…). Are there any updates on this issue?October 27, 2020 at 09:30#34004Of course, it should not fail or get stuck depending on htmlWidth value. We plan to address the issue tomorrow – in the last days there was no time frame for work on it. Sorry, this is taking so long.
November 2, 2020 at 06:39#34005Hello,
Could you please provide an update on the issue?
I’m trying daily snapshot builds, but the last one (4.0.9fx2-20201028-0554) still doesn’t work.Thanks,
Nina -
AuthorPosts
You must be logged in to reply to this topic.