• <menu id="w2i4a"></menu>
  • logo E-iceblue中文文檔

    文檔首頁>>E-iceblue中文文檔>>在word文檔中設(shè)置段落間距

    在word文檔中設(shè)置段落間距


    Spire.Doc for .NET是一款專門對 Word 文檔進(jìn)行操作的 .NET 類庫。在于幫助開發(fā)人員無需安裝 Microsoft Word情況下,輕松快捷高效地創(chuàng)建、編輯、轉(zhuǎn)換和打印 Microsoft Word 文檔。擁有近10年專業(yè)開發(fā)經(jīng)驗Spire系列辦公文檔開發(fā)工具,專注于創(chuàng)建、編輯、轉(zhuǎn)換和打印Word/PDF/Excel等格式文件處理,小巧便捷。 

    E-iceblue 功能類庫Spire 系列文檔處理組件均由中國本土團隊研發(fā),不依賴第三方軟件,不受其他國家的技術(shù)或法律法規(guī)限制,同時適配國產(chǎn)操作系統(tǒng)如中科方德、中標(biāo)麒麟等,兼容國產(chǎn)文檔處理軟件 WPS(如 .wps/.et/.dps 等格式

    Spire.Doc for.NET 最新下載

    段落是word文檔中非常重要的元素。它功能強大并且具有許多特性。Spire.Doc 是專為開發(fā)人員設(shè)計的 .NET 組件,可讓您輕松靈活地操作段落。

    我們網(wǎng)站上有介紹如何設(shè)置對齊、縮進(jìn)和項目符號的文檔。這篇文章向您介紹了如何在word文檔中設(shè)置段落間距。

    第一步:創(chuàng)建word文檔。

    Document document = new Document();
    Section section = document.AddSection();

    第 2 步:將第一段添加到文檔中。

    Paragraph paragraph = section.AddParagraph();
    paragraph.AppendText("Thank you for requesting a trial version of Spire.Doc. The component will work normally except for an evaluation warning message. Once you purchase a license file, the evaluation warning will disappeare.");

    第 3 步設(shè)置第一段的行距。

    paragraph.Format.LineSpacing = 20;

    第4步設(shè)置第一段的間距。

    paragraph.Format.BeforeSpacing = 30;

    第 5 步設(shè)置第一段之后的間距

    paragraph.Format.AfterSpacing = 15;

    第 6 步保存文檔。

    document.SaveToFile("result.doc", FileFormat.Doc);

    完整代碼

    using Spire.Doc;
    using Spire.Doc.Documents;
    namespace Spacing
    {
    class Program
    {
    
    static void Main(string[] args)
    {
    Document document = new Document();
    Section section = document.AddSection();
    
    //add the first paragraph
    Paragraph paragraph = section.AddParagraph();
    paragraph.AppendText("Thank you for requesting a trial version of Spire.Doc. The component will work normally except for an evaluation warning message. Once you purchase a license file, the evaluation warning will disappeare.");
    paragraph.Format.FirstLineIndent = 20;
    
    //set the Line spacing
    paragraph.Format.LineSpacing = 20;
    
    //set the Spacing Before
    paragraph.Format.BeforeSpacing = 30;
    
    //set the Spacing After
    paragraph.Format.AfterSpacing = 15;
    
    //add the second paragraph
    Paragraph paragraph2 = section.AddParagraph();
    paragraph2.AppendText("Spire.Doc (Pack) is a compilation of Spire.Doc for .NET, Spire.Doc for Silverlight and Spire.Doc for WPF. It is a professional and powerful Word component which enables you to generate, load, write, edit and save Word document on .NET, Silverlight and WPF. With Spire.Doc, you can create a large range of applications.");
    paragraph2.Format.FirstLineIndent = 20;
    
    //set the Line spacing
    paragraph2.Format.LineSpacing = 25;
    
    //save the document
    document.SaveToFile("result.doc", FileFormat.Doc);
    
    System.Diagnostics.Process.Start("result.doc");
    
    }
    }
    }

    截圖

    Set Spacing of Paragraphs in word document


    歡迎下載|體驗更多E-iceblue產(chǎn)品

    獲取更多信息請咨詢慧都在線客服  ;技術(shù)交流Q群(767755948)


    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    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); })();