This commit is contained in:
Joerg Lehmann 2020-04-22 17:59:23 +02:00
parent 2aac59640e
commit a86fa3c9ee
2 changed files with 19 additions and 7 deletions

BIN
logos/nbit-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -30,14 +30,16 @@ var pdf *gofpdf.Fpdf
var y_pos float64
var invoice_data InvoiceData
const margin_top = 7
const logo_top = 6
const logo_height = 23
const line_spacing = 4
const tabstop_left = 20
const tabstop_header_label = 80
const tabstop_header_value = 100
const tabstop_left_2 = 32
const tabstop_address = 10
const tabstop_count = 10
const tabstop_price = 10
const tabstop_total = 10
const tabstop_total = 170
const tabstop_logo = 155
func ReadInvoiceData(filename string) {
invoice_data.invoice_number = "1"
@ -68,19 +70,29 @@ func SetupInvoice() {
}
func PrintPageHeader(firstPage bool) {
var opt gofpdf.ImageOptions
pdf.AddPage()
y_pos = margin_top
pdf.SetFont("Dejavusans-Bold", "", 9)
WriteText(tabstop_left, y_pos, "nbit Informatik GmbH")
pdf.SetFont("Dejavusans", "", 9)
WriteText(tabstop_header_label, y_pos, "Tel.")
WriteText(tabstop_header_value, y_pos, "+41 31 792 00 40")
y_pos = y_pos + line_spacing
WriteText(tabstop_left, y_pos, "Kirchweg 2")
WriteText(tabstop_header_label, y_pos, "EMal")
WriteText(tabstop_header_value, y_pos, "joerg.lehmann@nbit.ch")
y_pos = y_pos + line_spacing
WriteText(tabstop_left, y_pos, "3510 Konolfingen")
y_pos = y_pos + line_spacing
y_pos = y_pos + line_spacing
WriteText(tabstop_left, y_pos, "Tel.")
WriteText(tabstop_left_2, y_pos, "+41 31 792 00 40")
y_pos = y_pos + line_spacing
WriteText(tabstop_left, y_pos, "EMail")
WriteText(tabstop_left_2, y_pos, "joerg.lehmann@nbit.ch")
y_pos = y_pos + line_spacing
opt.ImageType = "png"
opt.ReadDpi = true
pdf.ImageOptions("logos/nbit-logo.png", tabstop_logo, logo_top, 0, logo_height, false, opt, 0, "")
}
func main() {