Class DocumentUtil
java.lang.Object
org.wickedsource.docxstamper.util.DocumentUtil
-
Method Summary
Modifier and TypeMethodDescriptionallElements(org.docx4j.openpackaging.packages.WordprocessingMLPackage subDocument) static <T> List<T>extractElements(Object object, Class<T> elementClass) static StringgetImageRelationshipId(org.docx4j.wml.Drawing drawing) Retrieve an embedded drawing relationship id.static List<org.docx4j.wml.P>getParagraphsFromObject(Object parentObject) static List<org.docx4j.wml.Tc>getTableCellsFromObject(Object parentObject) static List<org.docx4j.wml.Tbl>getTableFromObject(Object parentObject) static List<org.docx4j.wml.Tr>getTableRowsFromObject(Object parentObject) static ObjectlastElement(org.docx4j.openpackaging.packages.WordprocessingMLPackage subDocument) 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.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.
-
Method Details
-
extractElements
-
getImageRelationshipId
Retrieve an embedded drawing relationship id.- Parameters:
drawing- the drawing to get the relationship id.- Returns:
- the id of the graphic
-
getParagraphsFromObject
-
getTableFromObject
-
getTableRowsFromObject
-
getTableCellsFromObject
-
lastElement
public static Object lastElement(org.docx4j.openpackaging.packages.WordprocessingMLPackage subDocument) -
allElements
-
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.
-