rtfInit

DESCRIPTION:

Initializes rtf file with font and color table information and page type.

USAGE:

rtfInit(bLandscape = F, codepage = 1252, fonttable = c("Times New Roman",
        "Arial"), colortable = c("\\red0\\green0\\blue0"), pageheight = 11,
        pagewidth = 8.5, top.marg = 1, bottom.marg = 1, right.marg = 1.25, 
        left.marg = 1.25, header = numeric(), footer = numeric(), 
        protectDocument = F, rtfFontMap=.rtfFontMap,
        rtfStyleDataFrameIn=rtfStyleDataFrame)

ARGUMENTS:

bLandscape
T/F value that determines whether the file will be landscape or portrait oriented. If bLandscape=T, pageheight and pagewidth are switched and vert.marg and side.marg are switched (default=F).
codepage
codepage value for file (defualt=1252)
fonttable
list of fontnames to include in document. Names in list reference names in .fontMap data frame. (default=c("Times New Roman", "Arial"))
colortable
list of colors in colortable using red,green,blue values (default=c("\\red0\\green0\\blue0"))
pageheight
page height in inches (default=11)
pagewidth
page width in inches (default=8.5)
top.marg
top margin in inches (default=1)
bottom.marg
bottom margin in inches (default=1)
right.marg
right margin in inches (default=1.25)
left.marg
left margin in inches (default=1.25)
header
header margin in inches, default is no margin left for header (default=numeric())
footer
footer margin in inches, default is no margin left for footer (default=numeric())
protectDocument
Logical value that determines if the document should be protected from edits. The default is F which does not protect the document.
rtfFontMap
Data frame with font mapping information. Default is to use the built in .rtfFontMap.
rtfStyleDataFrameIn
Data frame with style information. Default is to use the built in rtfStyleDataFrame.

VALUE:

Returns the initialization string that needs to be written to the RTF file to initialize the size, fonts, colors of the report

AUTHOR(S):

TIBCO Software Inc.

EXAMPLES:

library(rtftools)

rtfFile <- "mytest.rtf"

## You can either call rtfInit(bLandscape=T/F, and additional settings)
## bLandscape will override pagewidth and pageheight
##
cat(file=rtfFile, rtfInit(bLandscape=T, 
                colortable=c("\\red0\\green0\\blue0", "\\red255\\green0\\blue0")), append=F)

## add a some text to the document
rtfWriteParagraphText("Put my large font text here.", 
                rtfFile, textstyle = "\\ql \\fs48", 
                writeText = T, newLine = T)

## close the rtf file
rtfClose(rtfFile)