Open Mayamikarmakar opened 4 months ago
Thanks. I will take a look at the first issue which is reproducible.
The second issue sounds like the matter of your system environment.
At least it worked on my environment.
The document of save_as_image
says it uses R graphic system.
This indicates you need some fonts...? unsure...
' This function uses R graphic system to create an image from the flextable,
' allowing for high-quality image output. See [gen_grob()] for more options.
I guess you can reproduce the second issue without ftExtra.
ft_emoji <- data.frame(emoji = c(":+1:"), stringsAsFactors = FALSE) %>%
flextable() %>%
colformat_md(md_extensions = "+emoji")
save_as_image(ft_emjoi,"emoji.png")
and maybe even without flextable
plot(1, 1, xlab = "👍")
The first issue comes from image sizes being NA
from below.
Maybe I should consider using flextable::as_image()
which has the guess_size
option or guess the size on ftExtra side.
reproducible example without ftExtra
library(flextable)
flextable(data.frame(x = 1)) |>
compose(
1, 1,
as_paragraph(chunk_dataframe(
txt = "", img_data = file.path(R.home("doc"), "html", "logo.jpg")
))
) |>
save_as_image('image.png')
doesn't give the .png file.
are not supporting the emoji's used.