com.aspose.words

  • java.lang.Object
    • com.aspose.words.Theme
  • All Implemented Interfaces:
    java.lang.Cloneable
    public class Theme 
    extends java.lang.Object

Represents document Theme, and provides access to main theme parts including MajorFonts, MinorFonts and Colors

Example:

Show how to change document theme options.
Document doc = new Document();
// Get document theme and do something useful
Theme theme = doc.getTheme();

theme.getColors().setAccent1(Color.BLACK);
theme.getColors().setDark1(Color.BLUE);
theme.getColors().setFollowedHyperlink(Color.WHITE);
theme.getColors().setHyperlink(new Color(245, 245, 245));//Color Hex White Smoke
theme.getColors().setLight1(new Color(0, 0, 0, 0)); //There is default Color.Black

theme.getMajorFonts().setComplexScript("Arial");
theme.getMajorFonts().setEastAsian("");
theme.getMajorFonts().setLatin("Times New Roman");

theme.getMinorFonts().setComplexScript("");
theme.getMinorFonts().setEastAsian("Times New Roman");
theme.getMinorFonts().setLatin("Arial");

Constructor Summary
 
Property Getters/Setters Summary
ThemeColorsgetColors()
Allows to specify the set of theme colors for the document.
ThemeFontsgetMajorFonts()
Allows to specify the set of major fonts for different languages.
ThemeFontsgetMinorFonts()
Allows to specify the set of minor fonts for different languages.
 

    • Constructor Detail

      • Theme

        public Theme()
    • Property Getters/Setters Detail

      • getColors

        public ThemeColors getColors()
        
        Allows to specify the set of theme colors for the document.

        Example:

        Show how to change document theme options.
        Document doc = new Document();
        // Get document theme and do something useful
        Theme theme = doc.getTheme();
        
        theme.getColors().setAccent1(Color.BLACK);
        theme.getColors().setDark1(Color.BLUE);
        theme.getColors().setFollowedHyperlink(Color.WHITE);
        theme.getColors().setHyperlink(new Color(245, 245, 245));//Color Hex White Smoke
        theme.getColors().setLight1(new Color(0, 0, 0, 0)); //There is default Color.Black
        
        theme.getMajorFonts().setComplexScript("Arial");
        theme.getMajorFonts().setEastAsian("");
        theme.getMajorFonts().setLatin("Times New Roman");
        
        theme.getMinorFonts().setComplexScript("");
        theme.getMinorFonts().setEastAsian("Times New Roman");
        theme.getMinorFonts().setLatin("Arial");
      • getMajorFonts

        public ThemeFonts getMajorFonts()
        
        Allows to specify the set of major fonts for different languages.

        Example:

        Show how to change document theme options.
        Document doc = new Document();
        // Get document theme and do something useful
        Theme theme = doc.getTheme();
        
        theme.getColors().setAccent1(Color.BLACK);
        theme.getColors().setDark1(Color.BLUE);
        theme.getColors().setFollowedHyperlink(Color.WHITE);
        theme.getColors().setHyperlink(new Color(245, 245, 245));//Color Hex White Smoke
        theme.getColors().setLight1(new Color(0, 0, 0, 0)); //There is default Color.Black
        
        theme.getMajorFonts().setComplexScript("Arial");
        theme.getMajorFonts().setEastAsian("");
        theme.getMajorFonts().setLatin("Times New Roman");
        
        theme.getMinorFonts().setComplexScript("");
        theme.getMinorFonts().setEastAsian("Times New Roman");
        theme.getMinorFonts().setLatin("Arial");
      • getMinorFonts

        public ThemeFonts getMinorFonts()
        
        Allows to specify the set of minor fonts for different languages.

        Example:

        Show how to change document theme options.
        Document doc = new Document();
        // Get document theme and do something useful
        Theme theme = doc.getTheme();
        
        theme.getColors().setAccent1(Color.BLACK);
        theme.getColors().setDark1(Color.BLUE);
        theme.getColors().setFollowedHyperlink(Color.WHITE);
        theme.getColors().setHyperlink(new Color(245, 245, 245));//Color Hex White Smoke
        theme.getColors().setLight1(new Color(0, 0, 0, 0)); //There is default Color.Black
        
        theme.getMajorFonts().setComplexScript("Arial");
        theme.getMajorFonts().setEastAsian("");
        theme.getMajorFonts().setLatin("Times New Roman");
        
        theme.getMinorFonts().setComplexScript("");
        theme.getMinorFonts().setEastAsian("Times New Roman");
        theme.getMinorFonts().setLatin("Arial");