ReporteRs (version 0.6.9)

addImage.docx: Add external image into a docx object

Description

Add external images into a docx object.

Usage

# S3 method for docx
addImage(doc, filename, bookmark,
  par.properties = parProperties(text.align = "center", padding = 5), ...)

Arguments

doc

Object of class docx where external image has to be added

filename

"character" value, complete filename of the external image

bookmark

a character value ; id of the Word bookmark to replace by the image. optional. if missing, image is added at the end of the document. See bookmark.

par.properties

paragraph formatting properties of the paragraph that contains images. An object of class parProperties

...

further arguments, not used.

Value

an object of class docx.

See Also

docx, addPlot.docx , addImage, bookmark

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
# Create a new document
doc = docx( title = "title" )

# the file 'logo.jpg' only exists in R for Windows
img.file = file.path( Sys.getenv("R_HOME"), "doc", "html", "logo.jpg" )
doc = addImage(doc, img.file )

# Write the object in file "addImage_example.docx"
writeDoc( doc, "addImage_example.docx" )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace