library(gdtools)
register_liberationsans()
set_flextable_defaults(font.family = "Liberation Sans")
ft <- flextable(head(mtcars))
ft <- autofit(ft)
tf <- tempfile(fileext = ".png")
save_as_image(x = ft, path = tf)
init_flextable_defaults()
Run the code above in your browser using DataLab