DocumentBuilder

遗产: java.lang.Object

public class DocumentBuilder

提供插入文本、图像和其他内容、指定字体、段落和节格式的方法。

要了解更多信息,请访问Document Builder Overview文档文章。

DocumentBuilder使建立一个过程Document更轻松。Document是一个由节点树组成的复合对象,虽然可以将内容节点直接插入树中,但需要对树结构有很好的理解。DocumentBuilder是复杂结构的“门面”Document并允许快速轻松地插入内容和格式。

创建一个DocumentBuilder并将其与getDocument() / setDocument(com.aspose.words.Document).

DocumentBuilder有一个内部光标,当您调用时将在其中插入文本write(java.lang.String), writeln(java.lang.String), M:Aspose.Words.DocumentBuilder.InsertBreak(Aspose.Words.BreakType)和其他方法。您可以浏览DocumentBuilder使用各种 MoveToXXX 方法将光标移动到文档中的不同位置。

使用getFont()属性指定将应用于从文档中当前位置开始插入的所有文本的字符格式。

使用getParagraphFormat()属性指定当前段落和将插入的所有段落的段落格式。

使用getPageSetup()属性为当前部分和将插入的所有部分指定页面和部分属性。

使用getCellFormat()getRowFormat()属性来指定表格单元格和行的格式属性。用户insertCell()endRow()建表的方法。

注意Font, ParagraphFormatPageSetup每当您导航到文档中的不同位置时,属性都会更新,以反映新位置可用的格式属性。

构造器

构造函数描述
DocumentBuilder()初始化此类的新实例。
DocumentBuilder(Document doc)初始化此类的新实例。

方法

