public interface IDocument
extends com.aspose.ms.System.IDisposable
interface representing PDF document
Modifier and Type | Method and Description |
---|---|
void |
changePasswords(String ownerPassword,
String newUserPassword,
String newOwnerPassword)
Changes document passwords.
|
boolean |
convert(OutputStream outputLogStream,
int format,
int action) |
boolean |
convert(String outputLogFileName,
int format,
int action)
Convert document and save errors into the specified file.
|
boolean |
convert(com.aspose.ms.System.Xml.XmlTextWriter xml,
int format,
boolean onlyValidation,
int action)
Convert the PDF Document and log results.
|
boolean |
convertInternal(com.aspose.ms.System.IO.Stream outputLogStream,
int format,
int action)
Convert document and save errors into the specified stream.
|
void |
decrypt()
Decrypts the document.
|
void |
dispose()
Closes all resources used by this document.
|
void |
encrypt(String userPassword,
String ownerPassword,
int permissions,
int cryptoAlgorithm)
Encrypts the document.
|
void |
exportAnnotationsToXfdf(String fileName)
Exports all document annotations to XFDF file
|
void |
flatten()
Removes all fields from the document and place their values instead.
|
void |
freeMemory()
Clears memory
|
DocumentActionCollection |
getActions()
Gets document actions.
|
Color |
getBackground()
Gets the background color of the document.
|
boolean |
getCenterWindow()
Gets flag specifying whether position of the document's window will be
centerd on the screen.
|
Collection |
getCollection()
Gets collection of document.
|
int |
getCryptoAlgorithm()
Gets security settings if document is encrypted.
|
Copier |
getDefaultCopier()
Returns copier used for coping pages to this document.
|
int |
getDirection()
Gets reading order of text: L2R (left to right) or R2L (right to left).
|
boolean |
getDisplayDocTitle()
Gets flag specifying whether document's window title bar should display
document title.
|
EmbeddedFileCollection |
getEmbeddedFiles()
Gets collection of files embedded to document.
|
com.aspose.pdf.engine.IPdfDocument |
getEngineDoc()
Instance of IPdfDocument used to access to internal document structure.
|
String |
getFileName()
Name of the PDF file that caused this document
|
boolean |
getFitWindow()
Gets flag specifying whether document window must be resized to fit the
first displayed page.
|
int |
getFontReplaceBehavior()
Gets the TextEditOptions.FontReplace
|
Form |
getForm()
Gets Acro Form of the document.
|
boolean |
getHideMenubar()
Gets flag specifying whether menu bar should be hidden when document is
active.
|
boolean |
getHideToolBar()
Gets flag specifying whether toolbar should be hidden when document is
active.
|
boolean |
getHideWindowUI()
Gets or sets flag specifying whether user interface elements should be
hidden when document is active.
|
Id |
getId()
Gets the ID.
|
DocumentInfo |
getInfo()
Gets document info.
|
RootElement |
getLogicalStructure()
Gets logical structure of the document.
|
Metadata |
getMetadata()
Document metadata.
|
com.aspose.pdf.engine.data.types.IPdfStreamAccessor |
getMetadataStream()
Returns raw metadata stream
|
int |
getNonFullScreenPageMode()
Gets page mode, specifying how to display the document on exiting
full-screen mode.
|
IAppointment |
getOpenAction()
Gets action performed at document opening.
|
boolean |
getOptimizeSize()
Gets optimization flag.
|
OutlineCollection |
getOutlines()
Gets document outlines.
|
PageInfo |
getPageInfo()
Gets the page info.(for generator only)
|
int |
getPageLayout()
Gets page layout which shall be used when the document is opened.
|
int |
getPageMode()
Gets page mode, specifying how document should be displayed when opened.
|
PageCollection |
getPages()
Gets collection of document pages.
|
int |
getPermissions()
Gets permissions of the document.
|
String |
getVersion()
Gets a version of Pdf from Pdf file header.
|
void |
importAnnotationsFromXfdf(String fileName)
Imports annotations from XFDF file to document.
|
boolean |
isEncrypted()
Gets encrypted status of the document.
|
boolean |
isLinearized()
Gets or sets a value indicating whether document is linearized.
|
void |
optimize()
Linearize document in order to - open the first page as quickly as
possible; - display next page or follow by link to the next page as
quickly as possible; - display the page incrementally as it arrives when
data for a page is delivered over a slow channel (display the most useful
data first); - permit user interaction, such as following a link, to be
performed even before the entire page has been received and displayed.
|
void |
optimizeResources()
Optimize resources in the document: 1.
|
void |
removeMetadata()
Removes metadata from the document.
|
void |
resumeUpdate() |
void |
save()
Save document incrementally (i.e.
|
void |
save(com.aspose.ms.System.IO.FileStream output) |
void |
save(OutputStream output)
Stores document into stream.
|
void |
save(OutputStream outputStream,
int format) |
void |
save(OutputStream outputStream,
SaveOptions options) |
void |
save(String outputFileName)
Saves document into the specified file.
|
void |
save(String outputFileName,
SaveOptions options)
Saves the document with a new name setting its save options.
|
void |
saveInternal(com.aspose.ms.System.IO.Stream output)
Stores document into stream.
|
void |
sendTo(DocumentDevice device,
int fromPage,
int toPage,
OutputStream output)
Sends the certain pages of the document to the document device for
processing.
|
void |
sendTo(DocumentDevice device,
int fromPage,
int toPage,
String outputFileName)
Sends the whole document to the document device for processing.
|
void |
sendTo(DocumentDevice device,
OutputStream output) |
void |
sendTo(DocumentDevice device,
String outputFileName)
Sends the whole document to the document device for processing.
|
void |
setBackground(Color value)
Sets the background color of the document.
|
void |
setCenterWindow(boolean value)
Sets flag specifying whether position of the document's window will be
centerd on the screen.
|
void |
setCollection(Collection value) |
void |
setDirection(int value)
Sets reading order of text: L2R (left to right) or R2L (right to left).
|
void |
setDisplayDocTitle(boolean value)
Sets flag specifying whether document's window title bar should display
document title.
|
void |
setFitWindow(boolean value)
Sets flag specifying whether document window must be resized to fit the
first displayed page.
|
void |
setFontReplaceBehavior(int value)
Sets the TextEditOptions.FontReplace
|
void |
setHideMenubar(boolean value)
Sets flag specifying whether menu bar should be hidden when document is
active.
|
void |
setHideToolBar(boolean value)
Set flag specifying whether toolbar should be hidden when document is
active.
|
void |
setHideWindowUI(boolean value)
Sets flag specifying whether user interface elements should be hidden
when document is active.
|
void |
setLinearized(boolean value) |
void |
setNonFullScreenPageMode(int value)
Sets page mode, specifying how to display the document on exiting
full-screen mode.
|
void |
setOpenAction(IAppointment value)
Sets action performed at document opening.
|
void |
setOptimizeSize(boolean value)
Sets optimization flag.
|
void |
setPageInfo(PageInfo value)
Sets the page info.(for generator only)
|
void |
setPageLayout(int value)
Sets page layout which shall be used when the document is opened.
|
void |
setPageMode(int value)
Sets page mode, specifying how document should be displayed when opened.
|
void |
suppressUpdate() |
void |
updatePages() |
boolean |
validate(String outputLogFileName,
int format)
Validate document into the specified file.
|
Collection getCollection()
Gets collection of document.
void setCollection(Collection value)
com.aspose.pdf.engine.IPdfDocument getEngineDoc()
Instance of IPdfDocument used to access to internal document structure. Internal only
String getVersion()
Gets a version of Pdf from Pdf file header.
IAppointment getOpenAction()
Gets action performed at document opening.
Example demonstrates how to get CenterWindow flag:Document document = new Document("sample.pdf"); IAppointment value = document.getOpenAction();
void setOpenAction(IAppointment value)
Sets action performed at document opening.
boolean getOptimizeSize()
void setOptimizeSize(boolean value)
boolean getHideToolBar()
Gets flag specifying whether toolbar should be hidden when document is active.
Example demonstrates how to get HideToolBar flag:Document document = new Document("sample.pdf"); booleanvalue = document.getHideToolBar();
void setHideToolBar(boolean value)
Set flag specifying whether toolbar should be hidden when document is active.
boolean getHideMenubar()
Gets flag specifying whether menu bar should be hidden when document is active.
Example demonstrates how to get HideMenubar flag:Document document = new Document("sample.pdf"); booleanvalue = document.getHideMenubar();
void setHideMenubar(boolean value)
Sets flag specifying whether menu bar should be hidden when document is active.
boolean getHideWindowUI()
Gets or sets flag specifying whether user interface elements should be hidden when document is active.
Example demonstrates how to get HideWindowUI flag:Document document = new Document("sample.pdf"); booleanvalue = document.getHideWindowUI();
void setHideWindowUI(boolean value)
Sets flag specifying whether user interface elements should be hidden when document is active.
boolean getFitWindow()
Gets flag specifying whether document window must be resized to fit the first displayed page.
Example demonstrates how to get FitWindow flag:Document document = new Document("sample.pdf"); booleanvalue = document.getFitWindow();
void setFitWindow(boolean value)
Sets flag specifying whether document window must be resized to fit the first displayed page.
boolean getCenterWindow()
Gets flag specifying whether position of the document's window will be centerd on the screen.
Example demonstrates how to get CenterWindow flag:Document document = new Document("sample.pdf"); booleanvalue = document.getCenterWindow();
void setCenterWindow(boolean value)
Sets flag specifying whether position of the document's window will be centerd on the screen.
boolean getDisplayDocTitle()
Gets flag specifying whether document's window title bar should display document title.
Example demonstrates how to get DisplayDocTitle flag:Document document = new Document("sample.pdf"); booleanvalue = document.getDisplayDocTitle();
void setDisplayDocTitle(boolean value)
Sets flag specifying whether document's window title bar should display document title.
PageCollection getPages()
Gets collection of document pages. Note that pages are numbered from 1 in collection.
Example below demonstrates how to operate with the document pages: How to obtain number of pages and how to obtain rectangle of starting page of the document.Document document = new Document("sample.pdf"); Pages pages = document.getPages(); System.out.println("Document contains " + pages.size()); Page page = pages.get_Item(1); Rectangle rect = page.getRect();
OutlineCollection getOutlines()
Gets document outlines.
DocumentActionCollection getActions()
Gets document actions. This property is instance of DocumentActions class which allows to get/set BeforClosing, BeforSaving, etc. actions.
This example demonstrates how to obtain after open action of the document:Document document = new Document("PdfWithOpenAction.pdf"); DocumentActions actions = document.getActions(); com.aspose.pdf.Action afterSavingAction = actions.getAfterSaving();
Form getForm()
Gets Acro Form of the document.
EmbeddedFileCollection getEmbeddedFiles()
Gets collection of files embedded to document.
int getDirection()
Gets reading order of text: L2R (left to right) or R2L (right to left).
void setDirection(int value)
Sets reading order of text: L2R (left to right) or R2L (right to left).
int getPageMode()
Gets page mode, specifying how document should be displayed when opened.
void setPageMode(int value)
Sets page mode, specifying how document should be displayed when opened.
int getNonFullScreenPageMode()
Gets page mode, specifying how to display the document on exiting full-screen mode.
void setNonFullScreenPageMode(int value)
Sets page mode, specifying how to display the document on exiting full-screen mode.
int getPageLayout()
Gets page layout which shall be used when the document is opened.
void setPageLayout(int value)
Sets page layout which shall be used when the document is opened.
String getFileName()
Name of the PDF file that caused this document
PageInfo getPageInfo()
void setPageInfo(PageInfo value)
int getFontReplaceBehavior()
void setFontReplaceBehavior(int value)
DocumentInfo getInfo()
Gets document info.
Metadata getMetadata()
Document metadata. (A PDF document may include general information, such as the document�s title, author, and creation and modification dates. Such global information about the document (as opposed to its content or structure) is called metadata and is intended to assist in cataloguing and searching for documents in external databases.)
RootElement getLogicalStructure()
Gets logical structure of the document.
void saveInternal(com.aspose.ms.System.IO.Stream output)
Stores document into stream.
output
- Stream where document shell be stored.void save(OutputStream output)
Stores document into stream.
output
- Stream where document shell be stored.void save(String outputFileName)
Saves document into the specified file.
outputFileName
- Path to file where the document will be stored.void save(com.aspose.ms.System.IO.FileStream output)
void exportAnnotationsToXfdf(String fileName)
Exports all document annotations to XFDF file
fileName
- XFDF file namevoid sendTo(DocumentDevice device, OutputStream output)
void sendTo(DocumentDevice device, int fromPage, int toPage, OutputStream output)
Sends the certain pages of the document to the document device for processing.
device
- Document device which is used to process the document.fromPage
- The first page for processing.toPage
- The last page for processing.output
- Output stream contains the results of the document pages
processing with given device.void sendTo(DocumentDevice device, String outputFileName)
Sends the whole document to the document device for processing.
device
- Document device which is used to process the document.outputFileName
- Output file name with the results of processing.void sendTo(DocumentDevice device, int fromPage, int toPage, String outputFileName)
Sends the whole document to the document device for processing.
device
- Document device which is used to process the document.fromPage
- The first page for processing.toPage
- The last page for processing.outputFileName
- Output file name with the results of processing.void removeMetadata()
Removes metadata from the document.
void importAnnotationsFromXfdf(String fileName)
Imports annotations from XFDF file to document.
fileName
- XFDF file nameboolean validate(String outputLogFileName, int format)
Validate document into the specified file.
outputLogFileName
- Path to file where the comments will be stored.format
- Pdf format.Exception
boolean convert(String outputLogFileName, int format, int action)
Convert document and save errors into the specified file.
outputLogFileName
- Path to file where the comments will be stored.format
- Pdf format.action
- Action for objects that can not be convertedException
boolean convert(com.aspose.ms.System.Xml.XmlTextWriter xml, int format, boolean onlyValidation, int action)
xml
- The log.format
- Pdf format.onlyValidation
- Only document validation.action
- Action for objects that can not be convertedException
boolean convertInternal(com.aspose.ms.System.IO.Stream outputLogStream, int format, int action)
Convert document and save errors into the specified stream.
outputLogStream
- Stream where the comments will be stored.format
- Pdf format.action
- Action for objects that can not be convertedException
boolean convert(OutputStream outputLogStream, int format, int action)
void flatten()
Removes all fields from the document and place their values instead.
int getCryptoAlgorithm()
Gets security settings if document is encrypted. If document is not encrypted then corresponding exception will be raised in .net 1.1 or CryptoAlgorithm will be null for other .net versions.
void encrypt(String userPassword, String ownerPassword, int permissions, int cryptoAlgorithm)
Encrypts the document. Call then Save to get encrypted version of the document.
userPassword
- User password.ownerPassword
- Owner password.permissions
- Document permissions, see Permissions
for details.cryptoAlgorithm
- Cryptographic algorithm, see CryptoAlgorithm
for
details.void changePasswords(String ownerPassword, String newUserPassword, String newOwnerPassword)
Changes document passwords. This action can be done only using owner password/>.
ownerPassword
- Owner password.newUserPassword
- New user password.newOwnerPassword
- New owner password.boolean isLinearized()
Gets or sets a value indicating whether document is linearized.
void setLinearized(boolean value)
void decrypt()
Decrypts the document. Call then Save to obtain decrypted version of the document.
int getPermissions()
Gets permissions of the document.
boolean isEncrypted()
Gets encrypted status of the document. True if document is encrypted.
void optimize()
Linearize document in order to - open the first page as quickly as possible; - display next page or follow by link to the next page as quickly as possible; - display the page incrementally as it arrives when data for a page is delivered over a slow channel (display the most useful data first); - permit user interaction, such as following a link, to be performed even before the entire page has been received and displayed. Invoking this method doesn't actually saves the document. On the contrary the document only is prepared to have optimized structure, call then Save to get optimized document.
void save()
Save document incrementally (i.e. using incremental update technque).
void save(OutputStream outputStream, int format)
void save(String outputFileName, SaveOptions options)
Saves the document with a new name setting its save options.
outputFileName
- Path to file where the document will be stored.options
- Save options.void save(OutputStream outputStream, SaveOptions options)
Id getId()
Gets the ID.
com.aspose.pdf.engine.data.types.IPdfStreamAccessor getMetadataStream()
Returns raw metadata stream
void updatePages()
void suppressUpdate()
void resumeUpdate()
void dispose()
Closes all resources used by this document.
dispose
in interface com.aspose.ms.System.IDisposable
Color getBackground()
Gets the background color of the document.
void setBackground(Color value)
Sets the background color of the document.
Copier getDefaultCopier()
Returns copier used for coping pages to this document.
void optimizeResources()
Optimize resources in the document: 1. Resources which are not used on the document pages are removed; 2. Equal resources are joined into one object; 3. Unused objects are deleted.
void freeMemory()
Clears memory
Copyright © 2014 Aspose. All Rights Reserved.