timrs2998 / pdf-builder

PDF builder written in Kotlin with a statically typed DSL
https://timrs2998.github.io/pdf-builder/
GNU General Public License v3.0
57 stars 16 forks source link

Text overlapping in the beginning of new page #16

Open vlipovetskii opened 5 years ago

vlipovetskii commented 5 years ago

sshot-2019-03-06- 19-09-07

            repeat(20) {
                table {

                    header {
                        text("h1")
                        text("h1")
                        text("")
                        text("")
                    }

                    row {
                        text("r1 c1")
                        text("r1 c2")
                        text("")
                        text("")
                    }
                        row {
                            text("r2 c1")
                            text("r2 c2")
                            text("")
                            text("")
                        }

                    row {
                        text("r2 c1")
                        text("r2 c2")
                        text("")
                        text("")
                    }
                    //border = Border(1f, 2f, 3f, 4f, Color.GREEN, Color.RED, Color.BLUE, Color.BLACK)
                }
            }
timrs2998 commented 5 years ago

Thanks!

This looks like a duplicate of https://github.com/timrs2998/pdf-builder/issues/9. There's a bug with tables where nothing can go below the table because the calculated height of the table is incorrect. As a workaround you can create a single table. instead of repeat(20).