Enum Document.Format

java.lang.Object
java.lang.Enum<Document.Format>
com.codename1.wordprocessing.Document.Format
All Implemented Interfaces:
Comparable<Document.Format>
Enclosing class:
Document

public static enum Document.Format extends Enum<Document.Format>
The file formats read and write understand.
  • Enum Constant Details

    • NATIVE

      public static final Document.Format NATIVE
      Codename One's own .cn1doc: a ZIP holding document.xml. Keeps everything the model holds, page features included: sections, columns, headers and footers, floating pictures, tab stops, indents and table column widths. Files written by the Codename One word processor open too; whatever they hold beyond this model is skipped.
    • TEXT

      public static final Document.Format TEXT
      Plain UTF-8 text. Formatting and every page feature are lost; tables become tab separated lines.
    • HTML

      public static final Document.Format HTML
      HTML. Reading accepts common markup, tables (with colspan/rowspan) and data: URI images; writing produces a complete page. A web page has no pages: sections, columns, headers and footers are dropped and a floating picture is written in the flow of the text.
    • MARKDOWN

      public static final Document.Format MARKDOWN
      Markdown with GitHub tables. Like HTML it keeps no page features: sections, columns, headers, footers, text wrap, tab stops and column widths are dropped.
    • DOCX

      public static final Document.Format DOCX
      Office Open XML, the format of Word 2007 and later. Reads and writes styles, lists, tables with merged cells and column widths, pictures inline and floating with text wrap, fields, notes, comments, tracked changes, sections with columns, headers and footers, tab stops and indents; text boxes and charts are skipped.
    • ODT

      public static final Document.Format ODT
      OpenDocument text, the format of LibreOffice Writer. Reads and writes styles, lists, tables with spans and column widths, pictures inline and floating with text wrap, notes, annotations, tracked changes, sections with columns (as master pages and text sections), headers and footers, tab stops and indents.
    • RTF

      public static final Document.Format RTF
      Rich Text Format. Reads and writes character formatting, styles, lists, indents, tab stops, tables with merged cells, links, fields, notes, PNG and JPEG pictures, annotations and tracked changes; nested tables are written as tab separated lines. Page features are not written: sections, columns, headers and footers are dropped and floating pictures are written inline.
    • DOC

      public static final Document.Format DOC
      The binary format of Word 97 to 2003. Read only: styles, lists, tables with merged cells, pictures, fields, notes, comments and tracked changes are read; writing throws, since files should be saved as DOCX.
    • PDF

      public static final Document.Format PDF
      PDF, laid out into pages as DocumentView shows them. Write only: reading throws.
  • Method Details

    • values

      public static Document.Format[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Document.Format valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • extension

      public String extension()

      The usual file extension, without the dot.

      Returns

      the extension

    • forFileName

      public static Document.Format forFileName(String fileName)

      The format a file name's extension names.

      Parameters
      • fileName: a file name or path
      Returns

      the format, or null when the extension is not one of these