Class RMRTFWriter

java.lang.Object
com.inductiveautomation.rm.out.RMRTFWriter

public class RMRTFWriter extends Object
Write RTF for a document.
  • Constructor Details

    • RMRTFWriter

      public RMRTFWriter()
  • Method Details

    • 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(PrintStream ps)
      Output all the fonts as an RTF FontTable. Fonts are all referenced by name, never embedded.
    • writeFont

      public void writeFont(PrintStream aPS, RMFontFile aFontFile)
      Writes an entry in the font table for a particular font.
    • getRTFFontFamily

      public String getRTFFontFamily(RMFontFile f)
    • getRTFFontCharset

      public int getRTFFontCharset(RMFontFile f)
    • writeColorTable

      public void writeColorTable(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, PrintStream ps)
    • appendTable

      public void appendTable(RMShapeTable table, 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, PrintStream ps)
    • RTFBorderStyle

      public 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, PrintStream ps)
      Convert the shape into an image stream and embedd that into the rtf.