xmlWorker truncates tables inside a DIV

700 views Asked by At

I use xmlWorker latest version (5.4.3) to convert XHTML file in PDF. When a TABLE TAG is inside into a DIV TAG and the table overcome the page, the table is truncated...

This seems to me very strange. Or not?

Any idea?

1

There are 1 answers

0
Bruno Lowagie On BEST ANSWER

You've posted this question on different places, but let me answer it here.

You wrote: xmlWorker 5.4.3 + iText 5.4.1 ==> the images in the Table have the issue raised with my initial post. More specifically: images are scaled down.

Our answer: This is expected behavior, the image is scaled during the row splitting. However, there was a small bug in BidiLine (the image size was smaller than row height). This has now been fixed in the SVN repository. We have also improved the image tag processing. Now if an image tag has a height property it will not be scaled during row splitting. So, for a correct result, you should use something like <img width="100%" height="100%" src="image1.png"/>.

You wrote: xmlWorker 5.4.3 + iText 5.4.3 ==> the file is truncated many rows before the table in the final PDF.

Our answer: This was a bug in div/float layout introduced very recently. It has now been fixed.

You wrote: A very simple patch to this problem is to rename the DIV tag into another fake name. In that manner xmlWorker ignore the tag and therefore it does not truncate the table.

Our answer: The difference in behavior is connected to the table flag splitLate. Using a div layout it was set to false instead of the default, which is true. We have fixed this and we've set splitLate to false by default. We've seen the following problem with many of our customers: they create huge table rows, of which the row height is often more than half the page height. Not setting splitLate to false, results in plenty of pages that are half empty.

The fixes aren't released yet (they will be part of iText 5.4.5). You can find the fixes in the SVN repository: Java iText core rev. 6015; Java XMLWorker rev. 421.