public class Rtf extends Object
Example how to generate a RTF file:
Rtf.rtf().p( "Hello", bold("RTF") ).out( new FileWriter("out.rtf") );
| Modifier and Type | Method and Description |
|---|---|
Rtf |
documentFormatting(RtfDocfmt... documentFormattings)
Document formatting to specify the attributes of the document,
such as pager with, margins or footnote placement.
|
Rtf |
header(RtfHeader... headers)
Sets RTF headers for the document.
|
Rtf |
info(RtfInfo... infos)
Writes information group, which contains information about the document.
|
CharSequence |
out()
Returns the RTF document as a
CharSequence. |
void |
out(Appendable out)
Writes the RTF document and send the output to an
Appendable. |
void |
p(Object... texts)
Appends a sequence of text in a new paragraph to the RTF document.
|
static Rtf |
rtf()
Creates a new RTF document.
|
Rtf |
section(Collection<RtfPara> paragraphs)
Creates a new section with paragraphs and appends them to the RTF document.
|
Rtf |
section(RtfPara... paragraphs)
Creates a new section with paragraphs and appends them to the RTF document.
|
Rtf |
section(RtfSectionFormatAndHeaderFooter secfmtHdrftr,
RtfPara... paragraphs)
Creates a new formatted section with paragraphs and appends them to the RTF document.
|
static RtfTemplate |
template(InputStream inputStream)
Opens a RTF template for later variable substitution.
|
String |
toString()
Returns the RTF document as a String.
|
public static Rtf rtf()
public Rtf header(RtfHeader... headers)
headers - Sequence of headers.this-reference.public Rtf info(RtfInfo... infos)
infos - RTF info objects.this-reference.public Rtf documentFormatting(RtfDocfmt... documentFormattings)
documentFormattings - RTF document formattings.this-reference.public Rtf section(RtfPara... paragraphs)
paragraphs - Paragraphs.this-reference.public Rtf section(Collection<RtfPara> paragraphs)
paragraphs - Paragraphs.this-reference.public Rtf section(RtfSectionFormatAndHeaderFooter secfmtHdrftr, RtfPara... paragraphs)
secfmtHdrftr - Formattings. Might be null.paragraphs - Paragraphs to be written.this-reference.public void p(Object... texts)
section(RtfPara.p(texts));.texts - Text to put in paragraph.public void out(Appendable out)
Appendable.
This method closes the Appendable after writing if its of type
Closeable.out - Destination of this RTF output.public CharSequence out()
CharSequence.public String toString()
public static RtfTemplate template(InputStream inputStream)
inputStream - Source of the RTF file.Copyright © 2010–2015 Tutego. All rights reserved.