Class XHTMLImageHandlerDefault

java.lang.Object
org.docx4j.convert.in.xhtml.XHTMLImageHandlerDefault
All Implemented Interfaces:
XHTMLImageHandler

public class XHTMLImageHandlerDefault extends Object implements XHTMLImageHandler
  • Field Details

    • log

      public static org.slf4j.Logger log
    • imagePartCache

      protected HashMap<String,org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage> imagePartCache
  • Constructor Details

    • XHTMLImageHandlerDefault

      public XHTMLImageHandlerDefault(XHTMLImporterImpl importer)
  • Method Details

    • getMaxWidth

      public int getMaxWidth()
    • setMaxWidth

      public void setMaxWidth(int maxWidth, String tableStyle)
      Description copied from interface: XHTMLImageHandler
      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).
      Specified by:
      setMaxWidth in interface XHTMLImageHandler
      tableStyle - - can be null
    • setMaxWidth

      public void setMaxWidth(int maxWidth)
    • addImage

      public void addImage(Docx4jUserAgent docx4jUserAgent, org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage, org.docx4j.wml.P p, Element e, Long cx, Long cy)
      Specified by:
      addImage in interface XHTMLImageHandler
      Parameters:
      docx4jUserAgent -
      wordMLPackage -
      p -
      e -
      cx - width of image itself (ie excluding CSS margin, padding) in EMU
      cy -