slip_in_img
From officer v0.3.16
by David Gohel
append an image
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, the basename of the file must not contain any blank.
- 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".
Note
This function will be deprecated in a next release because it is not
efficient and make users write complex code. Use instead fpar()
to build
formatted paragraphs.
Examples
# NOT RUN {
img.file <- file.path( R.home("doc"), "html", "logo.jpg" )
x <- read_docx()
x <- body_add_par(x, "R logo: ", style = "Normal")
x <- slip_in_img(x, src = img.file, style = "strong", width = .3, height = .3)
print(x, target = tempfile(fileext = ".docx"))
# }
Community examples
Looks like there are no examples yet.