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 类的新实例。

方法

方法描述
accept(DocumentVisitor visitor)接受节点的访问者。
detectLayoutChanges()检测自上一次 DetectLayoutChanges 调用以来对文档布局所做的所有更改。
getAutomaticLayoutChangesDetectionEnabled()获取指示 Aspose.Note 是否自动执行布局更改检测的值。
getColor()获取颜色。
getCreationTime()获取创建时间。
getDisplayName()获取显示名称。
getFileFormat()获取文件格式(OneNote 2010,OneNote Online)。
getGuid()获取对象的全局唯一标识符。
getGuidInternal()
getPageHistory(Page page)获取包含文档中每页完整历史的 PageHistory(最早的位于索引 0)。
isEncrypted(InputStream stream, Document[] document)检查来自流的文档是否已加密。
isEncrypted(InputStream stream, LoadOptions options, Document[] document)检查来自流的文档是否已加密。
isEncrypted(InputStream stream, String password, Document[] document)检查来自流的文档是否已加密。
isEncrypted(String filePath, Document[] document)检查来自文件的文档是否已加密。
isEncrypted(String filePath, LoadOptions options, Document[] document)检查来自文件的文档是否已加密。
isEncrypted(String filePath, String password, Document[] document)检查来自文件的文档是否已加密。
print()使用默认打印机打印文档。
print(PrintOptions options)使用默认打印机打印文档。
print(String printerName)使用默认打印机打印文档。
print(AttributeSet printSettings)使用默认打印机打印文档。
save(OutputStream stream)将 OneNote 文档保存到流中。
save(OutputStream stream, SaveOptions options)使用指定的保存选项将 OneNote 文档保存到流中。
save(OutputStream stream, int format)以指定格式将 OneNote 文档保存到流中。
save(String fileName)将 OneNote 文档保存到文件。
save(String fileName, SaveOptions options)使用指定的保存选项将 OneNote 文档保存到文件。
save(String fileName, int format)以指定格式将 OneNote 文档保存到文件。
setAutomaticLayoutChangesDetectionEnabled(boolean value)设置一个值,指示 Aspose.Note 是否自动执行布局更改检测。
setColor(Color value)设置颜色。
setCreationTime(Date value)设置创建时间。
setDisplayName(String value)设置显示名称。

Document()

public Document()

初始化 Document 类的新实例。创建一个空的 OneNote 文档。

Document(String filePath)

public Document(String filePath)

初始化 Document 类的新实例。从文件打开现有的 OneNote 文档。

Parameters:

参数类型描述
filePathjava.lang.String文件路径。

Document(String filePath, LoadOptions loadOptions)

public Document(String filePath, LoadOptions loadOptions)

初始化 Document 类的新实例。从文件打开现有的 OneNote 文档。允许指定额外选项,例如加密密码。

Parameters:

参数类型描述
filePathjava.lang.String文件路径。
loadOptionsLoadOptions用于加载文档的选项。可以为 null。

Document(InputStream inStream)

public Document(InputStream inStream)

初始化 Document 类的新实例。从流中打开现有的 OneNote 文档。

Parameters:

参数类型描述
inStreamjava.io.InputStream流。

Document(InputStream inStream, LoadOptions loadOptions)

public Document(InputStream inStream, LoadOptions loadOptions)

初始化 Document 类的新实例。从流中打开现有的 OneNote 文档。允许指定额外选项,例如加密密码。

Parameters:

参数类型描述
inStreamjava.io.InputStream流。
loadOptionsLoadOptions用于加载文档的选项。可以为 null。

accept(DocumentVisitor visitor)

public void accept(DocumentVisitor visitor)

接受节点的访问者。

Parameters:

参数类型描述
visitorDocumentVisitorDocumentVisitor 派生的类的对象。

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:

参数类型描述
pagePage页面的当前修订。

Returns: PageHistory - The PageHistory.

isEncrypted(InputStream stream, Document[] document)

public static boolean isEncrypted(InputStream stream, Document[] document)

检查来自流的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。

Parameters:

参数类型描述
java.io.InputStream流。
documentDocument[]已加载的文档。

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流。
optionsLoadOptions加载选项。
documentDocument[]已加载的文档。

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流。
passwordjava.lang.String用于解密文档的密码。
documentDocument[]已加载的文档。

Returns: boolean - 如果文档已加密则返回 true,否则返回 false。

isEncrypted(String filePath, Document[] document)

public static boolean isEncrypted(String filePath, Document[] document)

检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。

Parameters:

参数类型描述
filePathjava.lang.String文件路径。
documentDocument[]已加载的文档。

Returns: boolean - 如果文档已加密则返回 true,否则返回 false。

isEncrypted(String filePath, LoadOptions options, Document[] document)

public static boolean isEncrypted(String filePath, LoadOptions options, Document[] document)

检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。

Parameters:

参数类型描述
filePathjava.lang.String文件路径。
optionsLoadOptions加载选项。
documentDocument[]已加载的文档。

Returns: boolean - 如果文档已加密则返回 true,否则返回 false。

isEncrypted(String filePath, String password, Document[] document)

public static boolean isEncrypted(String filePath, String password, Document[] document)

检查来自文件的文档是否已加密。要进行检查,需要完整加载该文档。因此此方法可能导致性能损失。

Parameters:

参数类型描述
filePathjava.lang.String文件路径。
passwordjava.lang.String用于解密文档的密码。
documentDocument[]已加载的文档。

Returns: boolean - 如果文档已加密则返回 true,否则返回 false。

public void print()

使用默认打印机打印文档。

public void print(PrintOptions options)

使用默认打印机打印文档。

Parameters:

参数类型描述
optionsPrintOptions用于打印文档的选项。可以为 null。
public void print(String printerName)

使用默认打印机打印文档。

Parameters:

参数类型描述
printerNamejava.lang.String
public void print(AttributeSet printSettings)

使用默认打印机打印文档。

Parameters:

参数类型描述
printSettingsjavax.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 用于保存文档。
optionsSaveOptions指定文档在流中保存的选项。

save(OutputStream stream, int format)

public void save(OutputStream stream, int format)

以指定格式将 OneNote 文档保存到流中。

Parameters:

参数类型描述
java.io.OutputStream该 System.iO.stream 用于保存文档。
formatint保存文档的格式。

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文件的完整名称。如果具有指定完整名称的文件已存在,则会覆盖现有文件。
optionsSaveOptions指定文档在文件中保存的选项。

save(String fileName, int format)

public void save(String fileName, int format)

以指定格式将 OneNote 文档保存到文件。

Parameters:

参数类型描述
文件名java.lang.String文件的完整名称。如果具有指定完整名称的文件已存在,则会覆盖现有文件。
formatint保存文档的格式。

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.DateDateTime 的值。

setDisplayName(String value)

public void setDisplayName(String value)

设置显示名称。

Parameters:

参数类型描述
java.lang.StringDateTime 的值。