方法描述
clearCellAttrs()
clearRowAttrs()
clearRunAttrs()
deleteRow(int tableIndex, int rowIndex)从表中删除一行。
endBookmark(String bookmarkName)将文档中的当前位置标记为书签结束。
endColumnBookmark(String bookmarkName)将文档中的当前位置标记为列书签结束。
endEditableRange()将文档中的当前位置标记为可编辑范围结束。
endEditableRange(EditableRangeStart start)将文档中的当前位置标记为可编辑范围结束。
endRow()结束文档中的表格行。
endTable()结束文档中的表格。
equals(Object arg0)
fetchCellAttr(int key)
fetchInheritedCellAttr(int key)
fetchInheritedRowAttr(int key)
fetchInheritedRunAttr(int fontAttr)
fetchRowAttr(int key)
getBold()如果字体格式为粗体,则为真。
getCellFormat()返回表示当前表格单元格格式化属性的对象。
getClass()
getCurrentNode()获取当前在此 DocumentBuilder 中选择的节点。
getCurrentParagraph()获取当前在此 DocumentBuilder 中选择的段落。
getCurrentSection()获取当前在此 DocumentBuilder 中选择的部分。
getCurrentStory()获取当前在此 DocumentBuilder 中选择的报道。
getCurrentStructuredDocumentTag()获取当前在此 DocumentBuilder 中选择的结构化文档标记。
getDirectCellAttr(int key)
getDirectRowAttr(int key)
getDirectRunAttr(int fontAttr)
getDocument()获取getDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。
getFont()返回表示当前字体格式属性的对象。
getItalic()如果字体格式为斜体,则为真。
getListFormat()返回一个表示当前列表格式属性的对象。
getPageSetup()返回一个表示当前页面设置和部分属性的对象。
getParagraphFormat()返回一个表示当前段落格式属性的对象。
getRowFormat()返回一个表示当前表格行格式属性的对象。
getUnderline()获取/设置当前字体的下划线类型。
hashCode()
insertBreak(int breakType)
insertCell()将表格单元格插入到文档中。
insertChart(int chartType, double width, double height)
insertChart(int chartType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertCheckBox(String name, boolean defaultValue, boolean checkedValue, int size)在当前位置插入一个复选框表单域。
insertCheckBox(String name, boolean checkedValue, int size)在当前位置插入一个复选框表单域。
insertComboBox(String name, String[] items, int selectedIndex)在当前位置插入一个组合框表单域。
insertDocument(Document srcDoc, int importFormatMode)
insertDocument(Document srcDoc, int importFormatMode, ImportFormatOptions importFormatOptions)
insertField(int fieldType, boolean updateField)
insertField(String fieldCode)将 Word 域插入到文档中。
insertField(String fieldCode, String fieldValue)将 Word 字段插入文档而不更新字段结果。
insertFootnote(int footnoteType, String footnoteText)
insertFootnote(int footnoteType, String footnoteText, String referenceMark)
insertHorizontalRule()将水平线形插入文档。
insertHtml(String html)在文档中插入一个 HTML 字符串。
insertHtml(String html, boolean useBuilderFormatting)在文档中插入一个 HTML 字符串。
insertHtml(String html, int options)
insertHyperlink(String displayText, String urlOrBookmark, boolean isBookmark)在文档中插入超链接。
insertImage(byte[] imageBytes)将字节数组中的图像插入到文档中。
insertImage(byte[] imageBytes, double width, double height)将字节数组中的内联图像插入到文档中并将其缩放到指定的大小。
insertImage(byte[] imageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertImage(BufferedImage image)在文档中插入图像。
insertImage(BufferedImage image, double width, double height)将来自对象的内嵌图像插入到文档中并将其缩放到指定的大小。
insertImage(BufferedImage image, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertImage(InputStream stream)
insertImage(InputStream stream, double width, double height)
insertImage(InputStream stream, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertImage(String fileName)将文件或 URL 中的图像插入到文档中。
insertImage(String fileName, double width, double height)将文件或 URL 中的内联图像插入到文档中,并将其缩放到指定的大小。
insertImage(String fileName, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertNode(Node node)在光标前插入一个节点。
insertOleObject(InputStream stream, String progId, boolean asIcon, InputStream presentation)
insertOleObject(String fileName, boolean isLinked, boolean asIcon, InputStream presentation)
insertOleObject(String fileName, String progId, boolean isLinked, boolean asIcon, InputStream presentation)
insertOleObjectAsIcon(InputStream stream, String progId, String iconFile, String iconCaption)
insertOleObjectAsIcon(String fileName, boolean isLinked, String iconFile, String iconCaption)将嵌入或链接的 OLE 对象作为图标插入到文档中。
insertOleObjectAsIcon(String fileName, String progId, boolean isLinked, String iconFile, String iconCaption)将嵌入或链接的 OLE 对象作为图标插入到文档中。
insertOnlineVideo(String videoUrl, double width, double height)将在线视频对象插入文档并将其缩放到指定大小。
insertOnlineVideo(String videoUrl, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, double width, double height)将在线视频对象插入文档并将其缩放到指定大小。
insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertParagraph()在文档中插入段落分隔符。
insertShape(int shapeType, double width, double height)
insertShape(int shapeType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)
insertSignatureLine(SignatureLineOptions signatureLineOptions)在当前位置插入签名行。
insertSignatureLine(SignatureLineOptions signatureLineOptions, int horzPos, double left, int vertPos, double top, int wrapType)
insertStyleSeparator()将样式分隔符插入文档。
insertTableOfContents(String switches)在文档中插入一个 TOC(目录)字段。
insertTextInput(String name, int type, String format, String fieldValue, int maxLength)
isAtEndOfParagraph()如果光标位于当前段落的末尾,则返回 true。
isAtEndOfStructuredDocumentTag()退货true如果光标位于结构化文档标签的末尾。
isAtStartOfParagraph()如果光标位于当前段落的开头(光标前没有文本),则返回 true。
moveTo(Node node)将光标移动到内联节点或段落末尾。
moveToBookmark(String bookmarkName)将光标移动到书签。
moveToBookmark(String bookmarkName, boolean isStart, boolean isAfter)将光标移动到更精确的书签。
moveToCell(int tableIndex, int rowIndex, int columnIndex, int characterIndex)将光标移动到当前部分中的表格单元格。
moveToDocumentEnd()将光标移动到文档的末尾。
moveToDocumentStart()将光标移动到文档的开头。
moveToField(Field field, boolean isAfter)将光标移动到文档中的字段。
moveToHeaderFooter(int headerFooterType)
moveToMergeField(String fieldName)将光标移动到指定的合并字段。
moveToMergeField(String fieldName, boolean isAfter, boolean isDeleteField)将合并字段移动到指定的合并字段。
moveToParagraph(int paragraphIndex, int characterIndex)将光标移动到当前节中的一个段落。
moveToSection(int sectionIndex)将光标移动到指定部分中正文的开头。
moveToStructuredDocumentTag(StructuredDocumentTag structuredDocumentTag, int characterIndex)将光标移动到结构化文档标签。
moveToStructuredDocumentTag(int structuredDocumentTagIndex, int characterIndex)将光标移动到当前部分中的结构化文档标签。
notify()
notifyAll()
popFont()检索先前保存在堆栈中的字符格式。
pushFont()将当前字符格式保存到堆栈中。
removeRunAttr(int key)
resetToDefaultAttrs()
setBold(boolean value)如果字体格式为粗体,则为真。
setCellAttr(int key, Object value)
setDocument(Document value)设置getDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。
setItalic(boolean value)如果字体格式为斜体,则为真。
setRowAttr(int key, Object value)
setRunAttr(int fontAttr, Object value)
setUnderline(int value)获取/设置当前字体的下划线类型。
startBookmark(String bookmarkName)将文档中的当前位置标记为书签开始。
startColumnBookmark(String bookmarkName)将文档中的当前位置标记为列书签开始。
startEditableRange()将文档中的当前位置标记为可编辑范围的起点。
startTable()在文档中开始一个表格。
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)
write(String text)在文档的当前插入位置插入一个字符串。
writeln()在文档中插入段落分隔符。
writeln(String text)在文档中插入一个字符串和一个段落分隔符。

DocumentBuilder()

public DocumentBuilder()

初始化此类的新实例。创建一个新的DocumentBuilder对象并将其附加到一个新的getDocument() / setDocument(com.aspose.words.Document)目的。

DocumentBuilder(Document doc)

public DocumentBuilder(Document doc)

初始化此类的新实例。创建一个新的DocumentBuilder对象,附加到指定getDocument() / setDocument(com.aspose.words.Document)目的。光标位于文档的开头。

参数:

范围类型描述
docDocument要附加到的文档对象。

clearCellAttrs()

public void clearCellAttrs()

clearRowAttrs()

public void clearRowAttrs()

clearRunAttrs()

public void clearRunAttrs()

deleteRow(int tableIndex, int rowIndex)

public Row deleteRow(int tableIndex, int rowIndex)

从表中删除一行。

如果光标位于要删除的行内,则光标移出到下一行或表格后的下一段。

如果从只包含一行的表中删除一行,则整个表将被删除。

对于index参数,当index大于等于0时,指定从头开始的一个索引,0为第一个元素。当 index 小于 0 时,它指定从末尾开始的索引,-1 是最后一个元素。

参数:

范围类型描述
tableIndexint表的索引。
rowIndexint表中行的索引。

退货: Row - 刚刚删除的行节点。

endBookmark(String bookmarkName)

public BookmarkEnd endBookmark(String bookmarkName)

将文档中的当前位置标记为书签结束。

文档中的书签可以重叠并跨越任何范围。要创建有效的书签,您需要同时调用startBookmark(java.lang.String)endBookmark(java.lang.String)与相同bookmarkName范围。

保存文档时,格式错误的书签或重名的书签将被忽略。

参数:

范围类型描述
bookmarkNamejava.lang.String书签名称。

退货: BookmarkEnd - 刚刚创建的书签结束节点。

endColumnBookmark(String bookmarkName)

public BookmarkEnd endColumnBookmark(String bookmarkName)

将文档中的当前位置标记为列书签结束。该位置必须在表格单元格中。

列书签覆盖一系列行中的一个或多个列。要创建有效的书签,您需要同时调用startColumnBookmark(java.lang.String)endColumnBookmark(java.lang.String)与相同bookmarkName范围。

保存文档时,格式错误的书签或重名的书签将被忽略。

插入的实际位置BookmarkEnd节点可能与当前文档生成器位置不同。

参数:

范围类型描述
bookmarkNamejava.lang.String书签名称。

退货: BookmarkEnd - 刚刚创建的书签结束节点。

endEditableRange()

public EditableRangeEnd endEditableRange()

将文档中的当前位置标记为可编辑范围结束。

文档中的可编辑范围可以重叠和跨越任何范围。要创建有效的可编辑范围,您需要同时调用startEditableRange()endEditableRange()或者endEditableRange(com.aspose.words.EditableRangeStart)方法。

保存文档时将忽略格式错误的可编辑范围。

退货: EditableRangeEnd 刚刚创建的可编辑范围结束节点。

endEditableRange(EditableRangeStart start)

public EditableRangeEnd endEditableRange(EditableRangeStart start)

将文档中的当前位置标记为可编辑范围结束。

在创建嵌套的可编辑范围期间使用此重载。

文档中的可编辑范围可以重叠和跨越任何范围。要创建有效的可编辑范围,您需要同时调用startEditableRange()endEditableRange()或者endEditableRange(com.aspose.words.EditableRangeStart)方法。

保存文档时将忽略格式错误的可编辑范围。

参数:

范围类型描述
startEditableRangeStart此可编辑范围开始。

退货: EditableRangeEnd 刚刚创建的可编辑范围结束节点。

endRow()

public Row endRow()

结束文档中的表格行。

称呼EndRow结束表格行。如果你打电话insertCell()紧随其后,表格将在新行上继续。

使用getRowFormat()属性来指定行格式。

退货: Row - 刚刚完成的行节点。

endTable()

public Table endTable()

结束文档中的表格。

此方法应仅在之后调用一次endRow()被称为。调用时,EndTable将光标移出当前单元格,指向表格之后。

退货: Table - 刚刚完成的表节点。

equals(Object arg0)

public boolean equals(Object arg0)

参数:

范围类型描述
arg0java.lang.Object

退货: 布尔值

fetchCellAttr(int key)

public Object fetchCellAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

fetchInheritedCellAttr(int key)

public Object fetchInheritedCellAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

fetchInheritedRowAttr(int key)

public Object fetchInheritedRowAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

fetchInheritedRunAttr(int fontAttr)

public Object fetchInheritedRunAttr(int fontAttr)

参数:

范围类型描述
fontAttrint

退货: java.lang.Object

fetchRowAttr(int key)

public Object fetchRowAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

getBold()

public boolean getBold()

如果字体格式为粗体,则为真。

退货: boolean - 相应的布尔值。

getCellFormat()

public CellFormat getCellFormat()

返回表示当前表格单元格格式化属性的对象。

退货: CellFormat - 表示当前表格单元格格式属性的对象。

getClass()

public final native Class<?> getClass()

退货: java.lang.Class

getCurrentNode()

public Node getCurrentNode()

获取当前在此 DocumentBuilder 中选择的节点。

CurrentNode是一个游标DocumentBuilder并指向一个Node那是一个的直接孩子Paragraph.您使用的任何插入操作DocumentBuilder将插入之前CurrentNode.

当前段落为空或光标位于段落结尾或结构化文档标记之前时,CurrentNode返回空值。

退货: Node 当前在此 DocumentBuilder 中选择的节点。

getCurrentParagraph()

public Paragraph getCurrentParagraph()

获取当前在此 DocumentBuilder 中选择的段落。getCurrentNode()

退货: Paragraph - 当前在此 DocumentBuilder 中选择的段落。

getCurrentSection()

public Section getCurrentSection()

获取当前在此 DocumentBuilder 中选择的部分。

退货: Section - 当前在此 DocumentBuilder 中选择的部分。

getCurrentStory()

public Story getCurrentStory()

获取当前在此 DocumentBuilder 中选择的报道。

退货: Story - 当前在此 DocumentBuilder 中选择的故事。

getCurrentStructuredDocumentTag()

public StructuredDocumentTag getCurrentStructuredDocumentTag()

获取当前在此 DocumentBuilder 中选择的结构化文档标记。

退货: StructuredDocumentTag - 当前在此 DocumentBuilder 中选择的结构化文档标签。

getDirectCellAttr(int key)

public Object getDirectCellAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

getDirectRowAttr(int key)

public Object getDirectRowAttr(int key)

参数:

范围类型描述
keyint

退货: java.lang.Object

getDirectRunAttr(int fontAttr)

public Object getDirectRunAttr(int fontAttr)

参数:

范围类型描述
fontAttrint

退货: java.lang.Object

getDocument()

public Document getDocument()

获取getDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。

退货: Document - 这getDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。

getFont()

public Font getFont()

返回表示当前字体格式属性的对象。

利用Font访问和修改字体格式属性。

在插入文本之前指定字体格式。

退货: Font - 表示当前字体格式属性的对象。

getItalic()

public boolean getItalic()

如果字体格式为斜体,则为真。

退货: boolean - 相应的布尔值。

getListFormat()

public ListFormat getListFormat()

返回一个表示当前列表格式属性的对象。

退货: ListFormat - 表示当前列表格式属性的对象。

getPageSetup()

public PageSetup getPageSetup()

返回一个表示当前页面设置和部分属性的对象。

退货: PageSetup - 表示当前页面设置和部分属性的对象。

getParagraphFormat()

public ParagraphFormat getParagraphFormat()

返回一个表示当前段落格式属性的对象。

退货: ParagraphFormat - 表示当前段落格式属性的对象。

getRowFormat()

public RowFormat getRowFormat()

返回一个表示当前表格行格式属性的对象。

退货: RowFormat - 表示当前表格行格式属性的对象。

getUnderline()

public int getUnderline()

获取/设置当前字体的下划线类型。

退货: int - 相应的 int 值。返回值是其中之一Underline常数。

hashCode()

public native int hashCode()

退货: 整数

insertBreak(int breakType)

public void insertBreak(int breakType)

参数:

范围类型描述
breakTypeint

insertCell()

public Cell insertCell()

将表格单元格插入到文档中。

要开始一个表,只需调用InsertCell.在此之后,您使用其他方法添加的任何内容DocumentBuilder类将被添加到当前单元格。

要在同一行中开始一个新单元格,请调用InsertCell再次。

结束表行调用endRow().

使用getCellFormat()属性来指定单元格格式。

退货: Cell - 刚刚插入的单元节点。

insertChart(int chartType, double width, double height)

public Shape insertChart(int chartType, double width, double height)

参数:

范围类型描述
chartTypeint
widthdouble
heightdouble

退货: Shape

insertChart(int chartType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertChart(int chartType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
chartTypeint
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertCheckBox(String name, boolean defaultValue, boolean checkedValue, int size)

public FormField insertCheckBox(String name, boolean defaultValue, boolean checkedValue, int size)

在当前位置插入一个复选框表单域。

如果您为表单域指定名称,则会自动创建同名书签。

参数:

范围类型描述
namejava.lang.String表单域的名称。可以是一个空字符串。超过 20 个字符的值将被截断。
defaultValueboolean复选框表单字段的默认值。
checkedValueboolean复选框表单域的当前选中状态。
sizeint以磅为单位指定复选框的大小。为 MS Word 指定 0 以自动计算复选框的大小。

退货: FormField - 刚刚插入的表单字段节点。

insertCheckBox(String name, boolean checkedValue, int size)

public FormField insertCheckBox(String name, boolean checkedValue, int size)

在当前位置插入一个复选框表单域。

如果您为表单域指定名称,则会自动创建同名书签。

参数:

范围类型描述
namejava.lang.String表单域的名称。可以是一个空字符串。超过 20 个字符的值将被截断。
checkedValueboolean复选框表单字段的选中状态。
sizeint以磅为单位指定复选框的大小。为 MS Word 指定 0 以自动计算复选框的大小。

退货: FormField - 刚刚插入的表单字段节点。

insertComboBox(String name, String[] items, int selectedIndex)

public FormField insertComboBox(String name, String[] items, int selectedIndex)

在当前位置插入一个组合框表单域。

如果您为表单域指定名称,则会自动创建同名书签。

参数:

范围类型描述
namejava.lang.String表单域的名称。可以是一个空字符串。超过 20 个字符的值将被截断。
itemsjava.lang.String[]ComboBox 的项目。最多 25 个项目。
selectedIndexintComboBox 中所选项目的索引。

退货: FormField - 刚刚插入的表单字段节点。

insertDocument(Document srcDoc, int importFormatMode)

public Node insertDocument(Document srcDoc, int importFormatMode)

参数:

范围类型描述
srcDocDocument
importFormatModeint

退货: Node

insertDocument(Document srcDoc, int importFormatMode, ImportFormatOptions importFormatOptions)

public Node insertDocument(Document srcDoc, int importFormatMode, ImportFormatOptions importFormatOptions)

参数:

范围类型描述
srcDocDocument
importFormatModeint
importFormatOptionsImportFormatOptions

退货: Node

insertField(int fieldType, boolean updateField)

public Field insertField(int fieldType, boolean updateField)

参数:

范围类型描述
fieldTypeint
updateFieldboolean

退货: Field

insertField(String fieldCode)

public Field insertField(String fieldCode)

将 Word 域插入到文档中。将 Word 字段插入文档并更新字段结果。

此方法将字段插入文档并立即更新字段结果。 Aspose.Words 可以更新大多数类型的字段,但不是全部。有关详细信息,请参阅insertField(java.lang.String, java.lang.String)超载。

参数:

范围类型描述
fieldCodejava.lang.String要插入的域代码(不带花括号)。

退货: Field - 一个Field表示插入字段的对象。

insertField(String fieldCode, String fieldValue)

public Field insertField(String fieldCode, String fieldValue)

将 Word 字段插入文档而不更新字段结果。

Microsoft Word 文档中的字段由字段代码和字段结果组成。字段代码就像一个公式,字段结果就像公式产生的值。字段代码还可以包含字段开关,这些开关类似于执行特定操作的附加指令。

您可以使用键盘快捷键 Alt+F9 在 Microsoft Word 文档中切换显示域代码和结果。域代码出现在大括号 (\ {}).

要创建字段,您需要指定字段类型、字段代码和“占位符”字段值。如果您不确定特定的域代码语法,请先在 Microsoft Word 中创建该域,然后切换以查看其域代码。

Aspose.Words可以计算大部分字段类型的字段结果,但该方法不会自动更新字段结果。因为字段结果不是自动计算的,所以您需要传递一些将插入到字段结果中的字符串值(甚至是空字符串)。该值将作为占位符保留在字段结果中,直到字段被更新。要更新字段结果,您可以调用Field.update()在返回给您的现场对象上或Document.updateFields()更新整个文档中的字段。

参数:

范围类型描述
fieldCodejava.lang.String要插入的域代码(不带花括号)。
fieldValuejava.lang.String要插入的字段值。为没有值的字段传递 null。

退货: Field - 一个Field表示插入字段的对象。

insertFootnote(int footnoteType, String footnoteText)

public Footnote insertFootnote(int footnoteType, String footnoteText)

参数:

范围类型描述
footnoteTypeint
footnoteTextjava.lang.String

退货: Footnote

insertFootnote(int footnoteType, String footnoteText, String referenceMark)

public Footnote insertFootnote(int footnoteType, String footnoteText, String referenceMark)

参数:

范围类型描述
footnoteTypeint
footnoteTextjava.lang.String
referenceMarkjava.lang.String

退货: Footnote

insertHorizontalRule()

public Shape insertHorizontalRule()

将水平线形插入文档。

退货: Shape - 水平规则的形状。

insertHtml(String html)

public void insertHtml(String html)

在文档中插入一个 HTML 字符串。

参数:

范围类型描述
htmljava.lang.String要插入到文档中的 HTML 字符串。您可以使用此方法插入 HTML 片段或整个 HTML 文档。

insertHtml(String html, boolean useBuilderFormatting)

public void insertHtml(String html, boolean useBuilderFormatting)

在文档中插入一个 HTML 字符串。

参数:

范围类型描述
htmljava.lang.String要插入到文档中的 HTML 字符串。
useBuilderFormattingboolean一个值,指示是否在中指定格式DocumentBuilder用作从 HTML 导入的文本的基本格式。

您可以使用此方法插入 HTML 片段或整个 HTML 文档。

当 useBuilderFormatting 为 false 时,DocumentBuilder格式化被忽略,插入文本的格式基于默认的 HTML 格式。因此,文本看起来就像在浏览器中呈现的一样。

当 useBuilderFormatting 为 true 时,插入文本的格式基于DocumentBuilder格式化,文本看起来就像是用write(java.lang.String). |

insertHtml(String html, int options)

public void insertHtml(String html, int options)

参数:

范围类型描述
htmljava.lang.String
optionsint
public Field insertHyperlink(String displayText, String urlOrBookmark, boolean isBookmark)

在文档中插入超链接。

请注意,您需要使用getFont()财产。

这个方法在内部调用insertField(java.lang.String)在文档中插入 MS Word 超链接字段。

参数:

范围类型描述
displayTextjava.lang.String要在文档中显示的链接文本。
urlOrBookmarkjava.lang.String链接目的地。可以是文档中的 url 或书签的名称。此方法总是在 url 的开头和结尾添加撇号。
isBookmarkboolean如果前一个参数是文档中书签的名称,则为真; false 是前面的参数是一个 URL。

退货: Field - 一个Field表示插入字段的对象。

insertImage(byte[] imageBytes)

public Shape insertImage(byte[] imageBytes)

将字节数组中的图像插入到文档中。图像以 100% 比例内联插入。

参数:

范围类型描述
imageBytesbyte[]包含图像的字节数组。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

insertImage(byte[] imageBytes, double width, double height)

public Shape insertImage(byte[] imageBytes, double width, double height)

将字节数组中的内联图像插入到文档中并将其缩放到指定的大小。

参数:

范围类型描述
imageBytesbyte[]包含图像的字节数组。
widthdouble图像的宽度(以磅为单位)。可以是负值或零值以请求 100% 比例。
heightdouble图像的高度(以磅为单位)。可以是负值或零值以请求 100% 比例。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

insertImage(byte[] imageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertImage(byte[] imageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
imageBytesbyte[]
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertImage(BufferedImage image)

public Shape insertImage(BufferedImage image)

在文档中插入图像。将对象中的图像插入到文档中。图像以 100% 比例内联插入。

参数:

范围类型描述
imagejava.awt.image.BufferedImage要插入到文档中的图像。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

Aspose.Words 将以 PNG 格式和默认设置插入图像。如果要插入另一种格式或具有其他设置的 BufferedImage,则需要将图像保存到字节数组中并使用insertImage(byte[]).

insertImage(BufferedImage image, double width, double height)

public Shape insertImage(BufferedImage image, double width, double height)

将来自对象的内嵌图像插入到文档中并将其缩放到指定的大小。

参数:

范围类型描述
imagejava.awt.image.BufferedImage要插入到文档中的图像。
widthdouble图像的宽度(以磅为单位)。可以是负值或零值以请求 100% 比例。
heightdouble图像的高度(以磅为单位)。可以是负值或零值以请求 100% 比例。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

Aspose.Words 将以 PNG 格式和默认设置插入图像。如果要插入另一种格式或具有其他设置的 BufferedImage,则需要将图像保存到字节数组中并使用insertImage(byte[]).

insertImage(BufferedImage image, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertImage(BufferedImage image, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
imagejava.awt.image.BufferedImage
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertImage(InputStream stream)

public Shape insertImage(InputStream stream)

参数:

范围类型描述
streamjava.io.InputStream

退货: Shape

insertImage(InputStream stream, double width, double height)

public Shape insertImage(InputStream stream, double width, double height)

参数:

范围类型描述
streamjava.io.InputStream
widthdouble
heightdouble

退货: Shape

insertImage(InputStream stream, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertImage(InputStream stream, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
streamjava.io.InputStream
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertImage(String fileName)

public Shape insertImage(String fileName)

将文件或 URL 中的图像插入到文档中。图像以 100% 比例内联插入。

参数:

范围类型描述
fileNamejava.lang.String带有图像的文件。可以是任何有效的本地或远程 URI。

退货: Shape - 刚刚插入的图像节点。

如果您指定远程 URI,此重载将在插入到文档之前自动下载图像。

您可以使用Shape此方法返回的对象。

insertImage(String fileName, double width, double height)

public Shape insertImage(String fileName, double width, double height)

将文件或 URL 中的内联图像插入到文档中,并将其缩放到指定的大小。

参数:

范围类型描述
fileNamejava.lang.String包含图像的文件。
widthdouble图像的宽度(以磅为单位)。可以是负值或零值以请求 100% 比例。
heightdouble图像的高度(以磅为单位)。可以是负值或零值以请求 100% 比例。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

insertImage(String fileName, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertImage(String fileName, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
fileNamejava.lang.String
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertNode(Node node)

public void insertNode(Node node)

在光标前插入一个节点。

参数:

范围类型描述
nodeNode

insertOleObject(InputStream stream, String progId, boolean asIcon, InputStream presentation)

public Shape insertOleObject(InputStream stream, String progId, boolean asIcon, InputStream presentation)

参数:

范围类型描述
streamjava.io.InputStream
progIdjava.lang.String
asIconboolean
presentationjava.io.InputStream

退货: Shape

insertOleObject(String fileName, boolean isLinked, boolean asIcon, InputStream presentation)

public Shape insertOleObject(String fileName, boolean isLinked, boolean asIcon, InputStream presentation)

参数:

范围类型描述
fileNamejava.lang.String
isLinkedboolean
asIconboolean
presentationjava.io.InputStream

退货: Shape

insertOleObject(String fileName, String progId, boolean isLinked, boolean asIcon, InputStream presentation)

public Shape insertOleObject(String fileName, String progId, boolean isLinked, boolean asIcon, InputStream presentation)

参数:

范围类型描述
fileNamejava.lang.String
progIdjava.lang.String
isLinkedboolean
asIconboolean
presentationjava.io.InputStream

退货: Shape

insertOleObjectAsIcon(InputStream stream, String progId, String iconFile, String iconCaption)

public Shape insertOleObjectAsIcon(InputStream stream, String progId, String iconFile, String iconCaption)

参数:

范围类型描述
streamjava.io.InputStream
progIdjava.lang.String
iconFilejava.lang.String
iconCaptionjava.lang.String

退货: Shape

insertOleObjectAsIcon(String fileName, boolean isLinked, String iconFile, String iconCaption)

public Shape insertOleObjectAsIcon(String fileName, boolean isLinked, String iconFile, String iconCaption)

将嵌入或链接的 OLE 对象作为图标插入到文档中。允许指定图标文件和标题。使用文件扩展名检测 OLE 对象类型。

参数:

范围类型描述
fileNamejava.lang.String文件的完整路径。
isLinkedboolean如果为真,则插入链接的 OLE 对象,否则插入嵌入的 OLE 对象。
iconFilejava.lang.StringICO 文件的完整路径。如果该值为空,Aspose.Words 将使用预定义的图像。
iconCaptionjava.lang.String图标说明。如果值为空,Aspose.Words 将使用文件名。

退货: Shape 包含 Ole 对象并插入到当前构建器位置的形状节点。

insertOleObjectAsIcon(String fileName, String progId, boolean isLinked, String iconFile, String iconCaption)

public Shape insertOleObjectAsIcon(String fileName, String progId, boolean isLinked, String iconFile, String iconCaption)

将嵌入或链接的 OLE 对象作为图标插入到文档中。允许指定图标文件和标题。使用给定的 progID 参数检测 OLE 对象类型。

参数:

范围类型描述
fileNamejava.lang.String文件的完整路径。
progIdjava.lang.StringOLE 对象的 ProgId。
isLinkedboolean如果为真,则插入链接的 OLE 对象,否则插入嵌入的 OLE 对象。
iconFilejava.lang.StringICO 文件的完整路径。如果该值为空,Aspose.Words 将使用预定义的图像。
iconCaptionjava.lang.String图标说明。如果值为空,Aspose.Words 将使用文件名。

退货: Shape 包含 Ole 对象并插入到当前构建器位置的形状节点。

insertOnlineVideo(String videoUrl, double width, double height)

public Shape insertOnlineVideo(String videoUrl, double width, double height)

将在线视频对象插入文档并将其缩放到指定大小。

参数:

范围类型描述
videoUrljava.lang.String视频的 URL。
widthdouble图像的宽度(以磅为单位)。可以是负值或零值以请求 100% 比例。
heightdouble图像的高度(以磅为单位)。可以是负值或零值以请求 100% 比例。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

支持从以下资源插入在线视频:

如果您的在线视频显示不正确,请使用insertOnlineVideo(java.lang.String, java.lang.String, byte[], double, double),它接受自定义的嵌入式 html 代码。

嵌入视频的代码可能因提供商而异,请咨询您选择的相应提供商以了解详细信息。

insertOnlineVideo(String videoUrl, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertOnlineVideo(String videoUrl, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
videoUrljava.lang.String
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, double width, double height)

public Shape insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, double width, double height)

将在线视频对象插入文档并将其缩放到指定大小。

参数:

范围类型描述
videoUrljava.lang.String视频的 URL。
videoEmbedCodejava.lang.String视频的嵌入代码。
thumbnailImageBytesbyte[]缩略图图像字节。
widthdouble图像的宽度(以磅为单位)。可以是负值或零值以请求 100% 比例。
heightdouble图像的高度(以磅为单位)。可以是负值或零值以请求 100% 比例。

退货: Shape - 刚刚插入的图像节点。

您可以使用Shape此方法返回的对象。

insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertOnlineVideo(String videoUrl, String videoEmbedCode, byte[] thumbnailImageBytes, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
videoUrljava.lang.String
videoEmbedCodejava.lang.String
thumbnailImageBytesbyte[]
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertParagraph()

public Paragraph insertParagraph()

在文档中插入段落分隔符。

指定的当前段落格式getParagraphFormat()财产被使用。

将当前段落一分为二。插入段落后,光标位于新段落的开头。

退货: Paragraph 刚刚插入的段落节点。它是同一个节点getCurrentParagraph().

insertShape(int shapeType, double width, double height)

public Shape insertShape(int shapeType, double width, double height)

参数:

范围类型描述
shapeTypeint
widthdouble
heightdouble

退货: Shape

insertShape(int shapeType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

public Shape insertShape(int shapeType, int horzPos, double left, int vertPos, double top, double width, double height, int wrapType)

参数:

范围类型描述
shapeTypeint
horzPosint
leftdouble
vertPosint
topdouble
widthdouble
heightdouble
wrapTypeint

退货: Shape

insertSignatureLine(SignatureLineOptions signatureLineOptions)

public Shape insertSignatureLine(SignatureLineOptions signatureLineOptions)

在当前位置插入签名行。

参数:

范围类型描述
signatureLineOptionsSignatureLineOptions存储创建签名行参数的对象。

退货: Shape - 刚刚插入的签名行节点。

insertSignatureLine(SignatureLineOptions signatureLineOptions, int horzPos, double left, int vertPos, double top, int wrapType)

public Shape insertSignatureLine(SignatureLineOptions signatureLineOptions, int horzPos, double left, int vertPos, double top, int wrapType)

参数:

范围类型描述
signatureLineOptionsSignatureLineOptions
horzPosint
leftdouble
vertPosint
topdouble
wrapTypeint

退货: Shape

insertStyleSeparator()

public void insertStyleSeparator()

将样式分隔符插入文档。此方法允许将不同的段落样式应用于文本行的两个不同部分。

insertTableOfContents(String switches)

public Field insertTableOfContents(String switches)

在文档中插入一个 TOC(目录)字段。

此方法将 TOC(目录)字段插入文档的当前位置。

可以通过多种方式构建 Word 文档中的目录,并使用多种选项设置其格式。 Microsoft Word 创建和显示表格的方式由字段开关控制。

指定开关的最简单方法是使用“插入”->“参考”->“索引和表格”菜单将目录插入和配置到 Word 文档中,然后打开域代码显示以查看开关。您可以在 Microsoft Word 中按 Alt+F9 来打开或关闭域代码的显示。

例如,在创建目录后,将以下字段插入到文档中:{ TOC \o “1-3” \h \z } .你可以复制**\o “1-3” \h \z**并将其用作开关参数。

注意InsertTableOfContents只会插入一个 TOC 字段,但不会实际构建目录。目录是在字段更新时由 Microsoft Word 构建的。

如果使用此方法插入目录,然后在 Microsoft Word 中打开文件,您将看不到目录,因为 TOC 字段尚未更新。

在 Microsoft Word 中,打开文档时不会自动更新字段,但您可以随时按 F9 键更新文档中的字段。

参数:

范围类型描述
switchesjava.lang.StringTOC 字段切换。

退货: Field

insertTextInput(String name, int type, String format, String fieldValue, int maxLength)

public FormField insertTextInput(String name, int type, String format, String fieldValue, int maxLength)

参数:

范围类型描述
namejava.lang.String
typeint
formatjava.lang.String
fieldValuejava.lang.String
maxLengthint

退货: FormField

isAtEndOfParagraph()

public boolean isAtEndOfParagraph()

如果光标位于当前段落的末尾,则返回 true。

退货: boolean - 如果光标位于当前段落的末尾则为真。

isAtEndOfStructuredDocumentTag()

public boolean isAtEndOfStructuredDocumentTag()

退货true如果光标位于结构化文档标签的末尾。

退货: 布尔值 -true如果光标位于结构化文档标签的末尾。

isAtStartOfParagraph()

public boolean isAtStartOfParagraph()

如果光标位于当前段落的开头(光标前没有文本),则返回 true。

退货: boolean - 如果光标位于当前段落的开头(光标前没有文本),则为 True。

moveTo(Node node)

public void moveTo(Node node)

将光标移动到内联节点或段落末尾。

什么时候node是一个内联级节点,光标移动到这个节点,更多的内容将被插入到那个节点之前。

什么时候node是一个Paragraph,光标移动到段落的末尾,更多的内容将被插入到段落分隔符之前。

什么时候node是块级节点但不是段落,光标移动到第一个段落的末尾进入块级节点,并且将在段落中断之前插入更多内容。

参数:

范围类型描述
nodeNode节点必须是段落或段落的直接子级。

moveToBookmark(String bookmarkName)

public boolean moveToBookmark(String bookmarkName)

将光标移动到书签。

将光标移动到具有指定名称的书签开始之后的位置。

比较不区分大小写。如果未找到书签,则返回 false 并且不移动光标。

插入新文本不会替换书签的现有文本。

请注意,文档中的某些书签已分配给表单域。移动到这样的书签并在那里插入文本会将文本插入到表单域代码中。虽然这不会使表单域无效,但插入的文本将不可见,因为它成为域代码的一部分。

参数:

范围类型描述
bookmarkNamejava.lang.String要将光标移动到的书签的名称。

退货: boolean - 如果找到书签,则为真;否则为假。

moveToBookmark(String bookmarkName, boolean isStart, boolean isAfter)

public boolean moveToBookmark(String bookmarkName, boolean isStart, boolean isAfter)

将光标移动到更精确的书签。

将光标移动到书签开始或结束之前或之后的位置。

如果所需位置不在行内级别,则移至下一段。

比较不区分大小写。如果未找到书签,则返回 false 并且不移动光标。

参数:

范围类型描述
bookmarkNamejava.lang.String要将光标移动到的书签的名称。
isStartboolean如果为 true,则将光标移动到书签的开头。如果为 false,则将光标移动到书签的末尾。
isAfterboolean如果为 true,则将光标移动到书签开始或结束位置之后。如果为 false,则将光标移动到书签开始或结束位置之前。

退货: boolean - 如果找到书签,则为真;否则为假。

moveToCell(int tableIndex, int rowIndex, int columnIndex, int characterIndex)

public void moveToCell(int tableIndex, int rowIndex, int columnIndex, int characterIndex)

将光标移动到当前部分中的表格单元格。

导航在当前部分的当前故事中执行。

对于index参数,当index大于等于0时,指定从头开始的一个索引,0为第一个元素。当 index 小于 0 时,它指定从末尾开始的索引,-1 是最后一个元素。

参数:

范围类型描述
tableIndexint要移动到的表的索引。
rowIndexint表中行的索引。
columnIndexint表中列的索引。
characterIndexint单元格内字符的索引。负值允许您指定从单元格末尾开始的位置。使用 -1 移动到单元格的末尾。

moveToDocumentEnd()

public void moveToDocumentEnd()

将光标移动到文档的末尾。

moveToDocumentStart()

public void moveToDocumentStart()

将光标移动到文档的开头。

moveToField(Field field, boolean isAfter)

public void moveToField(Field field, boolean isAfter)

将光标移动到文档中的字段。

参数:

范围类型描述
fieldField要将光标移动到的字段。
isAfterboolean当为 true 时,将光标移动到字段结束之后。如果为 false,则将光标移动到字段开始之前。

moveToHeaderFooter(int headerFooterType)

public void moveToHeaderFooter(int headerFooterType)

参数:

范围类型描述
headerFooterTypeint

moveToMergeField(String fieldName)

public boolean moveToMergeField(String fieldName)

将光标移动到指定的合并字段。将光标移动到刚好超出指定合并字段的位置并删除合并字段。

请注意,此方法会在移动光标后从文档中删除合并字段。

参数:

范围类型描述
fieldNamejava.lang.String邮件合并字段的不区分大小写的名称。

退货: boolean - 如果找到合并字段并且光标已移动,则为真;否则为假。

moveToMergeField(String fieldName, boolean isAfter, boolean isDeleteField)

public boolean moveToMergeField(String fieldName, boolean isAfter, boolean isDeleteField)

将合并字段移动到指定的合并字段。

参数:

范围类型描述
fieldNamejava.lang.String邮件合并字段的不区分大小写的名称。
isAfterboolean当为 true 时,将光标移动到字段结束之后。如果为 false,则将光标移动到字段开始之前。
isDeleteFieldboolean如果为 true,则删除合并字段。

退货: boolean - 如果找到合并字段并且光标已移动,则为真;否则为假。

moveToParagraph(int paragraphIndex, int characterIndex)

public void moveToParagraph(int paragraphIndex, int characterIndex)

将光标移动到当前节中的一个段落。

导航在当前部分的当前故事中执行。也就是说,如果您将光标移动到第一节的主标题,则paragraphIndex 指定该节标题内的段落索引。

当 paragraphIndex 大于或等于 0 时,它指定从该部分开头开始的索引,0 为第一段。当 paragraphIndex 小于 0 时,它指定从该部分末尾开始的索引,-1 为最后一段。

参数:

范围类型描述
paragraphIndexint要移动到的段落的索引。
characterIndexint段落内字符的索引。负值允许您指定从段落末尾开始的位置。使用 -1 移动到段落的末尾。

moveToSection(int sectionIndex)

public void moveToSection(int sectionIndex)

将光标移动到指定部分中正文的开头。

当 sectionIndex 大于或等于 0 时,它指定从文档开头开始的索引,0 是第一节。当 sectionIndex 小于 0 时,它指定从文档末尾开始的索引,-1 是最后一节。

光标移动到第一段Body的指定部分。

参数:

范围类型描述
sectionIndexint要移动到的部分的索引。

moveToStructuredDocumentTag(StructuredDocumentTag structuredDocumentTag, int characterIndex)

public void moveToStructuredDocumentTag(StructuredDocumentTag structuredDocumentTag, int characterIndex)

将光标移动到结构化文档标签。

参数:

范围类型描述
structuredDocumentTagStructuredDocumentTag要移动到的结构化文档标签。
characterIndexint结构化文档标签中字符的索引。负值允许您从结构化文档标签的末尾指定一个位置。使用 -1 移动到结构化文档标记的末尾。如果结构化文档标记处于块级别,并且您希望将光标移动到其最后一段的末尾,请指定 -2。

moveToStructuredDocumentTag(int structuredDocumentTagIndex, int characterIndex)

public void moveToStructuredDocumentTag(int structuredDocumentTagIndex, int characterIndex)

将光标移动到当前部分中的结构化文档标签。

导航在当前部分的当前故事中执行。也就是说,如果您将光标移动到第一部分的主标题,则 structuredDocumentTagIndex 指定该部分标题内的结构化文档标签的索引。

当 structuredDocumentTagIndex 大于或等于 0 时,它指定从部分开头开始的索引,0 是第一个结构化文档标签。当 structuredDocumentTagIndex 小于 0 时,它指定从部分末尾开始的索引,-1 是最后一个结构化文档标签。

参数:

范围类型描述
structuredDocumentTagIndexint要移动到的结构化文档标签的索引。
characterIndexint结构化文档标签中字符的索引。负值允许您从结构化文档标签的末尾指定一个位置。使用 -1 移动到结构化文档标记的末尾。如果结构化文档标记处于块级别,并且您希望将光标移动到其最后一段的末尾,请指定 -2。

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

popFont()

public void popFont()

检索先前保存在堆栈中的字符格式。

pushFont()

public void pushFont()

将当前字符格式保存到堆栈中。

removeRunAttr(int key)

public void removeRunAttr(int key)

参数:

范围类型描述
keyint

resetToDefaultAttrs()

public void resetToDefaultAttrs()

setBold(boolean value)

public void setBold(boolean value)

如果字体格式为粗体,则为真。

参数:

范围类型描述
valueboolean对应的布尔值。

setCellAttr(int key, Object value)

public void setCellAttr(int key, Object value)

参数:

范围类型描述
keyint
valuejava.lang.Object

setDocument(Document value)

public void setDocument(Document value)

设置getDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。

参数:

范围类型描述
valueDocumentgetDocument() / setDocument(com.aspose.words.Document)该对象附加到的对象。

setItalic(boolean value)

public void setItalic(boolean value)

如果字体格式为斜体,则为真。

参数:

范围类型描述
valueboolean对应的布尔值。

setRowAttr(int key, Object value)

public void setRowAttr(int key, Object value)

参数:

范围类型描述
keyint
valuejava.lang.Object

setRunAttr(int fontAttr, Object value)

public void setRunAttr(int fontAttr, Object value)

参数:

范围类型描述
fontAttrint
valuejava.lang.Object

setUnderline(int value)

public void setUnderline(int value)

获取/设置当前字体的下划线类型。

参数:

范围类型描述
valueint对应的int值。该值必须是其中之一Underline常数。

startBookmark(String bookmarkName)

public BookmarkStart startBookmark(String bookmarkName)

将文档中的当前位置标记为书签开始。

文档中的书签可以重叠并跨越任何范围。要创建有效的书签,您需要同时调用startBookmark(java.lang.String)endBookmark(java.lang.String)与相同bookmarkName范围。

保存文档时,格式错误的书签或重名的书签将被忽略。

参数:

范围类型描述
bookmarkNamejava.lang.String书签名称。

退货: BookmarkStart 刚刚创建的书签起始节点。

startColumnBookmark(String bookmarkName)

public BookmarkStart startColumnBookmark(String bookmarkName)

将文档中的当前位置标记为列书签开始。该位置必须在表格单元格中。

列书签覆盖一系列行中的一个或多个列。要创建有效的书签,您需要同时调用startColumnBookmark(java.lang.String)endColumnBookmark(java.lang.String)与相同bookmarkName范围。

保存文档时,格式错误的书签或重名的书签将被忽略。

插入的实际位置BookmarkStart节点可能与当前文档生成器位置不同。

参数:

范围类型描述
bookmarkNamejava.lang.String书签名称。

退货: BookmarkStart 刚刚创建的书签起始节点。

startEditableRange()

public EditableRangeStart startEditableRange()

将文档中的当前位置标记为可编辑范围的起点。

文档中的可编辑范围可以重叠和跨越任何范围。要创建有效的可编辑范围,您需要同时调用startEditableRange()endEditableRange()或者endEditableRange(com.aspose.words.EditableRangeStart)方法。

保存文档时将忽略格式错误的可编辑范围。

退货: EditableRangeStart - 刚刚创建的可编辑范围起始节点。

startTable()

public Table startTable()

在文档中开始一个表格。

下一个要调用的方法是insertCell().

当在单元格内调用时,此方法会启动一个嵌套表格。

退货: Table - 刚刚创建的表节点。

toString()

public String toString()

退货: java.lang.字符串

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

参数:

范围类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

参数:

范围类型描述
arg0long
arg1int

write(String text)

public void write(String text)

在文档的当前插入位置插入一个字符串。指定的当前字体格式getFont()财产被使用。

参数:

范围类型描述
textjava.lang.String要插入到文档中的字符串。

writeln()

public void writeln()

在文档中插入段落分隔符。

来电insertParagraph().

writeln(String text)

public void writeln(String text)

在文档中插入一个字符串和一个段落分隔符。指定的当前字体和段落格式getFont()getParagraphFormat()使用属性。

参数:

范围类型描述
textjava.lang.String要插入到文档中的字符串。