I have been testing the HTML to PDF tool for a few days.
I have noticed that the html file which contains the <PRE> tag, the PDF file formatting looks bad. The text shrinks such that it is readable only when I zoom upto 1200%.
Can you please tell how can I overcome this issue?
I inspected a few more files and realized that the issue is that the converter doesn’t do word wrap inside the <PRE> tag.
I have attached the html file and the output that I got.
Do we have any option in the converter with which I could do word wrap in the <PRE>tag?
The PRE tag by definition is used to, among other things, preserve
line breaks. So by using it you’re telling HTML2PDF not to insert line
breaks. HTML2PDF is therefore shrinking the text to fit the PDF page,
which is fixed size determined by you. On the other hand browsers
simply make the webpage wider, since it’s not of fixed size.
You can re-create what the browser is doing, by making the PDF page
wider. Since PRE text is fixed width by definition you may be able to
determine the required page size by analyzing the html.
If this is not what you want, then at this time I can only recommend
replacing the PRE tags with something else.