Second page of pdf don't display any content
sandeep1027 opened this issue · 1 comments
sandeep1027 commented
Hi,
I try this code
`htmlfile, err := ioutil.ReadFile("htmlsimple1.html")
if err != nil {
log.Fatal(err)
}
page1 := wkhtmltopdf.NewPageReader(bytes.NewReader(htmlfile))
page1.EnableLocalFileAccess.Set(true) //needed to include js
page1.FooterHTML.Set("footer.html")
page1.HeaderHTML.Set("header.html")
pdfg.AddPage(page1)
htmlfile1, err1 := ioutil.ReadFile("htmlsimple.html")
if err1 != nil {
log.Fatal(err1)
}
page2 := wkhtmltopdf.NewPageReader(bytes.NewReader(htmlfile1))
pdfg.AddPage(page2)
err = pdfg.Create()`
Pdf first page display content fine but in second page is show blank page.
SebastiaanKlippert commented
See https://pkg.go.dev/github.com/SebastiaanKlippert/go-wkhtmltopdf#PageReader you can only add one page from memory (stdin).
Anything else is technically not possible.