SebastiaanKlippert / go-wkhtmltopdf

Golang commandline wrapper for wkhtmltopdf
MIT License
1.05k stars 144 forks source link

Footer Page number getting overlapped incase of Footer Html being added #57

Closed shreypooraa closed 4 years ago

shreypooraa commented 4 years ago

//page.FooterCenter.Set("[page]") //page.FooterHTML.Set("file:///home/tolexo/Desktop/footer.html") The following code overlaps the footer page number with html footer, I want to show the page numbers as well along with the html footer:

    var pdfg *wkhtmltopdf.PDFGenerator
wkhtmltopdf.SetPath("/usr/local/bin/wkhtmltopdf")
page := wkhtmltopdf.NewPageReader(bytes.NewReader(htmlCode))
page.FooterHTML.Set("file://footer.html")
page.FooterCenter.Set("[page]")

if pdfg, err = wkhtmltopdf.NewPDFGenerator(); err != nil {
    return
}
pdfg.AddPage(page)
pdfg.Dpi.Set(80)

if err = pdfg.Create(); err != nil {
    fmt.Println("Did I reach here 2")
    return
}
err = pdfg.WriteFile(fileDestination + "abcd.pdf")
return

}

image

image

SebastiaanKlippert commented 4 years ago

Hello,

That is a very specific question I cannot answer. I just wrote a Go wrapper for wkhtmltopdf, I cannot answer your HTML questions. I would suggest you print the page number on the side and make the footer less wide or print the page number at the bottom and make the footer less high. Or just print the page number in your HTML. You can do all of that with some HTML tweaking.

I see no bug here, it prints the page number and it prints the HTML. If you do think it is a bug the best place to start would be https://github.com/wkhtmltopdf/wkhtmltopdf not here.