ReporteRs (version 0.7.1)

addImage.pptx: Insert an external image into a pptx object

Description

Add an external image into a pptx object.

Usage

# S3 method for pptx
addImage(doc, filename, offx, offy, width, height, ...)

Arguments

doc

pptx object where external image has to be added

filename

"character" value, complete filename of the external image

offx

optional, x position of the shape (top left position of the bounding box) in inch. See details.

offy

optional, y position of the shape (top left position of the bounding box) in inch See details.

width

optional, width of the shape in inch See details.

height

optional, height of the shape in inch See details.

...

further arguments, not used.

Value

an object of class pptx.

Details

Image is added to the next free 'content' shape of the current slide. See slide.layouts.pptx to view the slide layout.

If arguments offx, offy, width, height are missing, position and dimensions will be defined by the width and height of the next available shape of the slide. This dimensions can be defined in the layout of the PowerPoint template used to create the pptx object.

If arguments offx, offy, width, height are provided, they become position and dimensions of the new shape.

See Also

pptx, addPlot.pptx , addImage

Examples

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

# add a slide with layout "Title and Content" then add an image
doc = addSlide( doc, slide.layout = "Title and Content" )

# 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 )

writeDoc( doc, "addImage_example.pptx" )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace