Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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?

    #28167

    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 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.

    #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 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 ), but i saw no effect.

    What am I missing?

    #28169

    > That is exactly the problem

    stretched by a word or by an image?

    #28170

    @PD4ML wrote:

    > That is exactly the problem

    stretched by a word or by an image?

    Yes, by a long word.

    #28171

    The 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.”

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.