append an image into a paragraph of an rdocx object
slip_in_img(x, src, style = NULL, width, height, pos = "after")
an rdocx object
image filename, the basename of the file must not contain any blank.
text style
height in inches
height in inches
where to add the new element relative to the cursor, "after" or "before".
# NOT RUN {
library(magrittr)
img.file <- file.path( R.home("doc"), "html", "logo.jpg" )
x <- read_docx() %>%
body_add_par("R logo: ", style = "Normal") %>%
slip_in_img(src = img.file, style = "strong", width = .3, height = .3)
print(x, target = "append_img.docx")
# }
Run the code above in your browser using DataLab