You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @sampila , I just tested the latest v3.52.0 version and the bug is still there when span rows across pages ,
`
font, err := model.NewCompositePdfFontFromTTFFile("./web/public/dist/fonts/microsoft.ttf")
if err != nil {
log.Fatal(err)
}
c := creator.New()
c.EnableFontSubsetting(font)
var PPMM = float64(72 * 1.0 / 25.4)
c.SetPageSize(creator.PageSize{210 * PPMM, 297 * PPMM})
c.SetPageMargins(50, 50, 50, 50)
drawCell := func(table *creator.Table, text string, font *model.PdfFont, colspan int, rowspan int) {
p := c.NewStyledParagraph()
p.Append(text).Style.Font = font
p.SetMargins(0, 0, 5, 5)
list := make([]map[string]string, 0)
for i := 0; i < 200; i++ {
m := make(map[string]string)
m[fmt.Sprintf("row-%v", i)] = fmt.Sprintf("name:tom-%v;no:naom-%v;p-0%v", i, i, i)
list = append(list, m)
}
Hi @sampila , I just tested the latest v3.52.0 version and the bug is still there when span rows across pages ,
`
font, err := model.NewCompositePdfFontFromTTFFile("./web/public/dist/fonts/microsoft.ttf")
if err != nil {
log.Fatal(err)
}
c := creator.New()
c.EnableFontSubsetting(font)
var PPMM = float64(72 * 1.0 / 25.4)
c.SetPageSize(creator.PageSize{210 * PPMM, 297 * PPMM})
c.SetPageMargins(50, 50, 50, 50)
drawCell := func(table *creator.Table, text string, font *model.PdfFont, colspan int, rowspan int) {
p := c.NewStyledParagraph()
p.Append(text).Style.Font = font
p.SetMargins(0, 0, 5, 5)
}
drawFooter("", c, font)
list := make([]map[string]string, 0)
for i := 0; i < 200; i++ {
m := make(map[string]string)
m[fmt.Sprintf("row-%v", i)] = fmt.Sprintf("name:tom-%v;no:naom-%v;p-0%v", i, i, i)
list = append(list, m)
}
table := c.NewTable(3)
table.SetMargins(10, 10, 10, 10)
index := 0
for _, mp := range list {
for k, v := range mp {
items := strings.Split(v, ";")
drawCell(table, k, font, 1, len(items))
subIndex := 0
for _, item := range items {
drawCell(table, item, font, 1, 1)
if subIndex == 0 {
drawCell(table, k, font, 1, len(items))
}
subIndex++
}
}
c.Draw(table)
c.WriteToFile("d:/span-row-over-page.pdf")
`
span-rows-across-pages.pdf
The text was updated successfully, but these errors were encountered: