Interface XHTMLImporter

All Known Implementing Classes:
XHTMLImporterImpl

public interface XHTMLImporter
Author:
jharrop
  • Method Details

    • setHyperlinkStyle

      void setHyperlinkStyle(String hyperlinkStyleID)
      Configure, how the Importer styles hyperlinks If hyperlinkStyleId is set to null, hyperlinks are styled using just the CSS. This is the default behavior. If hyperlinkStyleId is set to "someWordHyperlinkStyleName", that style is used. The default Word hyperlink style name is "Hyperlink". It is currently your responsibility to define that style in your styles definition part.
      Parameters:
      hyperlinkStyleID - The style to use for hyperlinks (eg Hyperlink)
    • setRunFormatting

      void setRunFormatting(FormattingOption runFormatting)
    • setParagraphFormatting

      void setParagraphFormatting(FormattingOption paragraphFormatting)
    • setTableFormatting

      void setTableFormatting(FormattingOption tableFormatting)
    • convert

      List<Object> convert(File file, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Convert the well formed XHTML contained in file to a list of WML objects.
      Parameters:
      file -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      IOException
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(InputSource is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Convert the well formed XHTML from the specified SAX InputSource
      Parameters:
      is -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      IOException
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(InputStream is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Parameters:
      is -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      IOException
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(Node node, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Parameters:
      node -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      IOException
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(Reader reader, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Parameters:
      reader -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      IOException
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(URL url) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Convert the well formed XHTML found at the specified URI to a list of WML objects.
      Parameters:
      url -
      wordMLPackage -
      Returns:
      Throws:
      org.docx4j.openpackaging.exceptions.Docx4JException
    • convert

      List<Object> convert(String content, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
      Convert the well formed XHTML contained in the string to a list of WML objects.
      Parameters:
      content -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      org.docx4j.openpackaging.exceptions.Docx4JException
    • getSequenceCounters

      Map<String,Integer> getSequenceCounters()
      Get the current numbers of SEQ fields, used in image captions. Typically you'd use this if you are importing multiple times into a single docx (as for example, OpenDoPE does).
      Parameters:
      sequenceCounters -
      Since:
      3.2.0
    • setSequenceCounters

      void setSequenceCounters(Map<String,Integer> sequenceCounters)
      Set the last used numbers of SEQ fields, used in image captions. Key is sequence name. The default is "Figure", but you can also use others (matching value of @sequence).
      Parameters:
      sequenceCounters -
      Since:
      3.2.0
    • getBookmarkIdLast

      AtomicInteger getBookmarkIdLast()
    • setMaxWidth

      void setMaxWidth(int maxWidth, String tableStyle)
      Set the maximum width available (in twips); useful for scaling bare images if they are to go in a table cell.
      Also set table style if images are really to go in a table cell (needed to remove table style margins from final width).
      Parameters:
      maxWidth -
      tableStyle - - can be null