Interface XHTMLImporter


public interface XHTMLImporter
Author:
jharrop
  • Method Summary

    Modifier and Type Method Description
    java.util.List<java.lang.Object> convert​(java.io.File file, java.lang.String baseUrl)
    Convert the well formed XHTML contained in file to a list of WML objects.
    java.util.List<java.lang.Object> convert​(java.io.InputStream is, java.lang.String baseUrl)  
    java.util.List<java.lang.Object> convert​(java.io.Reader reader, java.lang.String baseUrl)  
    java.util.List<java.lang.Object> convert​(java.lang.String content, java.lang.String baseUrl)
    Convert the well formed XHTML contained in the string to a list of WML objects.
    java.util.List<java.lang.Object> convert​(java.net.URL url)
    Convert the well formed XHTML found at the specified URI to a list of WML objects.
    java.util.List<java.lang.Object> convert​(javax.xml.transform.Source source, java.lang.String baseUrl)  
    java.util.List<java.lang.Object> convert​(org.w3c.dom.Node node, java.lang.String baseUrl)  
    java.util.List<java.lang.Object> convert​(org.xml.sax.InputSource is, java.lang.String baseUrl)
    Convert the well formed XHTML from the specified SAX InputSource
    java.util.concurrent.atomic.AtomicInteger getBookmarkIdLast()  
    java.util.Map<java.lang.String,​java.lang.Integer> getSequenceCounters()
    Get the current numbers of SEQ fields, used in image captions.
    void setHyperlinkStyle​(java.lang.String hyperlinkStyleID)
    Configure, how the Importer styles hyperlinks If hyperlinkStyleId is set to null, hyperlinks are styled using just the CSS.
    void setMaxWidth​(int maxWidth, java.lang.String tableStyle)
    Set the maximum width available (in twips); useful for scaling bare images if they are to go in a table cell.
    void setParagraphFormatting​(FormattingOption paragraphFormatting)  
    void setRunFormatting​(FormattingOption runFormatting)  
    void setSequenceCounters​(java.util.Map<java.lang.String,​java.lang.Integer> sequenceCounters)
    Set the last used numbers of SEQ fields, used in image captions.
    void setTableFormatting​(FormattingOption tableFormatting)  
  • Method Details

    • setHyperlinkStyle

      void setHyperlinkStyle​(java.lang.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

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

      java.util.List<java.lang.Object> convert​(org.xml.sax.InputSource is, java.lang.String baseUrl) throws Docx4JException
      Convert the well formed XHTML from the specified SAX InputSource
      Parameters:
      is -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      java.io.IOException
      Docx4JException
    • convert

      java.util.List<java.lang.Object> convert​(java.io.InputStream is, java.lang.String baseUrl) throws Docx4JException
      Parameters:
      is -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      java.io.IOException
      Docx4JException
    • convert

      java.util.List<java.lang.Object> convert​(org.w3c.dom.Node node, java.lang.String baseUrl) throws Docx4JException
      Parameters:
      node -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      java.io.IOException
      Docx4JException
    • convert

      java.util.List<java.lang.Object> convert​(java.io.Reader reader, java.lang.String baseUrl) throws Docx4JException
      Parameters:
      reader -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      java.io.IOException
      Docx4JException
    • convert

      java.util.List<java.lang.Object> convert​(javax.xml.transform.Source source, java.lang.String baseUrl) throws Docx4JException
      Parameters:
      source -
      baseUrl -
      wordMLPackage -
      Returns:
      Throws:
      java.io.IOException
      Docx4JException
    • convert

      java.util.List<java.lang.Object> convert​(java.net.URL url) throws Docx4JException
      Convert the well formed XHTML found at the specified URI to a list of WML objects.
      Parameters:
      url -
      wordMLPackage -
      Returns:
      Throws:
      Docx4JException
    • convert

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

      java.util.Map<java.lang.String,​java.lang.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​(java.util.Map<java.lang.String,​java.lang.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

      java.util.concurrent.atomic.AtomicInteger getBookmarkIdLast()
    • setMaxWidth

      void setMaxWidth​(int maxWidth, java.lang.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