How we can download rendertable in pdf format in R shiny without losing HTML tags that I used in the table

Table code in r shiny:

output$TextTable <- renderTable({
    varsub
  }, width = "92%", include.colnames = TRUE, spacing = "xs",
  sanitize.text.function = identity)

##I want to download this renderable using a download button or link.