Skip to contents

Builds the watermark setting for rtf_document() – a diagonal word such as "DRAFT" or "CONFIDENTIAL" drawn behind the page body, on every page.

Usage

rtf_watermark(
  text,
  font_size_half_points = 144L,
  color = "#C8C8C8",
  angle = -45,
  font = NULL,
  width_in = 6,
  height_in = 2
)

Arguments

text

The watermark word. A zero-length or empty string means no watermark.

font_size_half_points

Size in half-points, as everywhere else in the package (144L = 72 pt, the default).

color

Fill colour as "#RRGGBB". The default is a light grey that stays readable behind body text.

angle

Rotation in degrees, counter-clockwise negative. -45 (the default) is the conventional bottom-left to top-right diagonal.

font

Font family. NULL (default) uses the document font.

width_in, height_in

Size of the shape's bounding box in inches. The defaults suit a single word on a Letter/A4 page; a long phrase needs a wider box.

Value

An rtf_watermark object for rtf_document(watermark = ).

Details

The watermark is written into the section header, so it repeats per page and stays scoped to its section: concatenating with assemble_rtf() cannot leak one document's watermark into the next. A section can override the document-wide setting by passing watermark in its rtf_section(secinfo = ), including watermark = NA to turn it off for that section alone.

Examples

rtf_watermark("DRAFT")
#> <rtf_watermark>
#>   text  : DRAFT
#>   size  : 72 pt
#>   color : #C8C8C8
#>   angle : -45 deg
#>   box   : 6 x 2 in

# Bigger, redder, horizontal:
rtf_watermark("DO NOT DISTRIBUTE", font_size_half_points = 96L,
              color = "#E8B4B4", angle = 0, width_in = 7)
#> <rtf_watermark>
#>   text  : DO NOT DISTRIBUTE
#>   size  : 48 pt
#>   color : #E8B4B4
#>   angle : 0 deg
#>   box   : 7 x 2 in