Class Containerization

java.lang.Object
org.docx4j.convert.out.common.preprocess.Containerization

public class Containerization extends Object
In Word, adjacent paragraphs with the same borders are enclosed in a single border (unless bullets/numbering apply). Similarly with shading. (If the 2 paragraphs are shaded different colors, then the color of the first extends to the start of the second, so there is no white strip between them). To do the same in HTML and PDF output, we put matching paragraphs into a content control, and set the border/shading on that. This gives us an appropriate div or fo:block.
  • Field Details

  • Constructor Details

    • Containerization

      public Containerization()
  • Method Details

    • process

      public static void process(WordprocessingMLPackage wmlPackage)
    • groupAdjacentBorders

      protected static void groupAdjacentBorders(List<Object> content)
    • groupTable

      private static void groupTable(Tbl table)
    • groupBodyContent

      private static List<Object> groupBodyContent(List<Object> bodyElts)
    • groupRuns

      private static List<Object> groupRuns(List<Object> paragraphElts)
    • appendRun

      private static void appendRun(SdtBlock currentBlock, List<Object> resultElts)
    • findBlockRPr

      private static RPr findBlockRPr(SdtBlock currentBlock)
    • createSdt

      private static SdtBlock createSdt(String tagVal)
    • createSdt

      private static SdtBlock createSdt(String tagVal, RPr rPr)
    • bordersChanged

      private static boolean bordersChanged(PPrBase.PBdr currentBorders, PPrBase.PBdr lastBorders)
    • borderChanged

      private static boolean borderChanged(CTBorder currentBorder, CTBorder lastBorder)
    • shadingChanged

      private static boolean shadingChanged(CTShd currentShading, CTShd lastShading)