ReporteRs (version 0.7.0)

addImage.docx: Add external image into a docx object

Description

Add external images into a docx object.

Usage

## S3 method for class '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
# 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" )

Run the code above in your browser using DataLab