public class Document extends CompositeNode<Page> implements INotebookChildNode
Represents an Aspose.Note document.
Constructor and Description |
---|
Document()
Initializes a new instance of the
Document class. |
Document(InputStream inStream)
Initializes a new instance of the
Document class. |
Document(InputStream inStream,
LoadOptions loadOptions)
Initializes a new instance of the
Document class. |
Document(String filePath)
Initializes a new instance of the
Document class. |
Document(String filePath,
LoadOptions loadOptions)
Initializes a new instance of the
Document class. |
Modifier and Type | Method and Description |
---|---|
void |
accept(DocumentVisitor visitor)
Accepts the visitor of the node.
|
void |
detectLayoutChanges()
Detects all changes made to the document layout since the previous
DetectLayoutChanges call. |
boolean |
getAutomaticLayoutChangesDetectionEnabled()
Gets or sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
|
Color |
getColor()
Gets or sets the color.
|
Date |
getCreationTime()
Gets or sets the creation time.
|
String |
getDisplayName()
Gets or sets the display name.
|
int |
getFileFormat()
Gets file format (OneNote 2010, OneNote Online).
|
UUID |
getGuid()
Gets the object's globally unique id.
|
Guid |
getGuidInternal() |
PageHistory |
getPageHistory(Page page)
Gets the
PageHistory which contains full history for each page presented in a document (the earliest at index 0). |
void |
print()
Prints the document using the default printer.
|
void |
print(AttributeSet printSettings)
Prints the document using the default printer.
|
void |
print(PrintOptions options)
Prints the document using the default printer.
|
void |
print(String printerName)
Prints the document using the default printer.
|
void |
save(OutputStream stream)
Saves the OneNote document to a stream.
|
void |
save(OutputStream stream,
int format)
Saves the OneNote document to a stream in the specified format.
|
void |
save(OutputStream stream,
SaveOptions options)
Saves the OneNote document to a stream using the specified save options.
|
void |
save(String fileName)
Saves the OneNote document to a file.
|
void |
save(String fileName,
int format)
Saves the OneNote document to a file in the specified format.
|
void |
save(String fileName,
SaveOptions options)
Saves the OneNote document to a file using the specified save options.
|
void |
setAutomaticLayoutChangesDetectionEnabled(boolean value)
Gets or sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
|
void |
setColor(Color value)
Gets or sets the color.
|
void |
setCreationTime(Date value)
Gets or sets the creation time.
|
void |
setDisplayName(String value)
Gets or sets the display name.
|
appendChild, getChildNodes, getChildren, getFirstChild, getLastChild, getText, isComposite, iterator, removeChild
getDocument, getNextSibling, getNodeType, getParentNode, getPreviousSibling
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public Document()
Initializes a new instance of the Document
class.
Creates a blank OneNote document.
public Document(String filePath)
Initializes a new instance of the Document
class.
Opens an existing OneNote document from a file.
filePath
- The file path.UnsupportedFileFormatException
- The document format is not recognized or not supported.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.IncorrectPasswordException
- The document is encrypted and requires a password to open, but you supplied an incorrect password.com.aspose.ms.System.InvalidOperationException
- There is a problem with the document and it should be reported to Aspose.Note developers.IOException
- There is an input/output exception.public Document(String filePath, LoadOptions loadOptions)
Initializes a new instance of the Document
class.
Opens an existing OneNote document from a file. Allows to specify additional options such as an encryption password.
filePath
- The file path.loadOptions
- Options used to load a document. Can be null.UnsupportedFileFormatException
- The document format is not recognized or not supported.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.IncorrectPasswordException
- The document is encrypted and requires a password to open, but you supplied an incorrect password.com.aspose.ms.System.InvalidOperationException
- There is a problem with the document and it should be reported to Aspose.Note developers.IOException
- There is an input/output exception.public Document(InputStream inStream)
Initializes a new instance of the Document
class.
Opens an existing OneNote document from a stream.
inStream
- The stream.UnsupportedFileFormatException
- The document format is not recognized or not supported.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.IncorrectPasswordException
- The document is encrypted and requires a password to open, but you supplied an incorrect password.com.aspose.ms.System.InvalidOperationException
- There is a problem with the document and it should be reported to Aspose.Note developers.IOException
- There is an input/output exception.com.aspose.ms.System.ArgumentException
- The stream does not support reading, is null, or is already closed.public Document(InputStream inStream, LoadOptions loadOptions)
Initializes a new instance of the Document
class.
Opens an existing OneNote document from a stream. Allows to specify additional options such as an encryption password.
inStream
- The stream.loadOptions
- Options used to load a document. Can be null.UnsupportedFileFormatException
- The document format is not recognized or not supported.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.IncorrectPasswordException
- The document is encrypted and requires a password to open, but you supplied an incorrect password.com.aspose.ms.System.InvalidOperationException
- There is a problem with the document and it should be reported to Aspose.Note developers.IOException
- There is an input/output exception.com.aspose.ms.System.ArgumentException
- The stream does not support reading, is null, or is already closed.public boolean getAutomaticLayoutChangesDetectionEnabled()
Gets or sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
Default value is true
.
public void setAutomaticLayoutChangesDetectionEnabled(boolean value)
Gets or sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
Default value is true
.
public Date getCreationTime()
Gets or sets the creation time.
public void setCreationTime(Date value)
Gets or sets the creation time.
public Color getColor()
Gets or sets the color.
getColor
in interface INotebookChildNode
public void setColor(Color value)
Gets or sets the color.
public String getDisplayName()
Gets or sets the display name.
getDisplayName
in interface INotebookChildNode
public void setDisplayName(String value)
Gets or sets the display name.
public UUID getGuid()
Gets the object's globally unique id.
Value: The GUID.getGuid
in interface INotebookChildNode
public Guid getGuidInternal()
getGuidInternal
in interface INotebookChildNode
public int getFileFormat()
Gets file format (OneNote 2010, OneNote Online).
public void accept(DocumentVisitor visitor)
Accepts the visitor of the node.
accept
in interface INode
accept
in class CompositeNode<Page>
visitor
- The object of a class derived from the DocumentVisitor
.public PageHistory getPageHistory(Page page)
Gets the PageHistory
which contains full history for each page presented in a document (the earliest at index 0).
The current page revision can be accessed as PageHistory.current
and contained separately from collection of historical versions.
page
- The current revision of a page.PageHistory
.public void save(String fileName) throws IOException
Saves the OneNote document to a file.
fileName
- The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void save(OutputStream stream) throws IOException
Saves the OneNote document to a stream.
stream
- The System.iO.stream where the document will be saved.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void save(String fileName, int format) throws IOException
Saves the OneNote document to a file in the specified format.
fileName
- The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.format
- The format in which to save the document.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void save(OutputStream stream, int format) throws IOException
Saves the OneNote document to a stream in the specified format.
stream
- The System.iO.stream where the document will be saved.format
- The format in which to save the document.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void save(String fileName, SaveOptions options) throws IOException
Saves the OneNote document to a file using the specified save options.
fileName
- The full name for the file. If a file with the specified full name already exists, the existing file is overwritten.options
- Specifies the options how the document is saved in file.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void save(OutputStream stream, SaveOptions options) throws IOException
Saves the OneNote document to a stream using the specified save options.
stream
- The System.iO.stream where the document will be saved.options
- Specifies the options how the document is saved in stream.IncorrectDocumentStructureException
- The document structure violates specification.UnsupportedSaveFormatException
- Requested save format is not supported.IOException
public void print() throws PrintException
Prints the document using the default printer.
PrintException
public void print(String printerName) throws PrintException
Prints the document using the default printer.
PrintException
public void print(AttributeSet printSettings) throws PrintException
Prints the document using the default printer.
PrintException
public void print(PrintOptions options) throws PrintException
Prints the document using the default printer.
options
- Options used to print a document. Can be null.PrintException
public void detectLayoutChanges()
Detects all changes made to the document layout since the previous DetectLayoutChanges
call.
In case AutomaticLayoutChangesDetectionEnabled
set to true, used automatically in the beginning of document export.
Copyright (c) 2017 Aspose. All Rights Reserved.