These property functions modify or return the pagesize attribute of a rtf_doc object. Stored as a named vector with height and width names.

pagesize(x, ...)

pagesize(x) <- value

set_pagesize(x, value)



A rtf_doc object


Additonal arguments passed to method dispatch


A named numeric vector with the names height and width.


For pagesize(), the pagesize attribute of the rtf_doc object. For `pagesize<-`() and set_pagesize(), the modified object.


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.


library(huxtable) ht <- huxtable( column1 = 1:5, column2 = letters[1:5] ) rtf <- rtf_doc(ht, list(hf_line("aTitle"))) pagesize(rtf)
#> width height #> 11.0 8.5
# 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 #> 11 12
# width height # 8.5 12.0 # Note: Despite changing orientation, attributes don't change