ww优德88 com优德官网_优德w88手机下载_w88优德娱乐中文

频道:优德88 日期: 浏览:365

1.刺进一个连续:

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

Example

在文档中刺进分页符:

C#

DocumentBuilder builder = new DocumentBuilder();Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.Writeln("This is page 1.");builder.InsertBreak(BreakType.PageBreak);builder.Writeln("This is page 2.");builder.InsertBreak(BreakType.PageBreak);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("This is page 2.")builder.InsertBreak(BreakType.PageBreak)builder.Writeln("This is page 3.")

2.刺进一个图画

DocumentBuilder供给几个[{{DocumentBuilder.InsertImage}})多载调集办法,这使得能答应刺进一个内联的或许起浮的图画,假如图画是一个EMF或WMF元文件,它将刺进到文档的图元文件格局,一切其他的图画将以PNG格局存储。

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

从文件或URL经过传递一串字符串参数({{DocumentBuilder.InsertImage}}) 从一段流经过一个流参数({{DocumentBuilder.InsertImage}}) 从一个图画目标经过一个图画参数(DocumentBuilder.InsertImage) 从一个字节数组经过一个字节数组参数({{DocumentBuilder.InsertImage}})

(1)刺进内联图画

Example

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

C#

Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage(MyDir + "Watermark.png");

Visual Basic

Dim doc As New Document()Dim builder As New DocumentBuilder(doc)builder.InsertImage(MyDir & "Watermark.png")

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

Example

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

C#

Document doc = new Document();DocumentBuilder builder = new DocumentBuilder(doc);builder.InsertImage(MyDir + "Watermark.png",RelativeHorizontalPosition.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, RelativeVerticalPosition.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.StartBookmark("FineBookmark");builder.Writeln("This is just a fine bookmark.");builder.EndBookmark("FineBookmark");

Visual 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最新版下载

热门
最新
推荐
标签