...
1 package httpimg_test
2
3 import (
4 "github.com/jung-kurt/gofpdf"
5 "github.com/jung-kurt/gofpdf/contrib/httpimg"
6 "github.com/jung-kurt/gofpdf/internal/example"
7 )
8
9 func ExampleRegister() {
10 pdf := gofpdf.New("L", "mm", "A4", "")
11 pdf.SetFont("Helvetica", "", 12)
12 pdf.SetFillColor(200, 200, 220)
13 pdf.AddPage()
14
15 url := "https://github.com/jung-kurt/gofpdf/raw/master/image/logo_gofpdf.jpg?raw=true"
16 httpimg.Register(pdf, url, "")
17 pdf.Image(url, 15, 15, 267, 0, false, "", 0, "")
18 fileStr := example.Filename("contrib_httpimg_Register")
19 err := pdf.OutputFileAndClose(fileStr)
20 example.Summary(err, fileStr)
21
22
23 }
24
View as plain text