diff --git a/contrib/gofpdi/gofpdi.go b/contrib/gofpdi/gofpdi.go index 7b9c8229..8cf8d445 100644 --- a/contrib/gofpdi/gofpdi.go +++ b/contrib/gofpdi/gofpdi.go @@ -9,8 +9,9 @@ however that use of the default Importer is not thread safe. package gofpdi import ( - realgofpdi "github.com/phpdave11/gofpdi" "io" + + realgofpdi "github.com/phpdave11/gofpdi" ) // gofpdiPdf is a partial interface that only implements the functions we need @@ -49,7 +50,7 @@ func (i *Importer) ImportPage(f gofpdiPdf, sourceFile string, pageno int, box st // (/MediaBox, TrimBox, /ArtBox, /CropBox, or /BleedBox). Returns a template id // that can be used with UseImportedTemplate to draw the template onto the // page. -func (i *Importer) ImportPageFromStream(f gofpdiPdf, rs *io.ReadSeeker, pageno int, box string) int { +func (i *Importer) ImportPageFromStream(f gofpdiPdf, rs io.ReadSeeker, pageno int, box string) int { // Set source stream for fpdi i.fpdi.SetSourceStream(rs) // return template id @@ -120,7 +121,7 @@ func ImportPage(f gofpdiPdf, sourceFile string, pageno int, box string) int { // that can be used with UseImportedTemplate to draw the template onto the // page. // Note: This uses the default Importer. Call NewImporter() to obtain a custom Importer. -func ImportPageFromStream(f gofpdiPdf, rs *io.ReadSeeker, pageno int, box string) int { +func ImportPageFromStream(f gofpdiPdf, rs io.ReadSeeker, pageno int, box string) int { return fpdi.ImportPageFromStream(f, rs, pageno, box) } diff --git a/contrib/gofpdi/gofpdi_test.go b/contrib/gofpdi/gofpdi_test.go index b5e611f8..d5a55d94 100644 --- a/contrib/gofpdi/gofpdi_test.go +++ b/contrib/gofpdi/gofpdi_test.go @@ -2,11 +2,12 @@ package gofpdi import ( "bytes" - "github.com/phpdave11/gofpdf" - "github.com/phpdave11/gofpdf/internal/example" "io" "sync" "testing" + + "github.com/phpdave11/gofpdf" + "github.com/phpdave11/gofpdf/internal/example" ) func ExampleNewImporter() { @@ -20,7 +21,7 @@ func ExampleNewImporter() { imp := NewImporter() // import first page and determine page sizes - tpl := imp.ImportPageFromStream(pdf, &rs, 1, "/MediaBox") + tpl := imp.ImportPageFromStream(pdf, rs, 1, "/MediaBox") pageSizes := imp.GetPageSizes() nrPages := len(imp.GetPageSizes()) @@ -28,7 +29,7 @@ func ExampleNewImporter() { for i := 1; i <= nrPages; i++ { pdf.AddPage() if i > 1 { - tpl = imp.ImportPageFromStream(pdf, &rs, i, "/MediaBox") + tpl = imp.ImportPageFromStream(pdf, rs, i, "/MediaBox") } imp.UseImportedTemplate(pdf, tpl, 0, 0, pageSizes[i]["/MediaBox"]["w"], pageSizes[i]["/MediaBox"]["h"]) } @@ -51,7 +52,7 @@ func TestGofpdiConcurrent(t *testing.T) { pdf.AddPage() rs, _ := getTemplatePdf() imp := NewImporter() - tpl := imp.ImportPageFromStream(pdf, &rs, 1, "/MediaBox") + tpl := imp.ImportPageFromStream(pdf, rs, 1, "/MediaBox") imp.UseImportedTemplate(pdf, tpl, 0, 0, 210.0, 297.0) // write to bytes buffer buf := bytes.Buffer{} diff --git a/go.sum b/go.sum index 0f70e932..7a1d32ac 100644 --- a/go.sum +++ b/go.sum @@ -3,19 +3,8 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/phpdave11/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/phpdave11/gofpdi v1.0.7 h1:k2oy4yhkQopCK+qW8KjCla0iU2RpDow+QUDmH9DDt44= -github.com/phpdave11/gofpdi v1.0.7/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.9 h1:MpzgK5tRbY7mfiGcLcV3CUk3sFBa61xbBXDYW3LlmBM= -github.com/phpdave11/gofpdi v1.0.9/go.mod h1:r/fO8a9KSCrpwwTaqEx3amFJ6IHjfvAq7w1GP0XYRcg= -github.com/phpdave11/gofpdi v1.0.10 h1:hghWGyJV8uSyIYvzCasOtqevbV/4FCL8fef9y8ttJTU= -github.com/phpdave11/gofpdi v1.0.10/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.11 h1:wsBNx+3S0wy1dEp6fzv281S74ogZGgIdYWV2PugWgho= -github.com/phpdave11/gofpdi v1.0.11/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.12 h1:RZb9NG62cw/RW0rHAduVRo+98R8o/G1krcg2ns7DakQ= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13 h1:o61duiW8M9sMlkVXWlvP92sZJtGKENvW3VExs6dZukQ= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -25,8 +14,6 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58 h1:nlG4Wa5+min github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/image v0.0.0-20190902063713-cb417be4ba39 h1:4dQcAORh9oYBwVSBVIkP489LUPC+f1HBkTYXgmqfR+o= -golang.org/x/image v0.0.0-20190902063713-cb417be4ba39/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a h1:gHevYm0pO4QUbwy8Dmdr01R5r1BuKtfYqRqF0h/Cbh0= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=