fix(table rendering): correct incorrect table width percentage calcul…#726
Merged
Conversation
…ation and table colspan boundary detection
Contributor
Author
Member
|
Thanks @rowstop for yoru contribution. @kevinleturc is there any chance that you review the PR please? |
kevinleturc
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes DOCX-to-PDF table rendering issues in
XWPF2PDFViaITextConverter, especially for tables that use vertical merges (vMerge), and aligns percentage width handling with OOXML semantics.Changes and Reasons
1) Fix off-by-one in colspan coverage check (core layout fix)
File
/xdocreport/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedPdfPTable.javaChange
getCellAboveWithColspan(...), changed:cell.getColspan() + colCursor >= indexFromcell.getColspan() + colCursor > indexFromWhy
2) Correct percentage table width conversion in core table utilities
Files
/xdocreport/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/utils/XWPFTableUtil.java/xdocreport/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/table/cell/TableCellWidthValueProvider.javaChange
w:type="pct"widths, changed conversion:/100f->/50fWhy
5000means100%.Validation
XWPF2PDFViaITextConverter.vMergeis now stable after the colspan boundary fix.Scope