Package org.docx4j.samples
Class PartsStrip
java.lang.Object
org.docx4j.samples.PartsStrip
Remove certain parts from docx,
either the specified docx, or each one in
the specified directory (beware!).
For this reason, this sample is shipped
pointing to a non-existent directory.
Which parts are deleted is configurable
to some extent; please consult the code to see.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static boolean(package private) static String(package private) static String(package private) static boolean(package private) static booleanprivate static org.slf4j.Logger(package private) static boolean(package private) static boolean(package private) static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidprintInfo(Part p, StringBuilder sb, String indent) private static voidprocessFile(File inputfile, String outputfilepath) static voidtraverseRelationships(WordprocessingMLPackage wordMLPackage, RelationshipsPart rp, StringBuilder sb, String indent)
-
Field Details
-
save
static boolean save -
flatOpcXmlOutput
static boolean flatOpcXmlOutput -
overwriteInputFile
static boolean overwriteInputFile -
dir
-
file
-
stripPropertiesParts
static boolean stripPropertiesParts -
keepStyles
static boolean keepStyles -
defaultToDelete
static boolean defaultToDelete -
log
private static org.slf4j.Logger log
-
-
Constructor Details
-
PartsStrip
public PartsStrip()
-
-
Method Details
-
main
- Parameters:
args-- Throws:
Exception
-
processFile
- Throws:
Docx4JException
-
printInfo
-
traverseRelationships
public static void traverseRelationships(WordprocessingMLPackage wordMLPackage, RelationshipsPart rp, StringBuilder sb, String indent) throws Docx4JException - Throws:
Docx4JException
-