Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表

这篇具有很好参考价值的文章主要介绍了Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下,轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具,专注于创建、编辑、转换和打印Word/PDF/Excel等格式文件处理,小巧便捷。

E-iceblue 功能类库Spire 系列文档处理组件均由中国本土团队研发,不依赖第三方软件,不受其他国家的技术或法律法规限制,同时适配国产操作系统如中科方德、中标麒麟等,兼容国产文档处理软件 WPS(如 .wps/.et/.dps 等格式

Spire.Doc for.NET 最新下载(qun:767755948)https://www.evget.com/product/3368/download

Word 文档中使用列表来勾勒、排列和强调文本,使用户能够轻松扫描和理解一系列项目。Word中有三种不同类型的列表,即编号列表,项目符号列表和多级列表。编号列表用于具有序列或优先级的项目,例如一系列说明。项目符号列表用于没有特定优先级的项目,例如函数或事实列表。多级列表用于存在序列且您希望每个段落单独编号的情况。

在 C# 中插入 Word 中的编号列表

Spire.Doc for .NET 提供了 ListStyle 类,可用于创建编号列表样式或项目符号样式。然后,可以使用 Paragraph.ListFormat.ApplyStyle() 方法将列表样式应用于段落。创建编号列表的步骤如下。

  • 创建文档对象。
  • 使用 Document.AddSection() 方法添加一个节。
  • 创建 ListStyle 类的实例,将列表类型指定为“已编号”。
  • 通过 ListStyle.Levels[index] 属性获取列表的特定级别,并通过 ListLevel.PatternType 属性设置编号类型。
  • 使用 Document.ListStyles.Add() 方法将列表样式添加到文档中。
  • 使用 Section.AddParagraph() 方法向文档添加多个段落。
  • 使用 Paragraph.ListFormat.ApplyStyle() 方法将列表样式应用于特定段落。
  • 通过 Paragraph.ListFormat.ListLevelNumber 属性指定列表级别。
  • 使用 Document.SaveToFile() 方法将文档保存到 Word 文件。

【C# 】

using Spire.Doc;
using Spire.Doc.Documents;

namespace CreateOrderedList
{
class Program
{
static void Main(string[] args)
{
//Create a Document object
Document document = new Document();

//Add a section
Section section = document.AddSection();

//Create a numbered list style
ListStyle listStyle = new ListStyle(document, ListType.Numbered);
listStyle.Name = "numberedList";
listStyle.Levels[0].PatternType = ListPatternType.DecimalEnclosedParen;
listStyle.Levels[0].TextPosition = 20;
document.ListStyles.Add(listStyle);

//Add a paragraph
Paragraph paragraph = section.AddParagraph();
paragraph.AppendText("Required Web Development Skills:");
paragraph.Format.AfterSpacing = 5f;

//Add a paragraph and apply the numbered list style to it
paragraph = section.AddParagraph();
paragraph.AppendText("HTML");
paragraph.ListFormat.ApplyStyle("numberedList");
paragraph.ListFormat.ListLevelNumber = 0;

//Add another four paragraphs and apply the numbered list style to them
paragraph = section.AddParagraph();
paragraph.AppendText("CSS");
paragraph.ListFormat.ApplyStyle("numberedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("JavaScript");
paragraph.ListFormat.ApplyStyle("numberedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("Python");
paragraph.ListFormat.ApplyStyle("numberedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("MySQL");
paragraph.ListFormat.ApplyStyle("numberedList");
paragraph.ListFormat.ListLevelNumber = 0;

//Save the document to file
document.SaveToFile("NumberedList.docx", FileFormat.Docx);
}
}
}

【VB.NET】

Imports Spire.Doc
Imports Spire.Doc.Documents
 
Namespace CreateOrderedList
    Class Program
        Shared  Sub Main(ByVal args() As String)
            'Create a Document object
            Dim document As Document =  New Document() 
 
            'Add a section
            Dim section As Section =  document.AddSection() 
 
            'Create a numbered list style
            Dim listStyle As ListStyle =  New ListStyle(document,ListType.Numbered) 
            listStyle.Name = "numberedList"
            listStyle.Levels(0).PatternType = ListPatternType.DecimalEnclosedParen
            listStyle.Levels(0).TextPosition = 20   
            document.ListStyles.Add(listStyle)
 
            'Add a paragraph
            Dim paragraph As Paragraph =  section.AddParagraph() 
            paragraph.AppendText("Required Web Development Skills:")
            paragraph.Format.AfterSpacing = 5f
 
            'Add a paragraph and apply the numbered list style to it
            paragraph = section.AddParagraph()
            paragraph.AppendText("HTML")
            paragraph.ListFormat.ApplyStyle("numberedList")
            paragraph.ListFormat.ListLevelNumber = 0
 
            'Add another four paragraphs and apply the numbered list style to them
            paragraph = section.AddParagraph()
            paragraph.AppendText("CSS")
            paragraph.ListFormat.ApplyStyle("numberedList")
            paragraph.ListFormat.ListLevelNumber = 0
 
            paragraph = section.AddParagraph()
            paragraph.AppendText("JavaScript")
            paragraph.ListFormat.ApplyStyle("numberedList")
            paragraph.ListFormat.ListLevelNumber = 0
 
            paragraph = section.AddParagraph()
            paragraph.AppendText("Python")
            paragraph.ListFormat.ApplyStyle("numberedList")
            paragraph.ListFormat.ListLevelNumber = 0
 
            paragraph = section.AddParagraph()
            paragraph.AppendText("MySQL")
            paragraph.ListFormat.ApplyStyle("numberedList")
            paragraph.ListFormat.ListLevelNumber = 0
 
            'Save the document to file
            document.SaveToFile("NumberedList.docx", FileFormat.Docx)
        End Sub
    End Class
End Namespace

Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表

在 C# 中插入 Word 中的项目符号列表

创建项目符号列表的过程类似于创建编号列表的过程。不同之处在于,在创建列表样式时,必须将列表类型指定为"项目符号",并为其设置项目符号。以下是详细步骤。

  • 创建文档对象。
  • 使用 Document.AddSection() 方法添加一个节。
  • 创建 ListStyle 类的实例,将列表类型指定为项目符号
  • 通过 ListStyle.Levels[index] 属性获取列表的特定级别,并通过 ListLevel.BulletCharacter 属性设置项目符号。
  • 使用 Document.ListStyles.Add() 方法将列表样式添加到文档中。
  • 使用 Section.AddParagraph() 方法向文档添加多个段落。
  • 使用 Paragraph.ListFormat.ApplyStyle() 方法将列表样式应用于特定段落。
  • 通过 Paragraph.ListFormat.ListLevelNumber 属性指定列表级别。
  • 使用 Document.SaveToFile() 方法将文档保存到 Word 文件。

【C# 】

using Spire.Doc;
using Spire.Doc.Documents;

namespace CreateUnorderedList
{
class Program
{
static void Main(string[] args)
{
//Create a Document object
Document document = new Document();

//Add a section
Section section = document.AddSection();

//Create a bulleted list style
ListStyle listStyle = new ListStyle(document, ListType.Bulleted);
listStyle.Name = "bulletedList";
listStyle.Levels[0].BulletCharacter = "\x00B7";
listStyle.Levels[0].CharacterFormat.FontName = "Symbol";
listStyle.Levels[0].TextPosition = 20;
document.ListStyles.Add(listStyle);

//Add a paragraph
Paragraph paragraph = section.AddParagraph();
paragraph.AppendText("Computer Science Subjects:");
paragraph.Format.AfterSpacing = 5f;

//Add a paragraph and apply the bulleted list style to it
paragraph = section.AddParagraph();
paragraph.AppendText("Data Structure");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

//Add another five paragraphs and apply the bulleted list style to them
paragraph = section.AddParagraph();
paragraph.AppendText("Algorithm");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("Computer Networks");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("Operating System");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("C Programming");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("Theory of Computations");
paragraph.ListFormat.ApplyStyle("bulletedList");
paragraph.ListFormat.ListLevelNumber = 0;

//Save the document to file
document.SaveToFile("BulletedList.docx", FileFormat.Docx);
}
}
}

【VB.NET】

Imports Spire.Doc
Imports Spire.Doc.Documents

Namespace CreateUnorderedList
Class Program
Shared Sub Main(ByVal args() As String)
'Create a Document object
Dim document As Document = New Document()

'Add a section
Dim section As Section = document.AddSection()

'Create a bulleted list style
Dim listStyle As ListStyle = New ListStyle(document,ListType.Bulleted)
listStyle.Name = "bulletedList"
listStyle.Levels(0).BulletCharacter = "\x00B7"
listStyle.Levels(0).CharacterFormat.FontName = "Symbol"
listStyle.Levels(0).TextPosition = 20
document.ListStyles.Add(listStyle)

'Add a paragraph
Dim paragraph As Paragraph = section.AddParagraph()
paragraph.AppendText("Computer Science Subjects:")
paragraph.Format.AfterSpacing = 5f

'Add a paragraph and apply the bulleted list style to it
paragraph = section.AddParagraph()
paragraph.AppendText("Data Structure")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

'Add another five paragraphs and apply the bulleted list style to them
paragraph = section.AddParagraph()
paragraph.AppendText("Algorithm")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

paragraph = section.AddParagraph()
paragraph.AppendText("Computer Networks")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

paragraph = section.AddParagraph()
paragraph.AppendText("Operating System")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

paragraph = section.AddParagraph()
paragraph.AppendText("C Programming")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

paragraph = section.AddParagraph()
paragraph.AppendText("Theory of Computations")
paragraph.ListFormat.ApplyStyle("bulletedList")
paragraph.ListFormat.ListLevelNumber = 0

'Save the document to file
document.SaveToFile("BulletedList.docx", FileFormat.Docx)
End Sub
End Class
End Namespace

Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表

在 C# 的 Word 中插入多级编号列表

多级列表至少包含两个不同的级别。嵌套列表的每个级别都由 ListStyle.Levels[index] 属性表示,通过该属性可以设置特定级别的编号类型和前缀。以下是在 Word 中创建多级编号列表的步骤。

  • 创建文档对象。
  • 使用 Document.AddSection() 方法添加一个节。
  • 创建 ListStyle 类的实例,将列表类型指定为“已编号”。
  • 通过 ListStyle.Levels[index] 属性获取列表的特定级别,并设置编号类型和前缀。
  • 使用 Document.ListStyles.Add() 方法将列表样式添加到文档中。
  • 使用 Section.AddParagraph() 方法向文档添加多个段落。
  • 使用 Paragraph.ListFormat.ApplyStyle() 方法将列表样式应用于特定段落。
  • 通过 Paragraph.ListFormat.ListLevelNumber 属性指定列表级别。
  • 使用 Document.SaveToFile() 方法将文档保存到 Word 文件。

【C# 】

using Spire.Doc;
using Spire.Doc.Documents;

namespace CreateMultiLevelList
{
class Program
{
static void Main(string[] args)
{
//Create a Document object
Document document = new Document();

//Add a section
Section section = document.AddSection();

//Create a numbered list style, specifying number prefix and pattern type of each level
ListStyle listStyle = new ListStyle(document, ListType.Numbered);
listStyle.Name = "levelstyle";
listStyle.Levels[0].PatternType = ListPatternType.Arabic;
listStyle.Levels[0].TextPosition = 20;
listStyle.Levels[1].NumberPrefix = "\x0000.";
listStyle.Levels[1].PatternType = ListPatternType.Arabic;
listStyle.Levels[2].NumberPrefix = "\x0000.\x0001.";
listStyle.Levels[2].PatternType = ListPatternType.Arabic;
document.ListStyles.Add(listStyle);

//Add a paragraph
Paragraph paragraph = section.AddParagraph();
paragraph.AppendText("Here's a Multi-Level Numbered List:");
paragraph.Format.AfterSpacing = 5f;

//Add a paragraph and apply the numbered list style to it
paragraph = section.AddParagraph();
paragraph.AppendText("The first item");
paragraph.ListFormat.ApplyStyle("levelstyle");
paragraph.ListFormat.ListLevelNumber = 0;

//Add another five paragraphs and apply the numbered list stype to them
paragraph = section.AddParagraph();
paragraph.AppendText("The second item");
paragraph.ListFormat.ApplyStyle("levelstyle");
paragraph.ListFormat.ListLevelNumber = 0;

paragraph = section.AddParagraph();
paragraph.AppendText("The first sub-item");
paragraph.ListFormat.ApplyStyle("levelstyle");
paragraph.ListFormat.ListLevelNumber = 1;

paragraph = section.AddParagraph();
paragraph.AppendText("The second sub-item");
paragraph.ListFormat.ContinueListNumbering();
paragraph.ListFormat.ApplyStyle("levelstyle");

paragraph = section.AddParagraph();
paragraph.AppendText("A sub-sub-item");
paragraph.ListFormat.ApplyStyle("levelstyle");
paragraph.ListFormat.ListLevelNumber = 2;

paragraph = section.AddParagraph();
paragraph.AppendText("The third item");
paragraph.ListFormat.ApplyStyle("levelstyle");
paragraph.ListFormat.ListLevelNumber = 0;

//Save the document to file
document.SaveToFile("MultilevelNumberedList.docx", FileFormat.Docx);
}
}
}

【VB.NET】

Imports Spire.Doc
Imports Spire.Doc.Documents

Namespace CreateMultiLevelList
Class Program
Shared Sub Main(ByVal args() As String)
'Create a Document object
Dim document As Document = New Document()

'Add a section
Dim section As Section = document.AddSection()

'Create a numbered list style, specifying number prefix and pattern type of each level
Dim listStyle As ListStyle = New ListStyle(document,ListType.Numbered)
listStyle.Name = "levelstyle"
listStyle.Levels(0).PatternType = ListPatternType.Arabic
listStyle.Levels(0).TextPosition = 20
listStyle.Levels(1).NumberPrefix = "\x0000."
listStyle.Levels(1).PatternType = ListPatternType.Arabic
listStyle.Levels(2).NumberPrefix = "\x0000.\x0001."
listStyle.Levels(2).PatternType = ListPatternType.Arabic
document.ListStyles.Add(listStyle)

'Add a paragraph
Dim paragraph As Paragraph = section.AddParagraph()
paragraph.AppendText("Here's a Multi-Level Numbered List:")
paragraph.Format.AfterSpacing = 5f

'Add a paragraph and apply the numbered list style to it
paragraph = section.AddParagraph()
paragraph.AppendText("The first item")
paragraph.ListFormat.ApplyStyle("levelstyle")
paragraph.ListFormat.ListLevelNumber = 0

'Add another five paragraphs and apply the numbered list stype to them
paragraph = section.AddParagraph()
paragraph.AppendText("The second item")
paragraph.ListFormat.ApplyStyle("levelstyle")
paragraph.ListFormat.ListLevelNumber = 0

paragraph = section.AddParagraph()
paragraph.AppendText("The first sub-item")
paragraph.ListFormat.ApplyStyle("levelstyle")
paragraph.ListFormat.ListLevelNumber = 1

paragraph = section.AddParagraph()
paragraph.AppendText("The second sub-item")
paragraph.ListFormat.ContinueListNumbering()
paragraph.ListFormat.ApplyStyle("levelstyle")

paragraph = section.AddParagraph()
paragraph.AppendText("A sub-sub-item")
paragraph.ListFormat.ApplyStyle("levelstyle")
paragraph.ListFormat.ListLevelNumber = 2

paragraph = section.AddParagraph()
paragraph.AppendText("The third item")
paragraph.ListFormat.ApplyStyle("levelstyle")
paragraph.ListFormat.ListLevelNumber = 0

'Save the document to file
document.SaveToFile("MultilevelNumberedList.docx", FileFormat.Docx)
End Sub
End Class
End Namespace

Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表

在 C# 的 Word 中插入多级混合类型列表

在某些情况下,您可能希望在多级列表中混合使用数字和符号项目符号点。要创建混合类型列表,您只需创建编号列表样式和项目符号列表样式,并将它们应用于不同的段落。具体步骤如下。

  • 创建文档对象。
  • 使用 Document.AddSection() 方法添加一个节。
  • 创建编号列表样式和项目符号列表样式。
  • 使用 Section.AddParagraph() 方法向文档添加多个段落。
  • 使用 Paragraph.ListFormat.ApplyStyle() 方法将不同的列表样式应用于不同的段落。
  • 使用 Document.SaveToFile() 方法将文档保存到 Word 文件。

【C# 】

using Spire.Doc;
using Spire.Doc.Documents;

namespace CreateMultilevelMixedList
{
class Program
{
static void Main(string[] args)
{
//Create a Document object
Document document = new Document();

//Add a section
Section section = document.AddSection();

//Create a numbered list style
ListStyle numberedListStyle = new ListStyle(document, ListType.Numbered);
numberedListStyle.Name = "numberedStyle";
numberedListStyle.Levels[0].PatternType = ListPatternType.Arabic;
numberedListStyle.Levels[0].TextPosition = 20;
numberedListStyle.Levels[1].PatternType = ListPatternType.LowLetter;
document.ListStyles.Add(numberedListStyle);

//Create a bulleted list style
ListStyle bulletedListStyle = new ListStyle(document, ListType.Bulleted);
bulletedListStyle.Name = "bulltedStyle";
bulletedListStyle.Levels[2].BulletCharacter = "\x002A";
bulletedListStyle.Levels[2].CharacterFormat.FontName = "Symbol";
document.ListStyles.Add(bulletedListStyle);

//Add a paragraph
Paragraph paragraph = section.AddParagraph();
paragraph.AppendText("Here's a Multi-Level Mixed List:");
paragraph.Format.AfterSpacing = 5f;

//Add a paragraph and apply the numbered list style to it
paragraph = section.AddParagraph();
paragraph.AppendText("The first item");
paragraph.ListFormat.ApplyStyle("numberedStyle");
paragraph.ListFormat.ListLevelNumber = 0;

//Add another five paragraphs and apply different list stype to them
paragraph = section.AddParagraph();
paragraph.AppendText("The first sub-item");
paragraph.ListFormat.ApplyStyle("numberedStyle");
paragraph.ListFormat.ListLevelNumber = 1;

paragraph = section.AddParagraph();
paragraph.AppendText("The second sub-item");
paragraph.ListFormat.ListLevelNumber = 1;
paragraph.ListFormat.ApplyStyle("numberedStyle");

paragraph = section.AddParagraph();
paragraph.AppendText("The first sub-sub-item");
paragraph.ListFormat.ApplyStyle("bulltedStyle");
paragraph.ListFormat.ListLevelNumber = 2;

paragraph = section.AddParagraph();
paragraph.AppendText("The second sub-sub-item");
paragraph.ListFormat.ApplyStyle("bulltedStyle");
paragraph.ListFormat.ListLevelNumber = 2;

paragraph = section.AddParagraph();
paragraph.AppendText("The second item");
paragraph.ListFormat.ApplyStyle("numberedStyle");
paragraph.ListFormat.ListLevelNumber = 0;

//Save the document to file
document.SaveToFile("MultilevelMixedList.docx", FileFormat.Docx);
}
}
}

【VB.NET】

Imports Spire.Doc
Imports Spire.Doc.Documents

Namespace CreateMultilevelMixedList
Class Program
Shared Sub Main(ByVal args() As String)
'Create a Document object
Dim document As Document = New Document()

'Add a section
Dim section As Section = document.AddSection()

'Create a numbered list style
Dim numberedListStyle As ListStyle = New ListStyle(document,ListType.Numbered)
numberedListStyle.Name = "numberedStyle"
numberedListStyle.Levels(0).PatternType = ListPatternType.Arabic
numberedListStyle.Levels(0).TextPosition = 20
numberedListStyle.Levels(1).PatternType = ListPatternType.LowLetter
document.ListStyles.Add(numberedListStyle)

'Create a bulleted list style
Dim bulletedListStyle As ListStyle = New ListStyle(document,ListType.Bulleted)
bulletedListStyle.Name = "bulltedStyle"
bulletedListStyle.Levels(2).BulletCharacter = "\x002A"
bulletedListStyle.Levels(2).CharacterFormat.FontName = "Symbol"
document.ListStyles.Add(bulletedListStyle)

'Add a paragraph
Dim paragraph As Paragraph = section.AddParagraph()
paragraph.AppendText("Here's a Multi-Level Mixed List:")
paragraph.Format.AfterSpacing = 5f

'Add a paragraph and apply the numbered list style to it
paragraph = section.AddParagraph()
paragraph.AppendText("The first item")
paragraph.ListFormat.ApplyStyle("numberedStyle")
paragraph.ListFormat.ListLevelNumber = 0

'Add another five paragraphs and apply different list stype to them
paragraph = section.AddParagraph()
paragraph.AppendText("The first sub-item")
paragraph.ListFormat.ApplyStyle("numberedStyle")
paragraph.ListFormat.ListLevelNumber = 1

paragraph = section.AddParagraph()
paragraph.AppendText("The second sub-item")
paragraph.ListFormat.ListLevelNumber = 1
paragraph.ListFormat.ApplyStyle("numberedStyle")

paragraph = section.AddParagraph()
paragraph.AppendText("The first sub-sub-item")
paragraph.ListFormat.ApplyStyle("bulltedStyle")
paragraph.ListFormat.ListLevelNumber = 2

paragraph = section.AddParagraph()
paragraph.AppendText("The second sub-sub-item")
paragraph.ListFormat.ApplyStyle("bulltedStyle")
paragraph.ListFormat.ListLevelNumber = 2

paragraph = section.AddParagraph()
paragraph.AppendText("The second item")
paragraph.ListFormat.ApplyStyle("numberedStyle")
paragraph.ListFormat.ListLevelNumber = 0

'Save the document to file
document.SaveToFile("MultilevelMixedList.docx", FileFormat.Docx)
End Sub
End Class
End Namespace

Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表

以上便是如何在 Word 文档中插入列表的教程,如果您有其他问题也可以继续浏览本系列文章。文章来源地址https://www.toymoban.com/news/detail-459783.html

到了这里,关于Word控件Spire.Doc 【列表】教程:在 Word 文档中插入列表的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Word控件Spire.Doc 【Table】教程(6): 在 Word 中合并或拆分表格单元格

    Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下,轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具,专注于创建、编辑、转换和打印Word/PDF/Excel等格式文件处

    2024年02月15日
    浏览(27)
  • 借助文档控件Aspose.Words,将 Word DOC/DOCX 转换为 TXT

    在文档处理领域,经常需要将 Word 文档转换为更简单的纯文本格式。无论是出于数据提取、内容分析还是兼容性原因,将 Word(.doc、.docx)文件转换为纯文本(.txt)的能力对于开发人员来说都是一项宝贵的技能。在这篇博文中,我们将探讨如何在 C# 应用程序中将 Word 文档转换

    2024年01月19日
    浏览(38)
  • Spire.doc实现对word的操作(包括文字,表格,图片)

    Spire.doc比较小众,因此需要在pom.xml中导入spire.doc的仓库,导入之后直接导包 导入仓库后进行导包 2.1.1模板 首先需要准备一个word模板,可以在里面进行文字替换,因为文字特别多,所以此处采用了对具有特殊符号的文字进行替换。此处采用 ${xxx} 模板如图所示: 2.1.2替换核心

    2023年04月12日
    浏览(38)
  • java 将word转为pdf文件的两种方式【spire.doc.free】【documents4j】

    如资产证明等场景下,一般要求同时生成word与pdf两种格式的证明文件,且两者格式需保持一致,可以各自单独生成,但那样可能需要维护两个模板文件,所以也可以仅定义一份word的模板文件,使用模板生成word文件,再将word转换为pdf,这样不仅少维护一个模板,也可以保证

    2024年02月12日
    浏览(47)
  • Java使用spire进行word文档的替换

    今天遇到一个需求,需要对word模板进行替换制定的变量 在网上找了很多方案,做了很多的demo,下面就把我觉得比较简单的一种分享给大家 本次的主角是:spire.doc Spire.Doc for .NET 是一款专门对 Word 文档进行操作的 .NET类库。这款控件的主要功能在于帮助开发人员轻松快捷高效

    2024年02月05日
    浏览(26)
  • PDF控件Spire.PDF for .NET【安全】演示:加密 PDF 文档

    加密PDF是人们常用的保护PDF的方法。无论对于公司还是个人,使用PDF加密来设置一些限制都是必不可少的。为了使PDF文档可供未经授权的用户阅读但无法修改,加密的PDF文档需要两个密码:所有者密码和用户密码。本节将特别介绍一种通过 Spire.PDF for .NET 使用 C#、VB.NET 快速加

    2024年03月14日
    浏览(33)
  • PDF控件Spire.PDF for .NET【安全】演示:更改 PDF 文档的安全权限

    当您使用密码保护 PDF 文档时,您可以选择指定一组权限。权限决定用户如何与文件交互。例如,您可以对文档应用权限以禁止用户打印或使用剪切和粘贴操作。本文演示如何在C# 和 VB.NET中使用Spire.PDF for .NET更改 PDF 文档的安全权限。 Spire.PDF for .NET 是一款独立 PDF 控件,用于

    2024年01月19日
    浏览(44)
  • Python 实现 PDF 到 Word 文档的高效转换(DOC、DOCX)

    PDF(Portable Document Format)已成为一种广泛使用的电子文档格式。PDF的主要优势是跨平台,可以在不同设备上呈现一致的外观。然而,当我们需要对文件内容进行编辑或修改,直接编辑PDF文件会非常困难,而且效果也不理想。将PDF文件转换为Word文档(doc、docx)再进行编辑是一

    2024年02月03日
    浏览(37)
  • Java处理doc类型的Word文档转换成html(按顺序保留格式+图片)

    最新有个新需求,就是doc文档转换html内容倒不是很难,给大家分享一下,总体思路就是按doc转html的思路来走,唯一缺点是不会自动转换图片,图片是要手动转成base64,默认是有html、body、head、meta等等标签,我这里都用正则处理掉了。 需要注意的是: .docx 格式的 Word 文档是

    2024年02月03日
    浏览(46)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包