Class RtfImportMappings

java.lang.Object
com.lowagie.text.rtf.parser.RtfImportMappings

public class RtfImportMappings extends Object
The RtfImportMappings make it possible to define font and color mappings when using the RtfWriter2.importRtfFragment method. This is necessary, because a RTF fragment does not contain font or color information, just references to the font and color tables.

The font mappings are fontNr -> fontName and the color mappigns are colorNr -> Color.
Since:
2.1.0
  • Field Details

    • fontMappings

      private final HashMap<String,String> fontMappings
      The fontNr to fontName mappings.
    • colorMappings

      private final HashMap<String,Color> colorMappings
      The colorNr to Color mappings.
    • listMappings

      private final HashMap<String,String> listMappings
      The listNr to List mappings.
    • stylesheetListMappings

      private final HashMap<String,com.lowagie.text.List> stylesheetListMappings
      The sytlesheetListNr to Stylesheet mappings.
  • Constructor Details

    • RtfImportMappings

      public RtfImportMappings()
      Constructs a new RtfImportMappings initialising the mappings.
  • Method Details

    • addFont

      public void addFont(String fontNr, String fontName)
      Add a font to the list of mappings.
      Parameters:
      fontNr - The font number.
      fontName - The font name.
    • addColor

      public void addColor(String colorNr, Color color)
      Add a color to the list of mappings.
      Parameters:
      colorNr - The color number.
      color - The Color.
    • addList

      public void addList(String listNr, String list)
      Add a List to the list of mappings.
      Parameters:
      listNr - The List number.
      list - The List.
    • addStylesheetList

      public void addStylesheetList(String stylesheetListNr, com.lowagie.text.List list)
      Add a Stylesheet List to the list of mappings.
      Parameters:
      stylesheetListNr - The Stylesheet List number.
      list - The StylesheetList.
    • getFontMappings

      public HashMap<String,String> getFontMappings()
      Gets the list of font mappings. String to String.
      Returns:
      The font mappings.
    • getColorMappings

      public HashMap<String,Color> getColorMappings()
      Gets the list of color mappings. String to Color.
      Returns:
      The color mappings.
    • getListMappings

      public HashMap<String,String> getListMappings()
      Gets the list of List mappings.
      Returns:
      The List mappings.
    • getStylesheetListMappings

      public HashMap<String,com.lowagie.text.List> getStylesheetListMappings()
      Gets the list of Stylesheet mappings. .
      Returns:
      The Stylesheet List mappings.