HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) HTML/CSS rendering issues Table rendering issue with cells containing empty <p> tags

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27018

    We are using pd4ml library pro v396 to save html content in pdf and rtf format.
    The html content comes from an external source and cant be changed.

    While table formatting works perfekt in most cases some of the table cells in the html input may contain empty tags.
    They seem to mess up the calculation of column/table width by extremely stretching the containing column.

    Is there any workaround for this behaviour besides of fixing the html input?

    I have attached the html source file and the resulting pdf.

    Thanks in advance for your help.

    #29736

    For the given document type a possible solution is to define an extra style to shrink a table and to ensure, it makes no undesired line-wraps:

    [language=css:2estpj1l]table { width: 200 }
    td { white-space: nowrap; }[/language:2estpj1l]

    The style can be passed via pd4ml.addStyle(css, true) API call.

    See http://pd4ml.com/api/org/zefer/pd4ml/PD4ML.html#addStyle(java.lang.String,%20boolean)

    #29737

    Thanks for your answer.

    Unfortunately this solution is only suitable for exactly the example provided but not for any table that may have to be rendered.
    The problem with the empty tags may occur in tables with cells of arbitrary content length, thus I may neither prohibit line breaks nor shrink the table.

    Are there any plans to fix this problem in PD4ML library?

    #29738

    We’ve been working on the issue. If everything ok, the fix will be available with the forthcoming maintenance release in few days.

    #29739

    The fix released with version PD4ML Pro 3.9.7 works fine for the first table of the provided example.

    But the second table still sizes strange:
    The last column only contains empty tags but occupies half of the table width while the text of the second column has to be wrapped.

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

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