I have a pdf wrapper for gofpdf which is writing tables, the code to write rows looks like this, the headers of the table is another story...
func WriteTableRows(pdf *gofpdf.Fpdf, fontSize float64, columnSize []float64, rows [][]string) *gofpdf.Fpdf {
pdf.SetFont("Times", "", fontSize)
_, pageh := pdf.GetPageSize()
marginCell := 2.
_, _, _, mbottom := pdf.GetMargins()
_, lineHt := pdf.GetFontSize()
for _, row := range rows {
curx, y := pdf.GetXY()
x := curx
height := splitLines(row, pdf, columnSize, lineHt, marginCell)
y = AddAnotherPage(pdf, height, pageh, mbottom, y)
for i, txt := range row {
width := columnSize[i]
pdf.Rect(x, y, width, height, "")
pdf.MultiCell(width, lineHt+marginCell, txt, "", "", false)
x += width
pdf.SetXY(x, y)
}
pdf.SetXY(curx, y+height)
}
return pdf
}This source code prepares a bunch of rows to be written in the pdf file, But the thing is that all information remains in memory and I have very big tables to write, how can I write what is already processed and free the memory without close the file, because after a bunch of rows prepared, I need to read another set and 'prepare' it again, or maybe even closing the file but open again to append the next set of rows.
Maybe it is duplicated or something, I have the same question posted on stackoverflow:
Any help is appreciated, thanks,
Grace
hello allI have a pdf wrapper for gofpdf which is writing tables, the code to write rows looks like this, the headers of the table is another story...
This source code prepares a bunch of rows to be written in the pdf file, But the thing is that all information remains in memory and I have very big tables to write, how can I write what is already processed and free the memory without close the file,
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Maybe this would be a little help:
https://github.com/jung-kurt/gofpdf/issues/110
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.