utelle / wxpdfdoc

wxPdfDocument - Generation of PDF documents from wxWidgets applications
http://utelle.github.io/wxpdfdoc/
Other
71 stars 27 forks source link

WriteXML: Text position after rendering table #46

Closed dschmeer closed 5 years ago

dschmeer commented 6 years ago

If I define a table and following text like this:

<table border="1" cellpadding="0">
    <colgroup>
        <col width="40"/>
        <col width="40"/>
    </colgroup>
    <tbody>
        <tr>
            <td>ABC</td>
            <td>DEF</td>
        </tr>
        <tr>
            <td>GHI</td>
            <td>JKL</td>
        </tr>
    </tbody>
</table>
STU
<br/>
VWX

It looks like that: image Notice the text "STU" starting within the table instead of below. This could be fixed by putting in "<br/>" after the table, but when using cellpadding you are out of luck:

<table border="1" cellpadding="6">
    <colgroup>
        <col width="40"/>
        <col width="40"/>
    </colgroup>
    <tbody>
        <tr>
            <td>ABC</td>
            <td>DEF</td>
        </tr>
        <tr>
            <td>GHI</td>
            <td>JKL</td>
        </tr>
    </tbody>
</table>
STU
<br/>
VWX

image I would have expected the text "STU" to always start right below the table, on the left. By putting in m_document->SetXY(saveLeftMargin, y); right before the end of the function wxPdfTable::Write(), it does what I'd expect.

Can this be changed?

Regards

Dieter

utelle commented 6 years ago

Obviously an oversight on my side. Of course the current position should be updated accordingly after a table has been written. Thanks for reporting this issue.

The latest commit a2b100f16619b08678dc6391547de8e9e83ebceb should fix this problem.

utelle commented 5 years ago

After 6 weeks without complaints about the fix, it seems fair to assume that this issue can be closed.