Package com.lowagie.text.rtf
Class RtfWriter
- java.lang.Object
-
- com.lowagie.text.DocWriter
-
- com.lowagie.text.rtf.RtfWriter
-
- All Implemented Interfaces:
DocListener,ElementListener,java.util.EventListener
public class RtfWriter extends DocWriter implements DocListener
Deprecated.The RtfWriter is deprecated and will be removed from the iText library end of 2007If you are creating a new project using the rtf part of iText, please consider using the new RtfWriter2. The RtfWriter is in bug-fix-only mode, will be deprecated end of 2005 and removed end of 2007. ADocWriterclass for Rich Text Files (RTF).A
RtfWritercan be added as aDocListenerto a certainDocumentby getting an instance. EveryElementadded to the originalDocumentwill be written to theOutputStreamof thisRtfWriter.Example:
// creation of the document with a certain size and certain margins Document document = new Document(PageSize.A4, 50, 50, 50, 50); try { // this will write RTF to the Standard OutputStream RtfWriter.getInstance(document, System.out); // this will write Rtf to a file called text.rtf RtfWriter.getInstance(document, new FileOutputStream("text.rtf")); // this will write Rtf to for instance the OutputStream of a HttpServletResponse-object RtfWriter.getInstance(document, response.getOutputStream()); } catch(DocumentException de) { System.err.println(de.getMessage()); } // this will close the document and all the OutputStreams listening to it document.close();LIMITATIONS
There are currently still a few limitations on what the RTF Writer can do:- Watermarks
- Viewer preferences
- Encryption
- Embedded fonts
- Phrases with a leading
- Lists with non-bullet symbols
- Nested tables
- Images other than JPEG and PNG
- Rotated images
- Author:
- Mark.Hall@myrealbox.com, Steffen Stundzig, Eric Mattes, Raul Wegmann
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]alignCenterDeprecated.Text alignment center tag.static byte[]alignJustifyDeprecated.Text alignment justify tag.static byte[]alignLeftDeprecated.Text alignment left tag.static byte[]alignRightDeprecated.Text alignment right tag.private static byte[]annotationDeprecated.Annotation text tag.private static byte[]annotationAuthorDeprecated.Annotation Author tag.private static byte[]annotationIDDeprecated.Annotation ID tag.private static byte[]ansiDeprecated.RTF encoding.private static byte[]ansiCodepageDeprecated.RTF encoding codepage.protected static byteboldDeprecated.Bold tag.static bytecloseGroupDeprecated.This is the character for closing a group.private static byte[]colorBlueDeprecated.Blue value tag.private static byte[]colorGreenDeprecated.Green value tag.private java.util.ArrayListcolorListDeprecated.ThisArrayListcontains all colours used in the document.private static byte[]colorRedDeprecated.Red value tag.private static byte[]colorTableDeprecated.Begin colour table tag.private static bytecommaDelimiterDeprecated.This is another delimiter between RTF tags and normal text.private java.io.ByteArrayOutputStreamcontentDeprecated.ThisByteArrayOutputStreamcontains the main body of the document.private intcurrentListIDDeprecated.Current list ID.private static byte[]dayDeprecated.Day tag.private static byte[]defaultFontDeprecated.Default Font.protected static bytedelimiterDeprecated.This is the delimiter between RTF tags and normal text.private static byte[]docBeginDeprecated.RTF begin and version.private static byte[]endSuperSubDeprecated.End super/sub script.static byteescapeDeprecated.This is the escape character which introduces RTF tags.private static byte[]extendedEscapeDeprecated.This is another escape character which introduces RTF tags.private static byte[]facingPagesDeprecated.Facing pages tagprotected static byte[]fieldDeprecated.Begin field tagprotected static byte[]fieldContentDeprecated.Content fo the fieldprotected static byte[]fieldDisplayDeprecated.Last page number (not used)protected static byte[]fieldHyperlinkDeprecated.HYPERLINK fieldprotected static byte[]fieldPageDeprecated.PAGE numbersprivate static byte[]firstIndentDeprecated.First indent tag.private static byte[]fontArialDeprecated.Font Arial tag.private static byte[]fontCharsetDeprecated.Font charset tag.protected static byte[]fontColorDeprecated.Font color tag.private static byte[]fontCourierDeprecated.Font Courier tag.private java.util.ArrayListfontListDeprecated.ThisArrayListcontains all fonts used in the document.private static byte[]fontModernDeprecated.Modern font tag.protected static bytefontNumberDeprecated.Font number tag.private static byte[]fontRomanDeprecated.Roman font tag.protected static byte[]fontSizeDeprecated.Font size tag.private static byte[]fontSwissDeprecated.Swiss font tag.private static byte[]fontSymbolDeprecated.Font Symbol tag.private static byte[]fontTableDeprecated.Begin the font table tag.private static byte[]fontTechDeprecated.Tech font tag.private static byte[]fontTimesNewRomanDeprecated.Font Times New Roman tag.private static byte[]fontWindingsDeprecated.Font Windings tag.private HeaderFooterfooterDeprecated.Document footer.private static byte[]footerBeginDeprecated.Begin footer group tag.private static byte[]footerfBeginDeprecated.private static byte[]footerlBeginDeprecated.private static byte[]footerrBeginDeprecated.private booleanhasTitlePageDeprecated.Special title pageprivate HeaderFooterheaderDeprecated.Document header.private static byte[]headerBeginDeprecated.Begin header group tag.private static byte[]headerfBeginDeprecated.private static byte[]headerlBeginDeprecated.private static byte[]headerrBeginDeprecated.private static byte[]hourDeprecated.Hour tag.private static byte[]hybridListDeprecated.RTF Writer outputs hybrid listsprivate java.io.ByteArrayOutputStreaminfoDeprecated.ThisByteArrayOutputStreamcontains the information group.private static byte[]infoBeginDeprecated.Begin the info group tag.private booleaninHeaderFooterDeprecated.Currently writing either Header or Footerprivate booleaninTableDeprecated.Currently writing a Tableprotected static byteitalicDeprecated.Italic tag.private booleanlandscapeDeprecated.Landscape or Portrait Documentprivate static byte[]landscapeTag1Deprecated.Document Landscape tag 1.private static byte[]landscapeTag2Deprecated.Document Landscape tag 2.private static byte[]listBeginDeprecated.Actual list beginprivate static byte[]listBulletOldDeprecated.Old Bullet Styleprivate static byte[]listCurrentLevelDeprecated.Current list levelprivate static byte[]listDefinitionDeprecated.Begin a List definitionprivate static byte[]listIDDeprecated.Current List IDprivate java.util.ArrayListlistIdsDeprecated.List of current Lists.private static byte[]listIndentDeprecated.Left indent tag.private intlistLevelDeprecated.Current List Level.private static byte[]listLevelAlignNewDeprecated.Level alignment (new)private static byte[]listLevelAlignOldDeprecated.Level alignment (old)private static byte[]listLevelDefinitionDeprecated.Current List levelprivate static byte[]listLevelNumbersDeprecated.Filler for Level Numbersprivate static byte[]listLevelNumbersDefinitionDeprecated.Level Numbers Definitionprivate static byte[]listLevelStartAtDeprecated.Level starting numberprivate static byte[]listLevelTextDefinitionDeprecated.Level text groupprivate static byte[]listLevelTextLengthDeprecated.Filler for Level Text Lengthprivate static byte[]listLevelTextStyleBulletDeprecated.Level Text Bullet Styleprivate static byte[]listLevelTextStyleNumbersDeprecated.Level Text Numbering Styleprivate static byte[]listLevelTypeNewDeprecated.Level numbering (new)private static byte[]listLevelTypeOldDeprecated.Level numbering (old)private java.io.ByteArrayOutputStreamlistoverrideDeprecated.ThisByteArrayOutputStreamcontains the list override table.private static byte[]listOverrideDeprecated.List overrideprivate static byte[]listOverrideCountDeprecated.Number of overridesprivate static byte[]listoverridetableGroupDeprecated.Begin the List Override Tableprivate java.io.ByteArrayOutputStreamlisttableDeprecated.ThisByteArrayOutputStreamcontains the list table.private static byte[]listtableGroupDeprecated.Begin the List Tableprivate static byte[]listTemplateIDDeprecated.List Template IDprivate static byte[]listTextOldDeprecated.List text group for older browsersprivate intmarginBottomDeprecated.Bottom margin.private intmarginLeftDeprecated.Left margin.private intmarginRightDeprecated.Right margin.private intmarginTopDeprecated.Top margin.private intmaxListLevelDeprecated.Current maximum List Level.private static byte[]metaAuthorDeprecated.Author tag.private static byte[]metaCreationDateDeprecated.Creation Date tag.private static byte[]metaKeywordsDeprecated.Keywords tag.private static byte[]metaProducerDeprecated.Producer tag.private static byte[]metaSubjectDeprecated.Subject tag.private static byte[]metaTitleDeprecated.Title tag.private static byte[]minuteDeprecated.Minute tag.private static byte[]monthDeprecated.Month tag.private static byte[]newPageDeprecated.New Page tag.static byteopenGroupDeprecated.This is the character for beginning a new group.private intpageHeightDeprecated.Page height.private intpageWidthDeprecated.Page width.static byte[]paragraphDeprecated.Begin new paragraph tag.static byte[]paragraphDefaultsDeprecated.Reset paragraph defaults tag.private static byte[]pictureDeprecated.Begin the picture tagprivate static byte[]pictureBMPDeprecated.BMP Imageprivate static byte[]pictureGroupDeprecated.Begin the main Picture group tagprivate static byte[]pictureHeightDeprecated.Picture heightprivate static byte[]pictureJPEGDeprecated.JPEG Imageprivate static byte[]picturePNGDeprecated.PNG Imageprivate static byte[]pictureScaleXDeprecated.Picture scale horizontal percentprivate static byte[]pictureScaleYDeprecated.Picture scale vertical percentprivate static byte[]pictureWidthDeprecated.Picture widthprivate static byte[]pictureWMFDeprecated.WMF Imageprivate static byte[]rightIndentDeprecated.Right indent tag.private static byte[]rtfMarginBottomDeprecated.Margin bottom tag.private static byte[]rtfMarginLeftDeprecated.Margin left tag.private static byte[]rtfMarginRightDeprecated.Margin right tag.private static byte[]rtfMarginTopDeprecated.Margin top tag.private static byte[]rtfPaperHeightDeprecated.Paper height tag.private static byte[]rtfPaperWidthDeprecated.Paper width tag.private static byte[]secondDeprecated.Second tag.private static byte[]sectionDeprecated.Begin new section tag.private static byte[]sectionDefaultsDeprecated.Reset section defaults tag.static byte[]sectionPageHeightDeprecated.Page height of a section.static byte[]sectionPageWidthDeprecated.Page width of a section.private static byte[]startSubDeprecated.Start subscript.private static byte[]startSuperDeprecated.Start superscript.protected static byte[]strikethroughDeprecated.Strikethrough tag.private static byte[]tabDeprecated.Tabprivate static byte[]tabStopDeprecated.Tab Stopprivate static byte[]titlePageDeprecated.Title Page tagstatic doubleTWIPSFACTORDeprecated.Factor to use when converting.protected static byte[]underlineDeprecated.Underline tag.private booleanwriteTOCDeprecated.Write a TOCprivate static byte[]yearDeprecated.Year tag.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(Element element)Deprecated.Signals that anElementwas added to theDocument.protected intaddColor(java.awt.Color newColor)Deprecated.Add a newColorto the list of colours.protected booleanaddElement(Element element, java.io.ByteArrayOutputStream out)Deprecated.Adds anElementto theDocument.protected intaddFont(Font newFont)Deprecated.Add a newFontto the list of fonts.private voidaddHeaderFooterFontColor(HeaderFooter hf)Deprecated.voidclose()Deprecated.Signals that theDocumentwas closed and that no otherElementswill be added.static java.lang.StringfilterSpecialChar(java.lang.String str, boolean useHex)Deprecated.Replaces special characters with their unicode valuesbooleangetGeneratingTOCEntries()Deprecated.Gets the current setting of writeTOCbooleangetHasTitlePage()Deprecated.Gets the current setting of hasTitlePagestatic RtfWritergetInstance(Document document, java.io.OutputStream os)Deprecated.Gets an instance of theRtfWriter.booleangetLandscape()Deprecated.Returns the current landscape settingprivate intgetRandomInt()Deprecated.Get a random integer.private voidinitDefaults()Deprecated.Initialise all helper classes.booleannewPage()Deprecated.Tells theRtfWriterthat a new page is to be begun.voidopen()Deprecated.Signals that theDocumenthas been opened and thatElementscan be added.private booleanparseFormat(Rectangle pageSize, boolean rotate)Deprecated.This method tries to fit theRectangle pageSizeto one of the predefined PageSize rectangles.private voidprocessHeaderFooter(HeaderFooter hf)Deprecated.private booleanrectEquals(Rectangle rect1, Rectangle rect2)Deprecated.This method compares to Rectangles.voidresetFooter()Deprecated.Resets the footer.voidresetHeader()Deprecated.Resets the header.voidsetFooter(HeaderFooter footer)Deprecated.Adds the footer to the bottom of theDocument.voidsetGenerateTOCEntries(boolean writeTOC)Deprecated.This method controls whether TOC entries are automatically generatedvoidsetHasTitlePage(boolean hasTitlePage)Deprecated.This method controls whether the first page is a title pagevoidsetHeader(HeaderFooter header)Deprecated.Adds the header to the top of theDocument.voidsetLandscape(boolean landscape)Deprecated.Explicitly sets the page format to use.booleansetMarginMirroring(boolean MarginMirroring)Deprecated.Parameter that allows you to do left/right margin mirroring (odd/even pages)booleansetMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)Deprecated.Sets the page marginsbooleansetPageSize(Rectangle pageSize)Deprecated.Sets the page sizeprivate voidwriteAnchor(Anchor anchor, java.io.ByteArrayOutputStream out)Deprecated.Write anAnchor.private voidwriteAnnotation(Annotation annotationElement, java.io.ByteArrayOutputStream out)Deprecated.Write anAnnotationprivate voidwriteChunk(Chunk chunk, java.io.ByteArrayOutputStream out)Deprecated.Write aChunkand all its font properties.private voidwriteColorList()Deprecated.Write the colour list to the finalByteArrayOutputStreamprivate booleanwriteDocument()Deprecated.Merge all the differentArrayLists andByteArrayOutputStreams to the finalByteArrayOutputStreamprivate voidwriteDocumentFormat()Deprecated.Write theDocument's Paper and Margin Size to the finalByteArrayOutputStreamprivate voidwriteDocumentIntro()Deprecated.Write the Rich Text file settingsprotected voidwriteFinishingFontSignature(java.io.OutputStream out, Chunk chunk)Deprecated.private voidwriteFontList()Deprecated.Write the font list to the finalByteArrayOutputStreamprivate voidwriteFormatedDateTime(java.lang.String date)Deprecated.Writes a date.private voidwriteHeaderFooter(HeaderFooter headerFooter, byte[] hfType, java.io.ByteArrayOutputStream target)Deprecated.Write aHeaderFooterto aByteArrayOutputStreamvoidwriteHeadersFooters(java.io.ByteArrayOutputStream os)Deprecated.Write the current header and footer to aByteArrayOutputStreamprivate voidwriteImage(Image image, java.io.ByteArrayOutputStream out)Deprecated.Write anImage.private voidwriteInfoGroup()Deprecated.Write the Information Group to the finalByteArrayOutputStreamprotected voidwriteInitialFontSignature(java.io.OutputStream out, Chunk chunk)Deprecated.static voidwriteInt(java.io.OutputStream out, int i)Deprecated.Write an integerprivate voidwriteList()Deprecated.Write the listtable and listoverridetable to the finalByteArrayOutputStreamprivate voidwriteList(List list, java.io.ByteArrayOutputStream out)Deprecated.Write aListprivate voidwriteListElement(ListItem listItem, java.io.ByteArrayOutputStream out)Deprecated.Write aListItemprivate voidwriteMeta(byte[] metaName, Meta meta)Deprecated.Add aMetaelement.private voidwriteParagraph(Paragraph paragraphElement, java.io.ByteArrayOutputStream out)Deprecated.Write the beginning of a newParagraphprivate voidwritePhrase(Phrase phrase, java.io.ByteArrayOutputStream out)Deprecated.Write aPhrase.private voidwriteSection(Section sectionElement, java.io.ByteArrayOutputStream out)Deprecated.Write the beginning of a newSectionprivate voidwriteSectionDefaults(java.io.ByteArrayOutputStream out)Deprecated.Writes the default values for the current Sectionprivate voidwriteTable(Table table, java.io.ByteArrayOutputStream out)Deprecated.Write aTable.booleanwriteTOC(java.lang.String tocTitle, Font titleFont, boolean showTOCasEntry, Font showTOCEntryFont)Deprecated.Write the table of contents.booleanwritingHeaderFooter()Deprecated.Returns whether we are currently writing a header or footer-
Methods inherited from class com.lowagie.text.DocWriter
addTabs, flush, getISOBytes, isCloseStream, isPaused, pause, resetPageCount, resume, setCloseStream, setMarginMirroringTopBottom, setPageCount, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.lowagie.text.DocListener
resetPageCount, setMarginMirroringTopBottom, setPageCount
-
-
-
-
Field Detail
-
escape
public static final byte escape
Deprecated.This is the escape character which introduces RTF tags.- See Also:
- Constant Field Values
-
extendedEscape
private static final byte[] extendedEscape
Deprecated.This is another escape character which introduces RTF tags.
-
delimiter
protected static final byte delimiter
Deprecated.This is the delimiter between RTF tags and normal text.- See Also:
- Constant Field Values
-
commaDelimiter
private static final byte commaDelimiter
Deprecated.This is another delimiter between RTF tags and normal text.- See Also:
- Constant Field Values
-
openGroup
public static final byte openGroup
Deprecated.This is the character for beginning a new group.- See Also:
- Constant Field Values
-
closeGroup
public static final byte closeGroup
Deprecated.This is the character for closing a group.- See Also:
- Constant Field Values
-
docBegin
private static final byte[] docBegin
Deprecated.RTF begin and version.
-
ansi
private static final byte[] ansi
Deprecated.RTF encoding.
-
ansiCodepage
private static final byte[] ansiCodepage
Deprecated.RTF encoding codepage.
-
fontTable
private static final byte[] fontTable
Deprecated.Begin the font table tag.
-
fontNumber
protected static final byte fontNumber
Deprecated.Font number tag.- See Also:
- Constant Field Values
-
fontSize
protected static final byte[] fontSize
Deprecated.Font size tag.
-
fontColor
protected static final byte[] fontColor
Deprecated.Font color tag.
-
fontModern
private static final byte[] fontModern
Deprecated.Modern font tag.
-
fontSwiss
private static final byte[] fontSwiss
Deprecated.Swiss font tag.
-
fontRoman
private static final byte[] fontRoman
Deprecated.Roman font tag.
-
fontTech
private static final byte[] fontTech
Deprecated.Tech font tag.
-
fontCharset
private static final byte[] fontCharset
Deprecated.Font charset tag.
-
fontCourier
private static final byte[] fontCourier
Deprecated.Font Courier tag.
-
fontArial
private static final byte[] fontArial
Deprecated.Font Arial tag.
-
fontSymbol
private static final byte[] fontSymbol
Deprecated.Font Symbol tag.
-
fontTimesNewRoman
private static final byte[] fontTimesNewRoman
Deprecated.Font Times New Roman tag.
-
fontWindings
private static final byte[] fontWindings
Deprecated.Font Windings tag.
-
defaultFont
private static final byte[] defaultFont
Deprecated.Default Font.
-
firstIndent
private static final byte[] firstIndent
Deprecated.First indent tag.
-
listIndent
private static final byte[] listIndent
Deprecated.Left indent tag.
-
rightIndent
private static final byte[] rightIndent
Deprecated.Right indent tag.
-
sectionDefaults
private static final byte[] sectionDefaults
Deprecated.Reset section defaults tag.
-
section
private static final byte[] section
Deprecated.Begin new section tag.
-
paragraphDefaults
public static final byte[] paragraphDefaults
Deprecated.Reset paragraph defaults tag.
-
paragraph
public static final byte[] paragraph
Deprecated.Begin new paragraph tag.
-
sectionPageWidth
public static final byte[] sectionPageWidth
Deprecated.Page width of a section.
-
sectionPageHeight
public static final byte[] sectionPageHeight
Deprecated.Page height of a section.
-
listtableGroup
private static final byte[] listtableGroup
Deprecated.Begin the List Table
-
listoverridetableGroup
private static final byte[] listoverridetableGroup
Deprecated.Begin the List Override Table
-
listDefinition
private static final byte[] listDefinition
Deprecated.Begin a List definition
-
listTemplateID
private static final byte[] listTemplateID
Deprecated.List Template ID
-
hybridList
private static final byte[] hybridList
Deprecated.RTF Writer outputs hybrid lists
-
listLevelDefinition
private static final byte[] listLevelDefinition
Deprecated.Current List level
-
listLevelTypeOld
private static final byte[] listLevelTypeOld
Deprecated.Level numbering (old)
-
listLevelTypeNew
private static final byte[] listLevelTypeNew
Deprecated.Level numbering (new)
-
listLevelAlignOld
private static final byte[] listLevelAlignOld
Deprecated.Level alignment (old)
-
listLevelAlignNew
private static final byte[] listLevelAlignNew
Deprecated.Level alignment (new)
-
listLevelStartAt
private static final byte[] listLevelStartAt
Deprecated.Level starting number
-
listLevelTextDefinition
private static final byte[] listLevelTextDefinition
Deprecated.Level text group
-
listLevelTextLength
private static final byte[] listLevelTextLength
Deprecated.Filler for Level Text Length
-
listLevelTextStyleNumbers
private static final byte[] listLevelTextStyleNumbers
Deprecated.Level Text Numbering Style
-
listLevelTextStyleBullet
private static final byte[] listLevelTextStyleBullet
Deprecated.Level Text Bullet Style
-
listLevelNumbersDefinition
private static final byte[] listLevelNumbersDefinition
Deprecated.Level Numbers Definition
-
listLevelNumbers
private static final byte[] listLevelNumbers
Deprecated.Filler for Level Numbers
-
tabStop
private static final byte[] tabStop
Deprecated.Tab Stop
-
listBegin
private static final byte[] listBegin
Deprecated.Actual list begin
-
listCurrentLevel
private static final byte[] listCurrentLevel
Deprecated.Current list level
-
listTextOld
private static final byte[] listTextOld
Deprecated.List text group for older browsers
-
tab
private static final byte[] tab
Deprecated.Tab
-
listBulletOld
private static final byte[] listBulletOld
Deprecated.Old Bullet Style
-
listID
private static final byte[] listID
Deprecated.Current List ID
-
listOverride
private static final byte[] listOverride
Deprecated.List override
-
listOverrideCount
private static final byte[] listOverrideCount
Deprecated.Number of overrides
-
bold
protected static final byte bold
Deprecated.Bold tag.- See Also:
- Constant Field Values
-
italic
protected static final byte italic
Deprecated.Italic tag.- See Also:
- Constant Field Values
-
underline
protected static final byte[] underline
Deprecated.Underline tag.
-
strikethrough
protected static final byte[] strikethrough
Deprecated.Strikethrough tag.
-
alignLeft
public static final byte[] alignLeft
Deprecated.Text alignment left tag.
-
alignCenter
public static final byte[] alignCenter
Deprecated.Text alignment center tag.
-
alignRight
public static final byte[] alignRight
Deprecated.Text alignment right tag.
-
alignJustify
public static final byte[] alignJustify
Deprecated.Text alignment justify tag.
-
colorTable
private static final byte[] colorTable
Deprecated.Begin colour table tag.
-
colorRed
private static final byte[] colorRed
Deprecated.Red value tag.
-
colorGreen
private static final byte[] colorGreen
Deprecated.Green value tag.
-
colorBlue
private static final byte[] colorBlue
Deprecated.Blue value tag.
-
infoBegin
private static final byte[] infoBegin
Deprecated.Begin the info group tag.
-
metaAuthor
private static final byte[] metaAuthor
Deprecated.Author tag.
-
metaSubject
private static final byte[] metaSubject
Deprecated.Subject tag.
-
metaKeywords
private static final byte[] metaKeywords
Deprecated.Keywords tag.
-
metaTitle
private static final byte[] metaTitle
Deprecated.Title tag.
-
metaProducer
private static final byte[] metaProducer
Deprecated.Producer tag.
-
metaCreationDate
private static final byte[] metaCreationDate
Deprecated.Creation Date tag.
-
year
private static final byte[] year
Deprecated.Year tag.
-
month
private static final byte[] month
Deprecated.Month tag.
-
day
private static final byte[] day
Deprecated.Day tag.
-
hour
private static final byte[] hour
Deprecated.Hour tag.
-
minute
private static final byte[] minute
Deprecated.Minute tag.
-
second
private static final byte[] second
Deprecated.Second tag.
-
startSuper
private static final byte[] startSuper
Deprecated.Start superscript.
-
startSub
private static final byte[] startSub
Deprecated.Start subscript.
-
endSuperSub
private static final byte[] endSuperSub
Deprecated.End super/sub script.
-
titlePage
private static final byte[] titlePage
Deprecated.Title Page tag
-
facingPages
private static final byte[] facingPages
Deprecated.Facing pages tag
-
headerBegin
private static final byte[] headerBegin
Deprecated.Begin header group tag.
-
footerBegin
private static final byte[] footerBegin
Deprecated.Begin footer group tag.
-
headerlBegin
private static final byte[] headerlBegin
Deprecated.
-
footerlBegin
private static final byte[] footerlBegin
Deprecated.
-
headerrBegin
private static final byte[] headerrBegin
Deprecated.
-
footerrBegin
private static final byte[] footerrBegin
Deprecated.
-
headerfBegin
private static final byte[] headerfBegin
Deprecated.
-
footerfBegin
private static final byte[] footerfBegin
Deprecated.
-
rtfPaperWidth
private static final byte[] rtfPaperWidth
Deprecated.Paper width tag.
-
rtfPaperHeight
private static final byte[] rtfPaperHeight
Deprecated.Paper height tag.
-
rtfMarginLeft
private static final byte[] rtfMarginLeft
Deprecated.Margin left tag.
-
rtfMarginRight
private static final byte[] rtfMarginRight
Deprecated.Margin right tag.
-
rtfMarginTop
private static final byte[] rtfMarginTop
Deprecated.Margin top tag.
-
rtfMarginBottom
private static final byte[] rtfMarginBottom
Deprecated.Margin bottom tag.
-
newPage
private static final byte[] newPage
Deprecated.New Page tag.
-
landscapeTag1
private static final byte[] landscapeTag1
Deprecated.Document Landscape tag 1.
-
landscapeTag2
private static final byte[] landscapeTag2
Deprecated.Document Landscape tag 2.
-
annotationID
private static final byte[] annotationID
Deprecated.Annotation ID tag.
-
annotationAuthor
private static final byte[] annotationAuthor
Deprecated.Annotation Author tag.
-
annotation
private static final byte[] annotation
Deprecated.Annotation text tag.
-
pictureGroup
private static final byte[] pictureGroup
Deprecated.Begin the main Picture group tag
-
picture
private static final byte[] picture
Deprecated.Begin the picture tag
-
picturePNG
private static final byte[] picturePNG
Deprecated.PNG Image
-
pictureJPEG
private static final byte[] pictureJPEG
Deprecated.JPEG Image
-
pictureBMP
private static final byte[] pictureBMP
Deprecated.BMP Image
-
pictureWMF
private static final byte[] pictureWMF
Deprecated.WMF Image
-
pictureWidth
private static final byte[] pictureWidth
Deprecated.Picture width
-
pictureHeight
private static final byte[] pictureHeight
Deprecated.Picture height
-
pictureScaleX
private static final byte[] pictureScaleX
Deprecated.Picture scale horizontal percent
-
pictureScaleY
private static final byte[] pictureScaleY
Deprecated.Picture scale vertical percent
-
field
protected static final byte[] field
Deprecated.Begin field tag
-
fieldContent
protected static final byte[] fieldContent
Deprecated.Content fo the field
-
fieldPage
protected static final byte[] fieldPage
Deprecated.PAGE numbers
-
fieldHyperlink
protected static final byte[] fieldHyperlink
Deprecated.HYPERLINK field
-
fieldDisplay
protected static final byte[] fieldDisplay
Deprecated.Last page number (not used)
-
fontList
private java.util.ArrayList fontList
Deprecated.ThisArrayListcontains all fonts used in the document.
-
colorList
private java.util.ArrayList colorList
Deprecated.ThisArrayListcontains all colours used in the document.
-
content
private java.io.ByteArrayOutputStream content
Deprecated.ThisByteArrayOutputStreamcontains the main body of the document.
-
info
private java.io.ByteArrayOutputStream info
Deprecated.ThisByteArrayOutputStreamcontains the information group.
-
listtable
private java.io.ByteArrayOutputStream listtable
Deprecated.ThisByteArrayOutputStreamcontains the list table.
-
listoverride
private java.io.ByteArrayOutputStream listoverride
Deprecated.ThisByteArrayOutputStreamcontains the list override table.
-
header
private HeaderFooter header
Deprecated.Document header.
-
footer
private HeaderFooter footer
Deprecated.Document footer.
-
marginLeft
private int marginLeft
Deprecated.Left margin.
-
marginRight
private int marginRight
Deprecated.Right margin.
-
marginTop
private int marginTop
Deprecated.Top margin.
-
marginBottom
private int marginBottom
Deprecated.Bottom margin.
-
pageWidth
private int pageWidth
Deprecated.Page width.
-
pageHeight
private int pageHeight
Deprecated.Page height.
-
TWIPSFACTOR
public static final double TWIPSFACTOR
Deprecated.Factor to use when converting.- See Also:
- Constant Field Values
-
currentListID
private int currentListID
Deprecated.Current list ID.
-
listIds
private java.util.ArrayList listIds
Deprecated.List of current Lists.
-
listLevel
private int listLevel
Deprecated.Current List Level.
-
maxListLevel
private int maxListLevel
Deprecated.Current maximum List Level.
-
writeTOC
private boolean writeTOC
Deprecated.Write a TOC
-
hasTitlePage
private boolean hasTitlePage
Deprecated.Special title page
-
inHeaderFooter
private boolean inHeaderFooter
Deprecated.Currently writing either Header or Footer
-
inTable
private boolean inTable
Deprecated.Currently writing a Table
-
landscape
private boolean landscape
Deprecated.Landscape or Portrait Document
-
-
Constructor Detail
-
RtfWriter
protected RtfWriter(Document doc, java.io.OutputStream os)
Deprecated.Constructs aRtfWriter.- Parameters:
doc- TheDocumentthat is to be written as RTFos- TheOutputStreamthe writer has to write to.
-
-
Method Detail
-
setGenerateTOCEntries
public void setGenerateTOCEntries(boolean writeTOC)
Deprecated.This method controls whether TOC entries are automatically generated- Parameters:
writeTOC- boolean value indicating whether a TOC is to be generated
-
getGeneratingTOCEntries
public boolean getGeneratingTOCEntries()
Deprecated.Gets the current setting of writeTOC- Returns:
- boolean value indicating whether a TOC is being generated
-
setHasTitlePage
public void setHasTitlePage(boolean hasTitlePage)
Deprecated.This method controls whether the first page is a title page- Parameters:
hasTitlePage- boolean value indicating whether the first page is a title page
-
getHasTitlePage
public boolean getHasTitlePage()
Deprecated.Gets the current setting of hasTitlePage- Returns:
- boolean value indicating whether the first page is a title page
-
setLandscape
public void setLandscape(boolean landscape)
Deprecated.Explicitly sets the page format to use. Otherwise the RtfWriter will try to guess the format by comparing pagewidth and pageheight- Parameters:
landscape- boolean value indicating whether we are using landscape format or not
-
getLandscape
public boolean getLandscape()
Deprecated.Returns the current landscape setting- Returns:
- boolean value indicating the current page format
-
getInstance
public static RtfWriter getInstance(Document document, java.io.OutputStream os)
Deprecated.Gets an instance of theRtfWriter.- Parameters:
document- TheDocumentthat has to be writtenos- TheOutputStreamthe writer has to write to.- Returns:
- a new
RtfWriter
-
open
public void open()
Deprecated.Signals that theDocumenthas been opened and thatElementscan be added.- Specified by:
openin interfaceDocListener- Overrides:
openin classDocWriter
-
close
public void close()
Deprecated.Signals that theDocumentwas closed and that no otherElementswill be added.The content of the font table, color table, information group, content, header, footer are merged into the final
OutputStream- Specified by:
closein interfaceDocListener- Overrides:
closein classDocWriter
-
setFooter
public void setFooter(HeaderFooter footer)
Deprecated.Adds the footer to the bottom of theDocument.- Specified by:
setFooterin interfaceDocListener- Overrides:
setFooterin classDocWriter- Parameters:
footer-
-
setHeader
public void setHeader(HeaderFooter header)
Deprecated.Adds the header to the top of theDocument.- Specified by:
setHeaderin interfaceDocListener- Overrides:
setHeaderin classDocWriter- Parameters:
header-
-
resetFooter
public void resetFooter()
Deprecated.Resets the footer.- Specified by:
resetFooterin interfaceDocListener- Overrides:
resetFooterin classDocWriter
-
resetHeader
public void resetHeader()
Deprecated.Resets the header.- Specified by:
resetHeaderin interfaceDocListener- Overrides:
resetHeaderin classDocWriter
-
newPage
public boolean newPage()
Deprecated.Tells theRtfWriterthat a new page is to be begun.- Specified by:
newPagein interfaceDocListener- Overrides:
newPagein classDocWriter- Returns:
trueif a new Page was begun.
-
setMargins
public boolean setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)Deprecated.Sets the page margins- Specified by:
setMarginsin interfaceDocListener- Overrides:
setMarginsin classDocWriter- Parameters:
marginLeft- The left marginmarginRight- The right marginmarginTop- The top marginmarginBottom- The bottom margin- Returns:
trueif the page margins were set.
-
setPageSize
public boolean setPageSize(Rectangle pageSize)
Deprecated.Sets the page size- Specified by:
setPageSizein interfaceDocListener- Overrides:
setPageSizein classDocWriter- Parameters:
pageSize- ARectanglespecifying the page size- Returns:
trueif the page size was set
-
writeTOC
public boolean writeTOC(java.lang.String tocTitle, Font titleFont, boolean showTOCasEntry, Font showTOCEntryFont)Deprecated.Write the table of contents.- Parameters:
tocTitle- The title that will be displayed above the TOCtitleFont- TheFontthat will be used for the tocTitleshowTOCasEntry- Set this to true if you want the TOC to appear as an entry in the TOCshowTOCEntryFont- Use thisFontto specify what Font to use when showTOCasEntry is true- Returns:
trueif the TOC was added.
-
add
public boolean add(Element element) throws DocumentException
Deprecated.Signals that anElementwas added to theDocument.- Specified by:
addin interfaceElementListener- Overrides:
addin classDocWriter- Parameters:
element- A high level object to add- Returns:
trueif the element was added,falseif not.- Throws:
DocumentException- if a document isn't open yet, or has been closed
-
addElement
protected boolean addElement(Element element, java.io.ByteArrayOutputStream out) throws DocumentException
Deprecated.Adds anElementto theDocument.- Parameters:
element- the high level element to addout- the outputstream to which the RTF data is sent- Returns:
trueif the element was added,falseif not.- Throws:
DocumentException- if a document isn't open yet, or has been closed
-
writeSection
private void writeSection(Section sectionElement, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write the beginning of a newSection- Parameters:
sectionElement- TheSectionbe writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOExceptionDocumentException
-
writeParagraph
private void writeParagraph(Paragraph paragraphElement, java.io.ByteArrayOutputStream out) throws java.io.IOException
Deprecated.Write the beginning of a newParagraph- Parameters:
paragraphElement- TheParagraphto be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOException
-
writePhrase
private void writePhrase(Phrase phrase, java.io.ByteArrayOutputStream out) throws java.io.IOException
Deprecated.Write aPhrase.- Parameters:
phrase- ThePhraseitem to be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOException
-
writeAnchor
private void writeAnchor(Anchor anchor, java.io.ByteArrayOutputStream out) throws java.io.IOException
Deprecated.Write anAnchor. Anchors are treated like Phrases.- Parameters:
anchor- TheChunkitem to be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOException
-
writeChunk
private void writeChunk(Chunk chunk, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write aChunkand all its font properties.- Parameters:
chunk- TheChunkitem to be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOExceptionDocumentException
-
writeInitialFontSignature
protected void writeInitialFontSignature(java.io.OutputStream out, Chunk chunk) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
writeFinishingFontSignature
protected void writeFinishingFontSignature(java.io.OutputStream out, Chunk chunk) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
writeListElement
private void writeListElement(ListItem listItem, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write aListItem- Parameters:
listItem- TheListItemto be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOExceptionDocumentException
-
writeList
private void writeList(List list, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write aList- Parameters:
list- TheListto be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOExceptionDocumentException
-
writeTable
private void writeTable(Table table, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write aTable.- Parameters:
table- Thetableto be writtenout- TheByteArrayOutputStreamto write to Currently no nesting of tables is supported. If a cell contains anything but a Cell Object it is ignored.- Throws:
java.io.IOExceptionDocumentException
-
writeImage
private void writeImage(Image image, java.io.ByteArrayOutputStream out) throws java.io.IOException, DocumentException
Deprecated.Write anImage.- Parameters:
image- Theimageto be writtenout- TheByteArrayOutputStreamto write to At the moment only PNG and JPEG Images are supported.- Throws:
java.io.IOExceptionDocumentException
-
writeAnnotation
private void writeAnnotation(Annotation annotationElement, java.io.ByteArrayOutputStream out) throws java.io.IOException
Deprecated.Write anAnnotation- Parameters:
annotationElement- TheAnnotationto be writtenout- TheByteArrayOutputStreamto write to- Throws:
java.io.IOException
-
writeMeta
private void writeMeta(byte[] metaName, Meta meta) throws java.io.IOExceptionDeprecated.Add aMetaelement. It is written to the Inforamtion Group and merged with the mainByteArrayOutputStreamwhen the Document is closed.- Parameters:
metaName- The type ofMetaelement to be addedmeta- TheMetaelement to be added Currently only the Meta Elements Author, Subject, Keywords, Title, Producer and CreationDate are supported.- Throws:
java.io.IOException
-
writeFormatedDateTime
private void writeFormatedDateTime(java.lang.String date) throws java.io.IOExceptionDeprecated.Writes a date. The date is formated Year, Month, Day, Hour, Minute, Second- Parameters:
date- The date to be written- Throws:
java.io.IOException
-
addFont
protected int addFont(Font newFont)
Deprecated.Add a newFontto the list of fonts. If theFontalready exists in the list of fonts, then it is not added again.- Parameters:
newFont- TheFontto be added- Returns:
- The index of the
Fontin the font list
-
addColor
protected int addColor(java.awt.Color newColor)
Deprecated.Add a newColorto the list of colours. If theColoralready exists in the list of colours, then it is not added again.- Parameters:
newColor- TheColorto be added- Returns:
- The index of the
colorin the colour list
-
writeDocument
private boolean writeDocument()
Deprecated.Merge all the differentArrayLists andByteArrayOutputStreams to the finalByteArrayOutputStream- Returns:
trueif all information was sucessfully written to theByteArrayOutputStream
-
writeDocumentIntro
private void writeDocumentIntro() throws java.io.IOExceptionDeprecated.Write the Rich Text file settings- Throws:
java.io.IOException
-
writeFontList
private void writeFontList() throws java.io.IOExceptionDeprecated.Write the font list to the finalByteArrayOutputStream- Throws:
java.io.IOException
-
writeColorList
private void writeColorList() throws java.io.IOExceptionDeprecated.Write the colour list to the finalByteArrayOutputStream- Throws:
java.io.IOException
-
writeInfoGroup
private void writeInfoGroup() throws java.io.IOExceptionDeprecated.Write the Information Group to the finalByteArrayOutputStream- Throws:
java.io.IOException
-
writeList
private void writeList() throws java.io.IOExceptionDeprecated.Write the listtable and listoverridetable to the finalByteArrayOutputStream- Throws:
java.io.IOException
-
writeInt
public static final void writeInt(java.io.OutputStream out, int i) throws java.io.IOExceptionDeprecated.Write an integer- Parameters:
out- TheOuputStreamto which theintvalue is to be writteni- Theintvalue to be written- Throws:
java.io.IOException
-
getRandomInt
private int getRandomInt()
Deprecated.Get a random integer. This returns a unique random integer to be used with listids.- Returns:
- Random
intvalue.
-
writeHeadersFooters
public void writeHeadersFooters(java.io.ByteArrayOutputStream os) throws java.io.IOExceptionDeprecated.Write the current header and footer to aByteArrayOutputStream- Parameters:
os- TheByteArrayOutputStreamto which the header and footer will be written.- Throws:
java.io.IOException
-
writeHeaderFooter
private void writeHeaderFooter(HeaderFooter headerFooter, byte[] hfType, java.io.ByteArrayOutputStream target) throws java.io.IOException
Deprecated.Write aHeaderFooterto aByteArrayOutputStream- Parameters:
headerFooter- TheHeaderFooterobject to be written.hfType- The type of header or footer to be added.target- TheByteArrayOutputStreamto which theHeaderFooterwill be written.- Throws:
java.io.IOException
-
writeDocumentFormat
private void writeDocumentFormat() throws java.io.IOExceptionDeprecated.Write theDocument's Paper and Margin Size to the finalByteArrayOutputStream- Throws:
java.io.IOException
-
initDefaults
private void initDefaults()
Deprecated.Initialise all helper classes. Clears alls lists, creates newByteArrayOutputStream's
-
writeSectionDefaults
private void writeSectionDefaults(java.io.ByteArrayOutputStream out) throws java.io.IOExceptionDeprecated.Writes the default values for the current Section- Parameters:
out- TheByteArrayOutputStreamto be written to- Throws:
java.io.IOException
-
parseFormat
private boolean parseFormat(Rectangle pageSize, boolean rotate)
Deprecated.This method tries to fit theRectangle pageSizeto one of the predefined PageSize rectangles. If a match is found the pageWidth and pageHeight will be set according to values determined from files generated by MS Word2000 and OpenOffice 641. If no match is found the method will try to match the rotated Rectangle by calling itself with the parameter rotate set to true.- Parameters:
pageSize- a rectangle defining the size of the pagerotate- portrait or lanscape?- Returns:
- true if the format parsing succeeded
-
rectEquals
private boolean rectEquals(Rectangle rect1, Rectangle rect2)
Deprecated.This method compares to Rectangles. They are considered equal if width and height are the same- Parameters:
rect1-rect2-- Returns:
- true if rect1 and rect2 represent the same rectangle
-
writingHeaderFooter
public boolean writingHeaderFooter()
Deprecated.Returns whether we are currently writing a header or footer- Returns:
- the value of inHeaderFooter
-
filterSpecialChar
public static final java.lang.String filterSpecialChar(java.lang.String str, boolean useHex)Deprecated.Replaces special characters with their unicode values- Parameters:
str- The originalStringuseHex-- Returns:
- The converted String
-
addHeaderFooterFontColor
private void addHeaderFooterFontColor(HeaderFooter hf)
Deprecated.
-
processHeaderFooter
private void processHeaderFooter(HeaderFooter hf)
Deprecated.
-
setMarginMirroring
public boolean setMarginMirroring(boolean MarginMirroring)
Deprecated.Description copied from interface:DocListenerParameter that allows you to do left/right margin mirroring (odd/even pages)- Specified by:
setMarginMirroringin interfaceDocListener- Overrides:
setMarginMirroringin classDocWriter- Returns:
- true if successful
- See Also:
DocListener.setMarginMirroring(boolean)
-
-