Skip to content

Commit

Permalink
fixed import stream identifier (#11)
Browse files Browse the repository at this point in the history
* fixed import stream identifier

* Update README.md
  • Loading branch information
mrtsbt authored and phpdave11 committed Aug 9, 2019
1 parent cd18134 commit 3bfcd8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func main() {
rs := bytes.NewReader(pdfBytes)

// Import in-memory PDF stream with gofpdi free pdf document importer
tpl1 := gofpdi.ImportPageFromStream(pdf, rs, 1, "/TrimBox")
tpl1 := gofpdi.ImportPageFromStream(pdf, &rs, 1, "/TrimBox")

pdf.AddPage()

Expand Down
6 changes: 3 additions & 3 deletions importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ func (this *Importer) SetSourceFile(f string) {
}
}

func (this *Importer) SetSourceStream(rs io.ReadSeeker) {
this.sourceFile = fmt.Sprintf("%v", &rs)
func (this *Importer) SetSourceStream(rs *io.ReadSeeker) {
this.sourceFile = fmt.Sprintf("%v", rs)

if _, ok := this.readers[this.sourceFile]; !ok {
reader, err := NewPdfReaderFromStream(rs)
reader, err := NewPdfReaderFromStream(*rs)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 3bfcd8e

Please sign in to comment.