This issue has been created
There are 10 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-1c62f2da-b00a-4d5f-886c-3b501412bb24 XWIKI-23695 Open

Limit how low the table cell width can go while exporting to PDF

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-bca3fd3a-b46f-4924-a31d-49e243f2e1bc Marius Dumitru Florea created this issue on 06/Nov/25 10:39
 
Summary: Limit how low the table cell width can go while exporting to PDF
Issue Type: cid:jira-generated-image-avatar-1c62f2da-b00a-4d5f-886c-3b501412bb24 Improvement
Affects Versions: 16.10.13, 17.4.7, 17.9.0
Assignee: Unassigned
Components: Export - PDF
Created: 06/Nov/25 10:39
Priority: cid:jira-generated-image-static-major-ba7ee86c-5832-449b-bc2a-948d8e8c3290 Major
Reporter: Marius Dumitru Florea
Description:

The current behavior is to convert all table cell widths from absolute (pixel) values to relative (percentage) values. Even table cells that don't have a width specified get an explicit relative width in order to have a consistent style when the table is split across multiple print pages. This change from absolute to relative values doesn't change the table layout on the screen. The problem is though that a given percent, say 5%, that is more than enough for a large screen may be too little for the print page. The result is that you end up having columns too narrow, that can fit only a single character, so words are split after each character. This increases the number of print pages and thus slows down the PDF export because Paged.js needs more time to split the content into print pages.

An improvement would be to support enforcing a lower limit on the table cell width from the PDF template. The default PDF template would use a default value, say 8ch, that custom PDF templates can overwrite. Of course, this minimum width can be controlled by the table itself.

Enforcing a lower limit on the table cell width poses a problem though: if each table cell does this then it's very probable that a table with many columns might not fit the print page width. We need to do something to avoid tables from being cut from the print page (i.e. lose information). We could detect when the table overflows the print page horizontally and:

  • try to reduce the font-size
  • and, on top of that, if needed, scale down the table using CSS transformation
 
 

10 updates

 
cid:jira-generated-image-avatar-bca3fd3a-b46f-4924-a31d-49e243f2e1bc Changes by Marius Dumitru Florea on 06/Nov/25 10:39
 
Fix Version: 17.10.0-rc-1
Fix Version: 16.10.15
Fix Version: 17.4.8
Development Priority: High
Version: 16.10.13
Version: 16.10.14
Difficulty: Unknown Medium
Description: The current behavior is to convert all table cell widths from absolute (pixel) values to relative (percentage) values. Even table cells that don't have a width specified get an explicit relative width in order to have a consistent style when the table is split across multiple print pages. This change from absolute to relative values doesn't change the table layout on the screen. The problem is though that a given percent, say 5%, that is more than enough for a large screen may be too little for the print page. The result is that you end up having columns too narrow, that can fit only a single character, so words are split after each character. This increases the number of print pages and thus slows down the PDF export because Paged.js needs more time to split the content into print pages.

An improvement would be to support enforcing a lower limit on the table cell width from the PDF template. The default PDF template would use a default value, say {{8ch}}, that custom PDF templates can overwrite. Of course, this minimum width can be controlled by the table itself.

Enforcing a lower limit on the table cell width poses a problem though: if each table cell does this then it's very probable that a table with many columns might not fit the print page width. We need to do something to avoid tables from being cut from the print page (i.e. lose information). We could detect when the table overflows the print page horizontally and:

* try to reduce the font-size
(but the table may contain images which are not affected)
* and, on top of that, if needed, scale down the table using CSS transformation
Assignee: Marius Dumitru Florea
Tests: Integration