#28750

Now I see what was the problem reason: I paid no heed to converter.adjustHtmlWidth() call.

It is better to remove both: converter.adjustHtmlWidth() and convert.fitPageVertically() until you have no special need in the features.

convert.fitPageVertically() tries to place all content to a single page. It does not reflow it, but just scales down content until it fit. If needed scale factors make text extremely tiny, it gives up. Obviously it happens with the document with your current configuration.

converter.adjustHtmlWidth() first renders page with given converter.setHtmlWidth() (virtual web browser frame width), after that calculates right content edge, sets htmlWidth parameter to the new value and re-renders the page. But if the page has an element with width=100% the approach does not work as the right content edge will be always equal to the initial converter.setHtmlWidth() value.

BTW: the code

[language=java:6nsht2sl]if(landscapeView)
converter.setHtmlWidth(1000);
else
converter.setHtmlWidth(PD4Constants.LETTER.width);[/language:6nsht2sl]

is not correct. As converter.setHtmlWidth() expects a parameter given in screen pixels, but PD4Constants.LETTER.width is a paper format in typographical points. Well, they are both integer values – hopefully you know what you do.