Document
Inheritance: java.lang.Object, com.aspose.note.Node, com.aspose.note.CompositeNodeBase, com.aspose.note.CompositeNode
All Implemented Interfaces: com.aspose.note.INotebookChildNode
public class Document extends CompositeNode<Page> implements INotebookChildNode
表示 Aspose.Note 文档。
构造函数
| 构造函数 | 描述 |
|---|---|
| Document() | 初始化 Document 类的新实例。 |
| Document(String filePath) | 初始化 Document 类的新实例。 |
| Document(String filePath, LoadOptions loadOptions) | 初始化 Document 类的新实例。 |
| Document(InputStream inStream) | 初始化 Document 类的新实例。 |
| Document(InputStream inStream, LoadOptions loadOptions) | 初始化 Document 类的新实例。 |
方法
Document()
public Document()
初始化 Document 类的新实例。创建一个空的 OneNote 文档。
Document(String filePath)
public Document(String filePath)
初始化 Document 类的新实例。从文件打开现有的 OneNote 文档。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| filePath | java.lang.String | 文件路径。 |
Document(String filePath, LoadOptions loadOptions)
public Document(String filePath, LoadOptions loadOptions)
初始化 Document 类的新实例。从文件打开现有的 OneNote 文档。允许指定额外选项,例如加密密码。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| filePath | java.lang.String | 文件路径。 |
| loadOptions | LoadOptions | 用于加载文档的选项。可以为 null。 |
Document(InputStream inStream)
public Document(InputStream inStream)
初始化 Document 类的新实例。从流中打开现有的 OneNote 文档。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| inStream | java.io.InputStream | 流。 |
Document(InputStream inStream, LoadOptions loadOptions)
public Document(InputStream inStream, LoadOptions loadOptions)
初始化 Document 类的新实例。从流中打开现有的 OneNote 文档。允许指定额外选项,例如加密密码。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| inStream | java.io.InputStream | 流。 |
| loadOptions | LoadOptions | 用于加载文档的选项。可以为 null。 |
accept(DocumentVisitor visitor)
public void accept(DocumentVisitor visitor)
接受节点的访问者。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| visitor | DocumentVisitor | 从 DocumentVisitor 派生的类的对象。 |
detectLayoutChanges()
public void detectLayoutChanges()
检测自上一次 DetectLayoutChanges 调用以来对文档布局所做的所有更改。如果 AutomaticLayoutChangesDetectionEnabled 设置为 true,则在文档导出开始时自动使用。
getAutomaticLayoutChangesDetectionEnabled()
public boolean getAutomaticLayoutChangesDetectionEnabled()
获取一个值,指示 Aspose.Note 是否自动执行布局更改检测。默认值为 true。
Returns: boolean
getColor()
public Color getColor()
获取颜色。
Returns: java.awt.Color
getCreationTime()
public Date getCreationTime()
获取创建时间。
Returns: java.util.Date
getDisplayName()
public String getDisplayName()
获取显示名称。
Returns: java.lang.String
getFileFormat()
public int getFileFormat()
获取文件格式(OneNote 2010,OneNote Online)。
Returns: int
getGuid()
public UUID getGuid()
获取对象的全局唯一标识符。
Returns: java.util.UUID
getGuidInternal()
public System.Guid getGuidInternal()
Returns: com.aspose.ms.System.Guid
getPageHistory(Page page)
public PageHistory getPageHistory(Page page)
获取包含文档中每页完整历史的 PageHistory(最早的位于索引 0)。当前页面修订可通过 PageHistory.current 访问,并与历史版本集合分开存储。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| page | Page | 页面的当前修订。 |
Returns:
PageHistory - The PageHistory.
isEncrypted(InputStream stream, Document[] document)
public static boolean isEncrypted(InputStream stream, Document[] document)
检查来自流的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.InputStream | 流。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
isEncrypted(InputStream stream, LoadOptions options, Document[] document)
public static boolean isEncrypted(InputStream stream, LoadOptions options, Document[] document)
检查来自流的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.InputStream | 流。 |
| options | LoadOptions | 加载选项。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
isEncrypted(InputStream stream, String password, Document[] document)
public static boolean isEncrypted(InputStream stream, String password, Document[] document)
检查来自流的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.InputStream | 流。 |
| password | java.lang.String | 用于解密文档的密码。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
isEncrypted(String filePath, Document[] document)
public static boolean isEncrypted(String filePath, Document[] document)
检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| filePath | java.lang.String | 文件路径。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
isEncrypted(String filePath, LoadOptions options, Document[] document)
public static boolean isEncrypted(String filePath, LoadOptions options, Document[] document)
检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| filePath | java.lang.String | 文件路径。 |
| options | LoadOptions | 加载选项。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
isEncrypted(String filePath, String password, Document[] document)
public static boolean isEncrypted(String filePath, String password, Document[] document)
检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| filePath | java.lang.String | 文件路径。 |
| password | java.lang.String | 用于解密文档的密码。 |
| document | Document[] | 已加载的文档。 |
Returns: boolean - 如果文档已加密则返回 true,否则返回 false。
print()
public void print()
使用默认打印机打印文档。
print(PrintOptions options)
public void print(PrintOptions options)
使用默认打印机打印文档。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| options | PrintOptions | 用于打印文档的选项。可以为 null。 |
print(String printerName)
public void print(String printerName)
使用默认打印机打印文档。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| printerName | java.lang.String |
print(AttributeSet printSettings)
public void print(AttributeSet printSettings)
使用默认打印机打印文档。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| printSettings | javax.print.attribute.AttributeSet |
save(OutputStream stream)
public void save(OutputStream stream)
将 OneNote 文档保存到流中。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.OutputStream | 该 System.iO.stream 用于保存文档。 |
save(OutputStream stream, SaveOptions options)
public void save(OutputStream stream, SaveOptions options)
使用指定的保存选项将 OneNote 文档保存到流中。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.OutputStream | 该 System.iO.stream 用于保存文档。 |
| options | SaveOptions | 指定文档在流中保存的选项。 |
save(OutputStream stream, int format)
public void save(OutputStream stream, int format)
以指定格式将 OneNote 文档保存到流中。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 流 | java.io.OutputStream | 该 System.iO.stream 用于保存文档。 |
| format | int | 保存文档的格式。 |
save(String fileName)
public void save(String fileName)
将 OneNote 文档保存到文件。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String | 文件的完整名称。如果具有指定完整名称的文件已存在,则会覆盖现有文件。 |
save(String fileName, SaveOptions options)
public void save(String fileName, SaveOptions options)
使用指定的保存选项将 OneNote 文档保存到文件。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String | 文件的完整名称。如果具有指定完整名称的文件已存在,则会覆盖现有文件。 |
| options | SaveOptions | 指定文档在文件中保存的选项。 |
save(String fileName, int format)
public void save(String fileName, int format)
以指定格式将 OneNote 文档保存到文件。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 文件名 | java.lang.String | 文件的完整名称。如果具有指定完整名称的文件已存在,则会覆盖现有文件。 |
| format | int | 保存文档的格式。 |
setAutomaticLayoutChangesDetectionEnabled(boolean value)
public void setAutomaticLayoutChangesDetectionEnabled(boolean value)
设置一个值,指示 Aspose.Note 是否自动执行布局更改检测。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | boolean | 新值。可以为 null。 |
setColor(Color value)
public void setColor(Color value)
设置颜色。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.awt.Color | 颜色的值。 |
setCreationTime(Date value)
public void setCreationTime(Date value)
设置创建时间。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.util.Date | DateTime 的值。 |
setDisplayName(String value)
public void setDisplayName(String value)
设置显示名称。
Parameters:
| 参数 | 类型 | 描述 |
|---|---|---|
| 值 | java.lang.String | DateTime 的值。 |