speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
296 stars 36 forks source link

table border destroys layout within PositioningArea #354

Closed dark-m0de closed 2 years ago

dark-m0de commented 2 years ago

Dear Patrick,

I just started to discover your speedata publisher yesterday and I really love it! However, there is one thing that I experienced, that might be a bug:

Let's say you have a PositioningArea "pagehead":

<PositioningArea name="pagehead">
    <PositioningFrame width="30" height="2" row="1" column="1" />
</PositioningArea>

During AtPageShipout, you want to use a table to fill this pagehead:

<PlaceObject area="pagehead">
    <Table stretch="max">
        <Tr>
            <Td align="center" colspan="2" border-bottom="0.5pt">
                <Paragraph>
                    <B><Value>Text</Value></B>
                </Paragraph>
            </Td>
        </Tr>
        <Tr>
            <Td align="left" border-bottom="0.5pt">
                <Paragraph>
                    <B><Value>Text</Value></B>
                </Paragraph>
            </Td>
            <Td align="right" border-bottom="0.5pt">
                <Paragraph>
                    <B><Value>Text</Value></B>
                </Paragraph>
            </Td>
        </Tr>
    </Table>
</PlaceObject>

If you place the object in the area and use the "border-bottom", all rows of the table are written into the first row. Without "border-bottom" its working fine. If you instead place the object with absolute values, it works as expected.

<PlaceObject row="1" column="1">
    ...
</PlaceObject>

Since I'm completely new in this topic, there is a chance that this is not a bug but intended behaviour. However, it doesn't feel this way. Luckly, there is the workaround is to use the absolute values.

Thank you for this great tool.

BR, Conrad

pgundlach commented 2 years ago

Hello Conrad,

first of all, thank you very much for the bug report.

This depends on the height of the grid. The table borders are added to the height of the table cell. If you have your grid height and leading set to the same value (for example 12pt), without borders the two lines fit exactly (as you observe). The borders are added, so in the 12pt case there would be 12pt + 4 * 0.5pt, thus there is not enough space in the area and the text is moved to the next area of the same name, which is on the next page.

This is as intended (and should be documented), but could be considered a design flaw. Perhaps I should introduce a box-sizing parameter like in CSS.

But this might not help you in your case, as you don't want the border to overlap your text. If you post the line height and the grid height, I could inspect further.

dark-m0de commented 2 years ago

Hi Patrick,

thanks for the very fast answer. Indeed the space was not sufficient. Grid height was 12pt and text as well. What I didn't recognize was that the table was on continued on the next page. However, this makes sense. In the meanwhile I applied some different sizes to the headings and the grid. Now it works perfect!

Have a great Sunday!

BR, Conrad