Last chance! 50% off unlimited learning
Sale ends in
Add external images into a "docx"
object.
# S3 method for docx
addImage(doc, filename, width = 6, height = 6, bookmark,
par.properties = parProperties(text.align = "center", padding = 5), ...)
Object of class "docx"
where external
image has to be added
"character"
value, complete
filenamed of the external images
images width in inches (default value is 6).
images height in inches (default value is 6).
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.
paragraph formatting properties of
the paragraph that contains images. An object of class
parProperties
further arguments, not used.
an object of class "docx"
.
# 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 DataLab