Sorry if the help page is not clear on this point.
It is possible to pass header/footer options to Chrome using pagedown::chrome_print()
.
These options are the ones defined by the Chrome DevTools Protocol for the Page.printToPDF method.
You can customise the header and the footer with an HTML template. Chrome also offers the following values: date
, title
, url
, pageNumber
and totalPages
.
Following the explanations on this help page, here is an example to print the page numbers:
library(htmltools)
footer <- div(
style = "font-size: 8pt; text-align: right; width: 100%; padding-right: 12pt;",
span(class = "pageNumber"), "/", span(class = "totalPages")
)
pagedown::chrome_print(
"slidy.Rmd",
options = list(
landscape = TRUE,
displayHeaderFooter = TRUE,
footerTemplate = format(footer, indent = FALSE),
marginTop = 0,
marginBottom = 0.4
)
)