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 ColorsExample:
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 |
Theme()
|
Theme
public Theme()
-
Property Getters/Setters Detail |
-
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");
-
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");
-
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");
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.