• <menu id="w2i4a"></menu>
  • logo Aspose.Words使用教程

    文檔首頁(yè)>>Aspose.Words使用教程>>Aspose.Words使用教程之如何操作主題屬性

    Aspose.Words使用教程之如何操作主題屬性


    我們已經(jīng)在Aspose.Words 15.7.0添加了基本API來(lái)訪問(wèn)文檔的主題屬性,現(xiàn)在,這API包括以下幾個(gè)公共對(duì)象:

    • 主題
    • 主題字體
    • 主題顏色

    以下介紹如何獲取主題屬性:

    C#

    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.

    Visual Basic

    Dim doc As New Document(MyDir & "in.docx")
    Dim theme As 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.
    
    

    以下介紹如何設(shè)置主題屬性:

    C#

    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.

    Visual Basic

    Dim doc As New Document(MyDir & "in.docx")
    Dim theme As 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.

    立即下載Aspose.Words最新版

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();