Closed N-Accumbens closed 2 years ago
Hello
Not exactly possible right now with a single command. There is one workaround via save_as_image
:
library(flextable)
library(webshot2)
ft <- flextable(head(iris)) |> autofit()
save_as_image(x = ft, path = "ft.pdf", webshot = "webshot2")
The result is a vector image PDF.
It's now implemented thanks to grid graphics! (note it can be slow with large tables)
library(flextable)
ft <- flextable(iris) |> autofit()
gr <- gen_grob(ft, scaling = "fixed", fit = "fixed", just = "center")
dims <- dim(gr)
svglite::svglite(filename = "hello-grid-graphics.svg", width = dims$width + .1, height = dims$height + .1)
plot(gr)
dev.off()
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Hello,
Great package, I'm just wondering if it'd be possible to save tables in a vector image format like svg? Having vector format images is great if you want to zoom-in to especially large tables.