Merge branch 'v3' into v3-json-form-fill

This commit is contained in:
Gunnsteinn Hall 2019-01-10 22:02:06 +00:00 committed by GitHub
commit 4adddde141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -698,6 +698,7 @@ func (i *Invoice) generateHeaderBlocks(ctx DrawContext) ([]*Block, DrawContext,
cell := table.NewCell()
cell.SetHorizontalAlignment(CellHorizontalAlignmentLeft)
cell.SetVerticalAlignment(CellVerticalAlignmentMiddle)
cell.SetIndent(0)
cell.SetContent(i.logo)
i.logo.ScaleToHeight(titleParagraph.Height() + 20)
@ -738,6 +739,7 @@ func (i *Invoice) generateInformationBlocks(ctx DrawContext) ([]*Block, DrawCont
table.SetMargins(0, 0, 25, 0)
cell := table.NewCell()
cell.SetIndent(0)
cell.SetContent(addrDivision)
cell = table.NewCell()

View File

@ -51,7 +51,7 @@ func TestInvoiceSimple(t *testing.T) {
})
// Add invoice line items.
for i := 0; i < 10; i++ {
for i := 0; i < 75; i++ {
invoice.AddLine(
fmt.Sprintf("Test product #%d", i+1),
"1",
@ -204,11 +204,11 @@ func TestInvoiceAdvanced(t *testing.T) {
invoice.AddSection("Custom section", "This is a custom section.")
// Customize note styles.
noteStyle := invoice.AddressStyle()
noteStyle := invoice.NoteStyle()
noteStyle.Font = fontHelvetica
noteStyle.FontSize = 12
noteHeadingStyle := invoice.AddressHeadingStyle()
noteHeadingStyle := invoice.NoteHeadingStyle()
noteHeadingStyle.Color = blue
noteHeadingStyle.Font = fontHelvetica
noteHeadingStyle.FontSize = 14

View File

@ -331,7 +331,9 @@ func (table *Table) GeneratePageBlocks(ctx DrawContext) ([]*Block, DrawContext,
block = NewBlock(ctx.PageWidth, ctx.PageHeight)
ulX = ctx.Margins.left
ulY = ctx.Margins.top
ctx.Height = ctx.PageHeight - ctx.Margins.top - ctx.Margins.bottom
origHeight = ctx.Height
startrow = cell.row - 1
yrel = 0