HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › Overflow on right margin
- This topic has 5 replies, 2 voices, and was last updated Aug 05, 2010
20:39:14 byPD4ML.
-
AuthorPosts
-
August 5, 2010 at 18:09#26435
Hi,
I am currently evaluating pd4ml.
I have a two-column table where the left column contains a single word and the right column contains a lot of text.
When rendering to PDF, the right column sometimes is clipped at the right margin. How can I avoid this problem?
August 5, 2010 at 20:12#28167Is it clipped because the right column is stretched by a non-breakable long word?
As a rule table without explicit width attribute may grow horizontally till it reaches the right edge of nesting element. (A right edge of
<body>element is defined by htmlWidth conversion parameter) However if there are big images or very long portions of unbreakable content, they will stretch the table cell to fit.A workaround depends on what you exactly faced with.
August 5, 2010 at 20:24#28168@PD4ML wrote:
Is it clipped because the right column is stretched by a non-breakable long word?
As a rule table without explicit width attribute may grow horizontally till it reaches the right edge of nesting element. (A right edge of
<body>element is defined by htmlWidth conversion parameter) However if there are big images or very long portions of unbreakable content, they will stretch the table cell to fit.A workaround depends on what you exactly faced with.
That is exactly the problem. I experimented with changing the table width, and with htmlWidth (within a
<pd4ml:transform>), but i saw no effect.What am I missing?
August 5, 2010 at 20:26August 5, 2010 at 20:28August 5, 2010 at 20:39#28171The easiest solution would be to apply “word-wrap: break-word” CSS style to the table cell.
If word breaks are undesired, there is a workaround with adjustHtmlWidth() mode. Here is a copy-pasted text from another topic:
“adjustHtmlWidth() is needed in situations like the following: you have a wide table, whose width is not constant (depends on the table content). In order to avoid table cut right side, you may define very big htmlWidth value and trigger adjustHtmlWidth(). Lets’s say htmlWidth=1200, actual table width is 980. In the case PD4ML will render the document assuming htmlWidth=1200 and analyze a right edge location of the content. In our case it is 980, so it will auto-reduce htmlWidth to 980.
A drawback: the scale factor may change itself depending on the table content and width, which is not always desired. Also if any of the tables have width=”100%”, that means the right edge of the content is going to be 1200. So adjustHtmlWidth() takes no effect.”
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.
