yogthos/json-to-pdf

broken colspan with innertable in cell element

dakky opened this issue · 3 comments

Hello again.

I think i found another bug:
Here is the JSON I'm using (formatted for better reading):

[
    {},
    [
        "table",
        [
            "c1r1",
            [
                "cell",
                [
                    "table",
                    [
                        "Inner table Col1",
                        "Inner table Col2",
                        "Inner table Col3"
                    ]
                ]
            ],
            "c3r1"
        ],
        [
            [
                "cell",
                {
                    "colspan": 3
                },
                "this should be a rowspan 3 for the complete row 2 of the table"
            ]
        ],
        [
            "c1r3",
            "c2r3",
            "c3r3"
        ],
        [
            "c1r4",
            "c2r4",
            "c3r4"
        ]
    ]
]

This results in a wrong interpretation of the colspan element:
image

Unfortunately, this appears to be a bug with iText itself. Seems like inner tables affect colspan of the cells in outer table for some reason. I'll have to look and see if there's any workaround for that.

@yogthos did you find a workaround for this?

I haven't had a chance to investigate further yet. It doesn't look like there's a simple fix.