f
This commit is contained in:
@@ -87,6 +87,7 @@ func (r *DatabaseTableRenderer) RenderTable(pdf *gofpdf.Fpdf, tableData *TableDa
|
||||
if currentY+estimatedHeaderHeight > pageHeight-bottomMargin {
|
||||
r.logger.Debug("表头前需要分页", zap.Float64("current_y", currentY))
|
||||
pdf.AddPage()
|
||||
pdf.SetY(ContentStartYBelowHeader)
|
||||
}
|
||||
|
||||
// 绘制表头
|
||||
@@ -448,6 +449,7 @@ func (r *DatabaseTableRenderer) renderRows(pdf *gofpdf.Fpdf, rows [][]string, co
|
||||
zap.Float64("current_y", currentY),
|
||||
zap.Float64("page_height", pageHeight))
|
||||
pdf.AddPage()
|
||||
pdf.SetY(ContentStartYBelowHeader)
|
||||
// 在新页面上重新绘制表头
|
||||
if len(headers) > 0 && len(headerColWidths) > 0 {
|
||||
newHeaderStartY := pdf.GetY()
|
||||
@@ -523,6 +525,7 @@ func (r *DatabaseTableRenderer) renderRows(pdf *gofpdf.Fpdf, rows [][]string, co
|
||||
zap.Int("row_index", rowIndex),
|
||||
zap.Float64("row_height", maxCellHeight))
|
||||
pdf.AddPage()
|
||||
pdf.SetY(ContentStartYBelowHeader)
|
||||
startY = pdf.GetY()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user