苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州

1.刺进一个连续:

假如你想开端一个新行、列、阶段或许页面,调用DocumentBuilder.InsertBreak就行。

Exam苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州ple

在文档中刺进分页符:

C#

DocumentBuilder builder = 美少女视频new DocumentBuilder();Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.Writeln(&qu山东工艺美术学院ot;This is page 1.");b苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州uilder.InsertBreak(BreakType.PageBreak);builder.Writeln("This is page 2.");builder.InsertBreak(BreakType.P苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州ageBreak);builder.Writeln("This is page 3.");

Visual Basic韩国化妆品品牌

Dim doc As New Document()Dim builder As New DocumentBuilder(doc)builder.Writeln("This is page 1.")builder.InsertBreak(BreakType.PageBreak)builder.Writeln(&quo李宝英t;This is page 2.")builder.Inse末日刁民rtBreak(BreakType.PageBreak)builder.Writeln("This is page 3.")

2.刺进一个图画

DocumentBuilder供给几个[{{Document苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州Bui教我国文的王先生lder.InsertImage}})多载调集办法,这使得能答应刺进苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州一个内联的或许起浮的图画,假如图画村是一个EMF或WMF元文件,它将刺进到文档的passenger图元文件格局,一切其他的图画将以PNG格局存储。

DocumentBuilder.InsertImage办法能够运用来自不同来历的图画:

从文件或URL经过传递一串字符串参数({{DocumentBuilder.Inser国画荷花tImage}}) 从一段流经过一个流参数({{DocumentBui陀枪儿媳lder.In苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州sertImage}}) 从一个图画目标经过一个图画参数(DocumentBuilder.InsertImage) 从一个字节数组经过一个字节数组参数({{DocumentBuilder.InsertImage}})

(1)刺进内联图画

Example

如安在一个文档的光标方位刺进内联图画。

C#

Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage(MyDi新台币对人民币汇率r + "Watermark.png");

Visual Basic

Dim doc As New Document()Dim builder As New DocumentBuilder(doc)builde苜蓿,Aspose.Words运用教程之刺进文档元素(二,柳州r.InsertImage(MyDir & "Watermark.png")

(2)刺进一个起浮(肯定方位)的图画

Example

怎么从文件或URL刺进一个起浮图画:

C#

Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage(MyD尿道感染ir + "Watermark.png",Re胡然lativeHorizontalPosition.Margin, 100, RelativeVerticalPosition.Margin, 100, 200, 100, WrapType.Square);

Visual Basic

Dim doc As姜思达 New Document()Dim builder As New DocumentBuilder(doc)builder.InsertImage(MyDir & "Watermark.png", RelativeHorizontalPosition.Margin, 100, RelativeVerticalPositiondestination.Margin, 100, 200, 100, WrapType.Square)

3.刺进一个书签

刺进一个书报到文档中,需求做一下几点:

调用[DocumentBuilder.StartBookmark]经过它设置想要的书签名 运用蒙嘉慧DocumentBuilder办法刺进书签文本 调用[DocumentBuilder.EndBookmark]经过它设置一个与之前设置的书签相同的姓名

书签能够堆叠和跨过任何规模。创立一个有用的标签你需求调用DocumentBuilder.StartBookmark和DocumentBuilder书签,它们的标签名有必要相同

Example

怎样运用document builder在文档中刺进一个标签:

C#

Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.StartBo吴孟超okmark(&精灵王纪传quot;FineBookmark");builder.Writeln("This is just a fine bookmark.");builder.EndBookmark("FineBookmark");

Visua淫色谷l Basic

Dim doc As New Document()Dim builder As New DocumentBuilder(doc)builder.StartBookmark("FineBookmark")builder.Writeln("This is just a fine bookmark.")builder.EndBookmark("FineBookmark")

Aspose.Words最新版下载