Package com.inductiveautomation.rm.out
Class RMRTFWriter
- java.lang.Object
-
- com.inductiveautomation.rm.out.RMRTFWriter
-
public class RMRTFWriter extends java.lang.Object
Write RTF for a document.
-
-
Constructor Summary
Constructors Constructor Description RMRTFWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendImageBytesForShape(RMShape s, java.io.PrintStream ps)
Convert the shape into an image stream and embedd that into the rtf.void
appendRTF(RMShape aShape, java.io.PrintStream ps)
void
appendTable(RMShapeTable table, java.io.PrintStream ps)
Append table.void
appendText(RMXString s, java.io.PrintStream ps)
byte[]
getBytes(RMDocument aDoc)
Returns RTF bytes for given document.int
getColorIndex(RMColor c)
int
getFontIndex(RMFont f)
Looks up a font in the font table and adds it if it's not there.int
getRTFFontCharset(RMFontFile f)
java.lang.String
getRTFFontFamily(RMFontFile f)
byte[]
getRTFForShapes(RMDocument aDoc)
Returns RTF for document Shapes.java.lang.String
RTFBorderStyle(boolean show, int width)
Returns the rtf control string for borders.int
twip(double x)
Convert an rm coord to rtf 'twips'.void
writeColorTable(java.io.PrintStream ps)
Output all the fonts as an RTF fonttable.void
writeFont(java.io.PrintStream aPS, RMFontFile aFontFile)
Writes an entry in the font table for a particular font.void
writeFontTable(java.io.PrintStream ps)
Output all the fonts as an RTF FontTable.
-
-
-
Method Detail
-
getBytes
public byte[] getBytes(RMDocument aDoc)
Returns RTF bytes for given document.
-
getFontIndex
public int getFontIndex(RMFont f)
Looks up a font in the font table and adds it if it's not there. Returns the name that represents the font in the rtf ("f0", "f1", etc.)
-
writeFontTable
public void writeFontTable(java.io.PrintStream ps)
Output all the fonts as an RTF FontTable. Fonts are all referenced by name, never embedded.
-
writeFont
public void writeFont(java.io.PrintStream aPS, RMFontFile aFontFile)
Writes an entry in the font table for a particular font.
-
getRTFFontFamily
public java.lang.String getRTFFontFamily(RMFontFile f)
-
getRTFFontCharset
public int getRTFFontCharset(RMFontFile f)
-
writeColorTable
public void writeColorTable(java.io.PrintStream ps)
Output all the fonts as an RTF fonttable. Fonts are all referenced by name, never embedded.
-
getColorIndex
public int getColorIndex(RMColor c)
-
twip
public int twip(double x)
Convert an rm coord to rtf 'twips'. A twip is a 20th of a point.
-
getRTFForShapes
public byte[] getRTFForShapes(RMDocument aDoc)
Returns RTF for document Shapes.
-
appendRTF
public void appendRTF(RMShape aShape, java.io.PrintStream ps)
-
appendTable
public void appendTable(RMShapeTable table, java.io.PrintStream ps)
Append table. Tables are intermediary objects used for positioning content. Thus, tables themselves shouldn't do any drawing
-
appendText
public void appendText(RMXString s, java.io.PrintStream ps)
-
RTFBorderStyle
public java.lang.String RTFBorderStyle(boolean show, int width)
Returns the rtf control string for borders. Currently only does on or off. RTF has a zillion other possibilities.
-
appendImageBytesForShape
public void appendImageBytesForShape(RMShape s, java.io.PrintStream ps)
Convert the shape into an image stream and embedd that into the rtf.
-
-