0

I created a XLST-FO transformation with Altova StyleVision. The HTML output looks really fine, but if I transform my XML to PDF via Apache FOP 1.1, the (nested) table columns don't autofit like they did when using the HTML output, but have all the same size which totally screws my output. Any ideas how to realize this with XLST 1.0 ?

enter image description here

Thanks in advance!

RoodRallec
  • 57
  • 1
  • 1
  • 7

1 Answers1

0

FOP does not support automatic table layout ("autofit" tables) yet.

If the fo:table doesn't have fo:table-column children (or they don't have the column-width property), the available width is equally parted between the columns.

This is what is happening with you table:

  • each column of the outermost table, including the one with the nested tables, is given 1/3 (33.3%) of the available width
  • the first nested tables has 4 columns, each of which is given 1/4 * 1/3 (8.3%) of the available width
  • each column of the innermost table is given 1/3 * 1/4 * 1/3 (2.8%) ot the available space

In order to create a better looking PDF, you have to modify you xsl stylesheet so that your fo:table elements contain fo:table-column elements with a column-width property, either expressed as a length or a percentage.

lfurini
  • 3,729
  • 4
  • 30
  • 48