Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add page numbers to PDFKit generated PDFs?

I have multiple pages generated using PDFKit. How can I add page numbers to the bottom?

like image 589
Satchel Avatar asked Feb 17 '11 19:02

Satchel


1 Answers

PDFKit.configure do |config|
  config.default_options = {
    header_right: "Page [page] of [toPage]"
  }
end

kit = PDFKit.new(body_html)

Read all detailed documentation here:
http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

PDFKit is just a wrap up for wkhtmltopdf application that is written in C.

like image 134
libo meyers Avatar answered Oct 20 '22 00:10

libo meyers