• 大小: 1.06MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-11-09
  • 语言: C#
  • 标签: C#  

资源简介

C#DocX组件实现word的基础功能操作源码,相对NPOI而言DocX组件更加容易理解,操作word很方便

资源截图

代码片段和文件信息

/***************************************************************************************

   DocX – DocX is the community edition of Xceed Words for .NET

   Copyright (C) 2009-2017 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features and fast professional support
   pick up Xceed Words for .NET at https://xceed.com/xceed-words-for-net/

  *************************************************************************************/
using System;
using System.Collections.Generic;
using System.Threading;

namespace Xceed.Words.NET.Examples
{
  public class Program
  {
    internal const string SampleDirectory = @“..\..\Samples\“;

    private static void Main( string[] args )
    {

      Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo( “en-US“ );

      //Paragraphs      
      ParagraphSample.SimpleFormattedParagraphs();
      ParagraphSample.ForceParagraphOnSinglePage();
      ParagraphSample.ForceMultiParagraphsOnSinglePage();
      ParagraphSample.TextActions();
      ParagraphSample.Heading();

      //Document
      DocumentSample.AddCustomProperties();
      DocumentSample.ReplaceText();
      DocumentSample.ApplyTemplate();
      DocumentSample.AppendDocument();

      //Images
      ImageSample.AddPicture();
      ImageSample.CopyPicture();
      ImageSample.ModifyImage();

      //Indentation/Direction/Margins
      MarginSample.SetDirection();
      MarginSample.Indentation();
      MarginSample.Margins();

      //Header/Footers
      HeaderFooterSample.HeadersFooters();     

      //Tables
      TableSample.InsertRowAndImageTable();
      TableSample.TextDirectionTable();
      TableSample.CreateRowsFromTemplate();
      TableSample.ColumnsWidth();
      TableSample.MergeCells();

      //Hyperlink
      HyperlinkSample.Hyperlinks();

      //Section
      SectionSample.InsertSections();

      //Lists
      ListSample.AddList();

      //Equations
      EquationSample.InsertEquation();

      //Bookmarks
      BookmarkSample.InsertBookmarks();
      BookmarkSample.ReplaceText();

      //Charts
      ChartSample.BarChart();
      ChartSample.LineChart();
      ChartSample.PieChart();
      ChartSample.Chart3D();

      //Tale of Content
      TableOfContentSample.InsertTableOfContent();
      TableOfContentSample.InsertTableOfContentWithReference();

      //Lines
      LineSample.InsertHorizontalLine();

      //Protection
      ProtectionSample.AddPasswordProtection();
      ProtectionSample.AddProtection();

      //Parallel  
      ParallelSample.DoParallelActions();

      //Others
      MiscellaneousSample.CreateRecipe();
      MiscellaneousSample.CompanyReport();
      MiscellaneousSample.CreateInvoice();


      Console.WriteLine( “\nPress any key to exit.“ );
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-02-21 14:33  DocX-master\
     目录           0  2019-02-21 14:33  DocX-master\Examples\
     文件        4047  2019-02-21 14:33  DocX-master\Examples\Program.cs
     目录           0  2019-02-21 14:33  DocX-master\Examples\Properties\
     文件        1145  2019-02-21 14:33  DocX-master\Examples\Properties\AssemblyInfo.cs
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\
     文件        3981  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\BookmarkSample.cs
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\Output\
     文件        5563  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\Output\InsertBookmarks.docx
     文件       13275  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\Output\ReplaceBookmarkText.docx
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\Resources\
     文件       13224  2019-02-21 14:33  DocX-master\Examples\Samples\Bookmark\Resources\DocumentWithBookmarks.docx
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\
     文件        2142  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\ChartData.cs
     文件        6431  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\ChartSample.cs
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\Output\
     文件        6693  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\Output\3DChart.docx
     文件        6826  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\Output\BarChart.docx
     文件        6750  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\Output\LineChart.docx
     文件        6378  2019-02-21 14:33  DocX-master\Examples\Samples\Chart\Output\PieChart.docx
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Document\
     文件        6340  2019-02-21 14:33  DocX-master\Examples\Samples\Document\DocumentSample.cs
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Output\
     文件        6266  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Output\AddCustomProperties.docx
     文件       11591  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Output\AppendDocument.docx
     文件       22788  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Output\ApplyTemplate.docx
     目录           0  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Resources\
     文件       11493  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Resources\First.docx
     文件       11831  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Resources\ReplaceText.docx
     文件       11646  2019-02-21 14:33  DocX-master\Examples\Samples\Document\Resources\Second.docx
............此处省略166个文件信息

评论

共有 条评论