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 a value indicating whether Aspose.Note performs detection of layout changes automatically.
|
Color |
getColor()
Gets the color.
|
Date |
getCreationTime()
Gets the creation time.
|
String |
getDisplayName()
Gets the display name.
|
int |
getFileFormat()
Gets file format (OneNote 2010, OneNote Online).
|
UUID |
getGuid()
Gets the object's globally unique id.
|
com.aspose.ms.System.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)
Sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
|
void |
setColor(Color value)
Sets the color.
|
void |
setCreationTime(Date value)
Sets the creation time.
|
void |
setDisplayName(String value)
Sets the display name.
|
appendChildFirst, appendChildLast, getChildNodes, getChildren, getFirstChild, getLastChild, getText, insertChild, insertChildrenRange, insertChildrenRange, 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.com.aspose.note.infrastructure.UnsupportedFileFormatException
- The document format is not recognized or not supported.com.aspose.note.infrastructure.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.UnsupportedFileFormatException
- The document format is not recognized or not supported.com.aspose.note.infrastructure.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.UnsupportedFileFormatException
- The document format is not recognized or not supported.com.aspose.note.infrastructure.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.UnsupportedFileFormatException
- The document format is not recognized or not supported.com.aspose.note.infrastructure.FileCorruptedException
- The document appears to be corrupted and cannot be loaded.com.aspose.note.infrastructure.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 a value indicating whether Aspose.Note performs detection of layout changes automatically.
Default value is true
.
public void setAutomaticLayoutChangesDetectionEnabled(boolean value)
Sets a value indicating whether Aspose.Note performs detection of layout changes automatically.
value
- New value. Can be null.
public Date getCreationTime()
Gets the creation time.
public void setCreationTime(Date value)
Sets the creation time.
value
- DateTime's value.
public Color getColor()
Gets the color.
getColor
in interface INotebookChildNode
public void setColor(Color value)
Sets the color.
value
- Color's value.
public String getDisplayName()
Gets the display name.
getDisplayName
in interface INotebookChildNode
public void setDisplayName(String value)
Sets the display name.
value
- DateTime's value.
public UUID getGuid()
Gets the object's globally unique id.
getGuid
in interface INotebookChildNode
public com.aspose.ms.System.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.com.aspose.note.infrastructure.IncorrectDocumentStructureException
- The document structure violates specification.com.aspose.note.infrastructure.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.