body_add_docx: insert an external docx

Description Usage Arguments Examples

View source: R/docx_add.R

Description

add content of a docx into an rdocx object.

Usage

1
body_add_docx(x, src, pos = "after")

Arguments

x

an rdocx object

src

docx filename

pos

where to add the new element relative to the cursor, one of "after", "before", "on".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
img.file <- file.path( R.home("doc"), "html", "logo.jpg" )
if( file.exists(img.file) ){
  # create a example file to be inserted later in the final doc----
  doc <- read_docx()
  doc <- body_add_img(x = doc, src = img.file, height = 1.06, width = 1.39 )
  print(doc, target = "external_file.docx")

  # insert external_file.docx in the final doc----
  final_doc <- read_docx()
  doc <- body_add_docx(x = doc, src = "external_file.docx" )
  print(doc, target = "final.docx")
}

davidgohel/oxbase documentation built on June 15, 2018, 7:03 a.m.