Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1e98d351ce
|
|||
c40bdc8e9e
|
|||
7204562879
|
@@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.496"
|
||||
const GoextVersion = "0.0.499"
|
||||
|
||||
const GoextVersionTimestamp = "2024-08-07T15:34:06+0200"
|
||||
const GoextVersionTimestamp = "2024-08-07T18:34:22+0200"
|
||||
|
@@ -245,6 +245,10 @@ func (b *WPDFBuilder) PageNo() int {
|
||||
return b.b.PageNo()
|
||||
}
|
||||
|
||||
func (b *WPDFBuilder) Bookmark(txtStr string, level int, y float64) {
|
||||
b.b.Bookmark(b.tr(txtStr), level, y)
|
||||
}
|
||||
|
||||
func (b *WPDFBuilder) GetStringWidth(str string, opts ...PDFCellOpt) float64 {
|
||||
|
||||
var fontNameOverride *PDFFontFamily
|
||||
|
@@ -293,7 +293,7 @@ func (b *WPDFBuilder) Cell(txt string, opts ...*PDFCellOpt) {
|
||||
} else if ln == BreakToRight {
|
||||
b.Rect(b.GetX()-xBefore, *height, RectOutline, NewPDFRectOpt().X(xBefore).Y(yBefore).LineWidth(0.25).DrawColor(0, 128, 0))
|
||||
} else if ln == BreakToBelow {
|
||||
b.Rect(b.GetPageWidth(), *height, RectOutline, NewPDFRectOpt().X(xBefore).Y(yBefore).LineWidth(0.25).DrawColor(0, 128, 0))
|
||||
b.Rect(b.GetPageWidth()-xBefore-b.GetMarginRight(), *height, RectOutline, NewPDFRectOpt().X(xBefore).Y(yBefore).LineWidth(0.25).DrawColor(0, 128, 0))
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -289,23 +289,28 @@ func (b *TableBuilder) calculateColumns() []float64 {
|
||||
return columnWidths
|
||||
}
|
||||
|
||||
for i, _ := range columnDef {
|
||||
if frColumnWeights[i] != 0 {
|
||||
w := min(autoWidths[i], (remainingWidth/float64(frColumnWidthCount))*frColumnWeights[i])
|
||||
remainingWidth += columnWidths[i]
|
||||
columnWidths[i] = w
|
||||
remainingWidth -= w
|
||||
{
|
||||
rmSub := 0.0
|
||||
for i := range columnDef {
|
||||
if frColumnWeights[i] != 0 {
|
||||
w := min(autoWidths[i], (remainingWidth/float64(frColumnWidthCount))*frColumnWeights[i])
|
||||
rmSub += w - columnWidths[i]
|
||||
columnWidths[i] = w
|
||||
}
|
||||
}
|
||||
remainingWidth -= rmSub
|
||||
}
|
||||
|
||||
if remainingWidth > 0 {
|
||||
if remainingWidth > 0.01 {
|
||||
rmSub := 0.0
|
||||
for i, _ := range columnDef {
|
||||
if frColumnWeights[i] != 0 {
|
||||
addW := (remainingWidth / float64(frColumnWidthCount)) * frColumnWeights[i]
|
||||
rmSub += addW
|
||||
columnWidths[i] += addW
|
||||
remainingWidth -= addW
|
||||
}
|
||||
}
|
||||
remainingWidth -= rmSub
|
||||
}
|
||||
|
||||
return columnWidths
|
||||
|
Reference in New Issue
Block a user