officer (version 0.1.2)

slip_in_img: append an image

Description

append an image into a paragraph of an rdocx object

Usage

slip_in_img(x, src, style = NULL, width, height, pos = "after")

Arguments

x
an rdocx object
src
image filename
style
text style
width
height in inches
height
height in inches
pos
where to add the new element relative to the cursor, "after" or "before".

Examples

Run this code
library(magrittr)
img.file <- file.path( Sys.getenv("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