Experimental export to the RTF format.
export_as_rtf(
x,
file = NULL,
colwidths = propose_column_widths(matrix_form(x, TRUE)),
page_type = "letter",
pg_width = page_dim(page_type)[if (landscape) 2 else 1],
pg_height = page_dim(page_type)[if (landscape) 1 else 2],
landscape = FALSE,
margins = c(bottom = 0.5, left = 0.75, top = 0.5, right = 0.75),
font_size = 8,
font_family = "Courier",
...
)
ANY. The table-like object to export. Must have an
applicable matrix_form
method.
character(1) or NULL. If non-NULL, the path to write a
text file to containing the x
rendered as ASCII text,
numeric vector. Column widths (in characters) for use with vertical pagination.
character(1). Name of a page type. See
page_types
. Ignored when pg_width
and pg_height
are set directly.
numeric(1). Page width in inches.
numeric(1). Page height in inches.
logical(1). Should the dimensions of page_type
be inverted for landscape? Defaults to FALSE
, ignored when
pg_width
and pg_height
are set directly.
numeric(4). Named numeric vector containing 'bottom'
,
'left'
, 'top'
, and 'right'
margins in inches. Defaults
to .5
inches for both vertical margins and .75
for both
horizontal margins.
numeric(1). Font size, defaults to 12.
character(1). Name of a font family. An error will be thrown if the family named is not monospaced. Defaults to Courier.
Passed to individual methods.
RTF export occurs by via the following steps
the table is paginated to the page size (Vertically and horizontally)
Each separate page is converted to a MatrixPrintForm and from there to RTF-encoded text
Separate rtfs text chunks are combined and written out as a single RTF file
Conversion of MatrixPrintForm
objects to RTF is done via mpf_to_rtf()
.