Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -397,6 +397,9 @@ func drawCustomerBalancePDF(
|
||||
totalY := pdf.GetY()
|
||||
totalX := marginL
|
||||
for i, v := range totalsRow {
|
||||
if i >= len(summaryW) {
|
||||
break
|
||||
}
|
||||
pdf.Rect(totalX, totalY, summaryW[i], totalH, "FD")
|
||||
align := "L"
|
||||
if i >= 7 {
|
||||
@@ -441,6 +444,9 @@ func drawCustomerBalancePDF(
|
||||
y := pdf.GetY()
|
||||
x := marginL
|
||||
for i, v := range row {
|
||||
if i >= len(summaryW) {
|
||||
break
|
||||
}
|
||||
pdf.Rect(x, y, summaryW[i], rowH, "")
|
||||
align := "L"
|
||||
if i >= 7 {
|
||||
@@ -520,6 +526,9 @@ func drawCustomerBalancePDF(
|
||||
rowY := pdf.GetY()
|
||||
rowX := marginL
|
||||
for i, v := range line {
|
||||
if i >= len(detailW) {
|
||||
break
|
||||
}
|
||||
pdf.Rect(rowX, rowY, detailW[i], rowH, "")
|
||||
align := "L"
|
||||
if i >= 5 {
|
||||
@@ -557,6 +566,9 @@ func calcPDFRowHeight(pdf *gofpdf.Fpdf, row []string, widths []float64, wrapIdx
|
||||
if !wrapIdx[i] {
|
||||
continue
|
||||
}
|
||||
if i >= len(widths) || widths[i] <= 2 {
|
||||
continue
|
||||
}
|
||||
lines := pdf.SplitLines([]byte(strings.TrimSpace(v)), widths[i]-2)
|
||||
if len(lines) > maxLines {
|
||||
maxLines = len(lines)
|
||||
@@ -570,6 +582,9 @@ func calcPDFRowHeight(pdf *gofpdf.Fpdf, row []string, widths []float64, wrapIdx
|
||||
}
|
||||
|
||||
func drawPDFCellWrapped(pdf *gofpdf.Fpdf, value string, x, y, w, h float64, align string, lineH float64) {
|
||||
if w <= 2 || h <= 0 {
|
||||
return
|
||||
}
|
||||
text := strings.TrimSpace(value)
|
||||
lines := pdf.SplitLines([]byte(text), w-2)
|
||||
if len(lines) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user