We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Theme Support

How can I change Theme color and fonts ?


1) I want to change primary font, secondary font
2) I want to change all the ascents, background, text, hyperlink colors

Hi Abhradeep,


Thanks for your request. We have logged your requirement in our issue tracking system as WORDSNET-10513. Our development team will further look into the details of this requirement and we will keep you updated on the status. We apologize for any inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-10513) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

Thanks for add this feature. Can you please give me an example of how to work with theme?

Hi Abhradeep,


Thanks for your inquiry. We have added basic API to access document theme properties. For now, this API includes following public objects:

  • Theme
  • ThemeFonts
  • ThemeColors

Here is how you can get theme properties:

Document doc = new Document(MyDir + @“in.docx”);

Theme theme = doc.Theme;

Console.WriteLine(theme.MajorFonts.Latin); // Major (Headings) font for Latin characters.

Console.WriteLine(theme.MinorFonts.EastAsian); // Minor (Body) font for EastAsian characters.

Console.WriteLine(theme.Colors.Accent1); // Color for theme color Accent 1.


And here is how you can set theme properties:

Document doc = new Document(MyDir + @“in.docx”);

Theme theme = doc.Theme;

theme.MinorFonts.Latin = "Times New Roman"; // Set Times New Roman font as Body theme font for Latin Character.

theme.Colors.Hyperlink = Color.Gold; // Set Color.Gold for theme color Hyperlink.


I hope, this helps.

Best regards,

Hi,


Can I get Java Sample for the same… The provided example seems to be .Net specific.

I don’t see or find Theme class in Java package. We are using 15.6.0 version for our development. Is this introduced in later version of Aspose?

Hi Karthik,


Thanks for your inquiry. Please see “Basic API to Programmatically Manipulate Themes Added” section in Public API Changes in Aspose.Words 15.7.0 page. Yes, you need to use at least 15.7.0 or latest version of Aspose.Words for Java.

Best regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan