com.aspose.words

Class CleanupOptions

  • java.lang.Object
    • com.aspose.words.CleanupOptions
public class CleanupOptions 
extends java.lang.Object

Allows to specify options for document cleaning.

Example:

Shows how to remove all unused styles and lists from a document.
Document doc = new Document(getMyDir() + "Document.doc");

CleanupOptions cleanupOptions = new CleanupOptions();
cleanupOptions.setUnusedLists(true);
cleanupOptions.setUnusedStyles(true);

doc.cleanup(cleanupOptions);

Constructor Summary
 
Property Getters/Setters Summary
booleangetUnusedLists()
void
setUnusedLists(booleanvalue)
           Specifies whether unused list and list definitions should be removed from document. Default value is true.
booleangetUnusedStyles()
void
setUnusedStyles(booleanvalue)
           Specifies whether unused styles should be removed from document. Default value is true.
 

    • Constructor Detail

      • CleanupOptions

        public CleanupOptions()
    • Property Getters/Setters Detail

      • getUnusedLists/setUnusedLists

        public boolean getUnusedLists() / public void setUnusedLists(boolean value)
        
        Specifies whether unused list and list definitions should be removed from document. Default value is true.

        Example:

        Shows how to remove all unused styles and lists from a document.
        Document doc = new Document(getMyDir() + "Document.doc");
        
        CleanupOptions cleanupOptions = new CleanupOptions();
        cleanupOptions.setUnusedLists(true);
        cleanupOptions.setUnusedStyles(true);
        
        doc.cleanup(cleanupOptions);
      • getUnusedStyles/setUnusedStyles

        public boolean getUnusedStyles() / public void setUnusedStyles(boolean value)
        
        Specifies whether unused styles should be removed from document. Default value is true.

        Example:

        Shows how to remove all unused styles and lists from a document.
        Document doc = new Document(getMyDir() + "Document.doc");
        
        CleanupOptions cleanupOptions = new CleanupOptions();
        cleanupOptions.setUnusedLists(true);
        cleanupOptions.setUnusedStyles(true);
        
        doc.cleanup(cleanupOptions);