Class DocumentUtil

java.lang.Object
org.wickedsource.docxstamper.util.DocumentUtil

public class DocumentUtil extends Object
  • Method Details

    • extractElements

      public static <T> List<T> extractElements(Object object, Class<T> elementClass)
    • getImageRelationshipId

      public static String getImageRelationshipId(org.docx4j.wml.Drawing drawing)
      Retrieve an embedded drawing relationship id.
      Parameters:
      drawing - the drawing to get the relationship id.
      Returns:
      the id of the graphic
    • getParagraphsFromObject

      public static List<org.docx4j.wml.P> getParagraphsFromObject(Object parentObject)
    • getTableFromObject

      public static List<org.docx4j.wml.Tbl> getTableFromObject(Object parentObject)
    • getTableRowsFromObject

      public static List<org.docx4j.wml.Tr> getTableRowsFromObject(Object parentObject)
    • getTableCellsFromObject

      public static List<org.docx4j.wml.Tc> getTableCellsFromObject(Object parentObject)
    • lastElement

      public static Object lastElement(org.docx4j.openpackaging.packages.WordprocessingMLPackage subDocument)
    • allElements

      public static List<Object> allElements(org.docx4j.openpackaging.packages.WordprocessingMLPackage subDocument)
    • walkObjectsAndImportImages

      public static Map<org.docx4j.wml.R,org.docx4j.wml.R> walkObjectsAndImportImages(org.docx4j.openpackaging.packages.WordprocessingMLPackage source, org.docx4j.openpackaging.packages.WordprocessingMLPackage target)
      Recursively walk through source to find embedded images and import them in the target document.
      Parameters:
      source - source document containing image files.
      target - target document to add image files to.
    • walkObjectsAndImportImages

      public static Map<org.docx4j.wml.R,org.docx4j.wml.R> walkObjectsAndImportImages(org.docx4j.wml.ContentAccessor container, org.docx4j.openpackaging.packages.WordprocessingMLPackage source, org.docx4j.openpackaging.packages.WordprocessingMLPackage target)
      Recursively walk through source accessor to find embedded images and import the target document.
      Parameters:
      container - source container to walk.
      source - source document containing image files.
      target - target document to add image files to.