Description Usage Arguments Details Value Examples
These property functions modify or return the pagesize
attribute of a
rtf_doc
object. Stored as a named vector with height
and
width
names.
1 2 3 4 5 | pagesize(x, ...)
pagesize(x) <- value
set_pagesize(x, value)
|
x |
A |
... |
Additonal arguments passed to method dispatch |
value |
A named numeric vector with the names |
Note that when the orientation of the document is switched
to 'portrait', the height and width will reverse when the RTF document is being
written - but the attribute values will not change. This is because the default
rtf_doc
orientation is 'landscape', and switching the attributes of the
object allows for a possibility of inadvertently overriding the functionality
of the orientation
attribute.
For pagesize()
, the pagesize attribute of the rtf_doc
object. For `pagesize<-`()
and set_pagesize()
, the modified
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(huxtable)
ht <- huxtable(
column1 = 1:5,
column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle")))
pagesize(rtf)
# Returns c(height = 8.5, width = 11.0)
pagesize(rtf) <- c(height = 12)
# Sets height of page to 12 inches
orientation(rtf) <- 'portrait'
pagesize(rtf)
# width height
# 8.5 12.0
# Note: Despite changing orientation, attributes don't change
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.