IDocument

public interface IDocument extends com.aspose.ms.System.IDisposable, Closeable

interface representing PDF document

Methods

MethodDescription
afterImportEnumerate all registered annotations and call AfterImport for each of them.
bindXmlBind xml to document
bindXmlBind xml to document
bindXmlBind xml/xsl to document
changePasswordsChanges document passwords.
checkValidates document.
closeCloses all resources used by this document.
convertConvert document to searchable document.
convertConvert document to searchable document and skip errors of hochr that can not be converted.
convertConvert document and save errors into the specified file.
convertConvert document and save errors into the specified file.
convertConvert document and save errors into the specified file.

This is allowing to show/hide searchable text on page. Default value is FALSE. This is allowing to get original image from pdf. Default value is FALSE.

convertConvert document and save errors into the specified file.

This is allowing to show/hide searchable text on page. Default value is FALSE. This is allowing to get original image from pdf. Default value is FALSE.

convert
convertConvert document using specified conversion options
convertConvert document and save errors into the specified file.
convertConvert document and save errors into the specified file.
convertInternalInternal method
convertWithFlattenConvert document to searchable document and skip errors of hochr that can not be converted.
convertWithSkippingErrorsConvert document to searchable document and skip errors of hochr that can not be converted.
decryptDecrypts the document.
disposeDeprecated.
encryptEncrypts the document.
encryptEncrypts the document.
encryptEncrypts the document.
exportAnnotationsToXfdfExports all document annotations to XFDF file
flattenRemoves all fields (and annotations) from the document and place their values instead.
flattenRemoves all fields from the document and place their values instead.
flattenTransparencyReplaces transparent content with non-transparent raster and vector graphics.
freeMemoryClears memory
getActionsGets document actions.
getBackgroundGets the background color of the document.
getCatalogValueReturns item value from catalog dictionary.
getCollectionGets collection of document.
getCryptoAlgorithmGets security settings if document is encrypted.
getCustomSecurityHandlerGets a custom security handler.
getDefaultCopierReturns copier used for coping pages to this document.
getDestinationsGets the collection of destinations.
getDirectionGets reading order of text: L2R (left to right) or R2L (right to left).
getDuplexGets or sets print duplex mode handling option to use when printing the file from the print dialog.
getEmbeddedFilesGets collection of files embedded to document.
getEmbedStandardFontsProperty which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true.
getEnableSignatureSanitizationGets or sets flag to manage signature fields sanitization.
getEngineDocInstance of IPdfDocument used to access to internal document structure.
getFileNameName of the PDF file that caused this document
getFormGets Acro Form of the document.
getIdGets the ID.
getIgnoreCorruptedObjectsGets or sets flag of ignoring errors in source files.
getInfoGets document info.
getLogicalStructureGets logical structure of the document.
getMetadataDocument metadata.
getMetadataStreamReturns raw metadata stream
getNamedDestinationsCollection of Named Destination in the document.
getNonFullScreenPageModeGets page mode, specifying how to display the document on exiting full-screen mode.
getObjectByIdGets a object with specified ID in the document.
getOpenActionGets action performed at document opening.
getOptimizeSizeGets optimization flag.
getOutlinesGets document outlines.
getPageInfoGets the page info.(for generator only, not filled in when reading document)
getPageLabelsGets page labels in the document.
getPageLayoutGets page layout which shall be used when the document is opened.
getPageModeGets page mode, specifying how document should be displayed when opened.
getPagesGets collection of document pages.
getPdfFormat
getPermissionsGets permissions of the document.
getPrintScalingGets print scaling handling option to use when printing the file from the print dialog.
getTaggedContentGets access to TaggedPdf content.
getVersionGets a version of Pdf from Pdf file header.
getXmpMetadataGet XMP metadata from document.
importAnnotationsFromXfdfImports annotations from XFDF file to document.
isAbsentFontTryToSubstituteNotification about missing fonts when processing documents
isCenterWindowGets flag specifying whether position of the document’s window will be centerd on the screen.
isDisableFontLicenseVerificationsMany operations with font can’t be executed if these operations are prohibited by license of this font.
isDisplayDocTitleGets flag specifying whether document’s window title bar should display document title.
isEncryptedGets encrypted status of the document.
isFitWindowGets flag specifying whether document window must be resized to fit the first displayed page.
isHideMenubarGets flag specifying whether menu bar should be hidden when document is active.
isHideToolBarGets flag specifying whether toolbar should be hidden when document is active.
isHideWindowUIGets or sets flag specifying whether user interface elements should be hidden when document is active.
isLinearizedGets or sets a value indicating whether document is linearized.
isManualDisposeEnabledBy default method save close internal streams and release memory resources. We can do some operations and continue work with the document after method save if this ManualDispose parameter is enabled.
isPdfaCompliantGets the is document pdf/a compliant.
isPdfUaCompliantGets the is document pdfua compliant.
isPickTrayByPdfSizeGets a flag specifying whether the PDF page size shall be used to select the input paper tray.
isXrefGapsAllowedGets or sets the is document pdfa compliant.
optimizeLinearize 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.
optimizeResourcesOptimize resources in the document: 1.
optimizeResourcesOptimize resources in the document according to defined optimization strategy.
pageNodesToBalancedTreeOrganizes page tree nodes in a document into a balanced tree.
pageNodesToBalancedTreeOrganizes page tree nodes in a document into a balanced tree.
processParagraphsStores document into stream.
removeMetadataRemoves metadata from the document.
removePdfaComplianceRemove pdfa compliance from the document
removePdfUaComplianceRemove pdfUa compliance from the document
repairRepairs broken document.
resumeUpdateresumeUpdate
saveSave document incrementally (i.e.
saveStores document into stream.
saveSave document
saveSaves the document with a new name setting its save options.
saveSaves document into the specified file.
saveSaves the document with a new name setting its save options.
saveIncrementallySaves incrementally the PDF Document to the specified stream.
saveIncrementallySaves incrementally the PDF Document to the specified stream.
saveIncrementallySaves incrementally the PDF Document to the specified stream.
saveXmlSave document to XML.
sendToSends the certain pages of the document to the document device for processing.
sendToSends the whole document to the document device for processing.
sendToSends the whole document to the document device for processing.
sendToSends the whole document to the document device for processing.
setAbsentFontTryToSubstituteSetting flag for set program determined font in case of absence font.
setBackgroundSets the background color of the document.
setCenterWindowSets flag specifying whether position of the document’s window will be centerd on the screen.
setCollectionSets collection of document.
setConvertMetadataAndCatalogOnlyGets convert parameter for pdf/ua converter (Convert only Metadata and Document Catalog if set true)
setDirectionSets reading order of text: L2R (left to right) or R2L (right to left).
setDisableFontLicenseVerificationsMany operations with font can’t be executed if these operations are prohibited by license of this font.
setDisplayDocTitleSets flag specifying whether document’s window title bar should display document title.
setDuplexGets or sets print duplex mode handling option to use when printing the file from the print dialog.
setEmbedStandardFontsProperty which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true.
setEnableSignatureSanitizationGets or sets flag to manage signature fields sanitization.
setFitWindowSets flag specifying whether document window must be resized to fit the first displayed page.
setHideMenubarSets flag specifying whether menu bar should be hidden when document is active.
setHideToolBarSet flag specifying whether toolbar should be hidden when document is active.
setHideWindowUISets flag specifying whether user interface elements should be hidden when document is active.
setIgnoreCorruptedObjects
setLinearizedSets a value indicating whether document is linearized.
setManualDisposeEnabledBy default method save closes internal streams and release memory resources. We can do some operations and continue work with the document after method save is called if this ManualDispose parameter is enabled. But it is strongly recommended to call the dispose method when the Document instance is no longer needed.
setNonFullScreenPageModeSets page mode, specifying how to display the document on exiting full-screen mode.
setOpenActionSets action performed at document opening.
setOptimizeSizeSets optimization flag.
setPageInfoSets the page info.(for generator only, not filled in when reading document)
setPageLayoutSets page layout which shall be used when the document is opened.
setPageModeSets page mode, specifying how document should be displayed when opened.
setPickTrayByPdfSizeSets a flag specifying whether the PDF page size shall be used to select the input paper tray.
setPrintScalingSets print scaling handling option to use when printing the file from the print dialog.
setTitleSet Title for Pdf Document
setXmpMetadataSet XMP metadata of document.
setXrefGapsAllowedGets or sets the is document pdfa compliant.
suppressUpdatesuppressUpdate
updatePagesupdatePages
validateValidate document into the specified file.
validateValidate document into the specified file.

afterImport

void afterImport()

Enumerate all registered annotations and call AfterImport for each of them.

bindXml

Bind xml to document

bindXml

Bind xml to document

bindXml

Bind xml/xsl to document

changePasswords

Changes document passwords.

check

boolean check(boolean doRepair)

Validates document.

Parameters:

ParameterTypeDescription
doRepairIf true found issues will be repaired.

Returns: boolean value

close

void close()

Closes all resources used by this document.

convert

Convert document to searchable document.

convert

Convert document to searchable document and skip errors of hochr that can not be converted.

convert

Convert document and save errors into the specified file.

convert

Convert document and save errors into the specified file.

convert

Convert document and save errors into the specified file.

This is allowing to show/hide searchable text on page. Default value is FALSE. This is allowing to get original image from pdf. Default value is FALSE.

convert

Convert document and save errors into the specified file.

This is allowing to show/hide searchable text on page. Default value is FALSE. This is allowing to get original image from pdf. Default value is FALSE.

convert

convert

Convert document using specified conversion options

convert

Convert document and save errors into the specified file.

convert

Convert document and save errors into the specified file.

convertInternal

Internal method

convertWithFlatten

Convert document to searchable document and skip errors of hochr that can not be converted.

convertWithSkippingErrors

Convert document to searchable document and skip errors of hochr that can not be converted.

decrypt

void decrypt()

Decrypts the document.

dispose

@Deprecated void dispose()

Deprecated.

encrypt

Encrypts the document.

encrypt

Encrypts the document.

encrypt

Encrypts the document.

exportAnnotationsToXfdf

Exports all document annotations to XFDF file

flatten

void flatten()

Removes all fields (and annotations) from the document and place their values instead.

flatten

Removes all fields from the document and place their values instead.

flattenTransparency

void flattenTransparency()

Replaces transparent content with non-transparent raster and vector graphics.

freeMemory

void freeMemory()

Clears memory

getActions

DocumentActionCollection getActions()

Gets document actions.

Returns: DocumentActionCollection object

getBackground

Color getBackground()

Gets the background color of the document.

Returns: java.awt.Color object

getCatalogValue

Returns item value from catalog dictionary.

getCollection

Collection getCollection()

Gets collection of document.

Returns: Collection object

getCryptoAlgorithm

CryptoAlgorithm getCryptoAlgorithm()

Gets security settings if document is encrypted.

Returns: CryptoAlgorithm element or null

getCustomSecurityHandler

com.aspose.pdf.engine.security.impl.handlers.ICustomSecurityHandler getCustomSecurityHandler()

Gets a custom security handler.

Returns: ICustomSecurityHandler instance

getDefaultCopier

Copier getDefaultCopier()

Returns copier used for coping pages to this document.

Returns: Copier object

getDestinations

DestinationCollection getDestinations()

Gets the collection of destinations.

Returns: DestinationCollection object

getDirection

Direction getDirection()

Gets reading order of text: L2R (left to right) or R2L (right to left).

Returns: Direction element

getDuplex

int getDuplex()

Gets or sets print duplex mode handling option to use when printing the file from the print dialog.

Returns: PrintDuplex element

getEmbeddedFiles

EmbeddedFileCollection getEmbeddedFiles()

Gets collection of files embedded to document.

Returns: EmbeddedFileCollection object

getEmbedStandardFonts

boolean getEmbedStandardFonts()

Property which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true.

Returns: boolean value

getEnableSignatureSanitization

boolean getEnableSignatureSanitization()

Gets or sets flag to manage signature fields sanitization.

Returns: boolean value

getEngineDoc

com.aspose.pdf.engine.IPdfDocument getEngineDoc()

Instance of IPdfDocument used to access to internal document structure.

Returns: IPdfDocument object

getFileName

String getFileName()

Name of the PDF file that caused this document

Returns: String object

getForm

Form getForm()

Gets Acro Form of the document.

Returns: Form object

getId

Id getId()

Gets the ID.

Returns: Id object

getIgnoreCorruptedObjects

boolean getIgnoreCorruptedObjects()

Gets or sets flag of ignoring errors in source files.

Returns: boolean value

getInfo

DocumentInfo getInfo()

Gets document info.

Returns: DocumentInfo object

getLogicalStructure

RootElement getLogicalStructure()

Gets logical structure of the document.

Returns: RootElement object

getMetadata

Metadata getMetadata()

Document metadata.

Returns: Metadata object

getMetadataStream

com.aspose.pdf.engine.data.types.IPdfStreamAccessor getMetadataStream()

Returns raw metadata stream

Returns: IPdfStreamAccessor object

getNamedDestinations

NamedDestinationCollection getNamedDestinations()

Collection of Named Destination in the document.

Returns: NamedDestinationCollection instance

getNonFullScreenPageMode

PageMode getNonFullScreenPageMode()

Gets page mode, specifying how to display the document on exiting full-screen mode.

Returns: PageMode element

getObjectById

Gets a object with specified ID in the document.

getOpenAction

IAppointment getOpenAction()

Gets action performed at document opening.

Returns: IAppointment object

getOptimizeSize

boolean getOptimizeSize()

Gets optimization flag.

Returns: boolean value

getOutlines

OutlineCollection getOutlines()

Gets document outlines.

Returns: OutlineCollection object

getPageInfo

PageInfo getPageInfo()

Gets the page info.(for generator only, not filled in when reading document)

Returns: The page info.

getPageLabels

PageLabelCollection getPageLabels()

Gets page labels in the document.

Returns: PageLabelCollection object

getPageLayout

PageLayout getPageLayout()

Gets page layout which shall be used when the document is opened.

Returns: PageLayout element

getPageMode

PageMode getPageMode()

Gets page mode, specifying how document should be displayed when opened.

Returns: PageMode element

getPages

PageCollection getPages()

Gets collection of document pages.

Returns: boolean value

getPdfFormat

PdfFormat getPdfFormat()

Returns: PdfFormat element

getPermissions

int getPermissions()

Gets permissions of the document.

Returns: int value

getPrintScaling

int getPrintScaling()

Gets print scaling handling option to use when printing the file from the print dialog.

Returns: PrintScaling element

getTaggedContent

ITaggedContent getTaggedContent()

Gets access to TaggedPdf content.

Returns: ITaggedContent instance

getVersion

String getVersion()

Gets a version of Pdf from Pdf file header.

Returns: String object

getXmpMetadata

Get XMP metadata from document.

importAnnotationsFromXfdf

Imports annotations from XFDF file to document.

isAbsentFontTryToSubstitute

boolean isAbsentFontTryToSubstitute()

Notification about missing fonts when processing documents

Returns: boolean value

isCenterWindow

boolean isCenterWindow()

Gets flag specifying whether position of the document’s window will be centerd on the screen.

Returns: boolean value

isDisableFontLicenseVerifications

boolean isDisableFontLicenseVerifications()

Many operations with font can’t be executed if these operations are prohibited by license of this font.

Returns: boolean value By default false.

isDisplayDocTitle

boolean isDisplayDocTitle()

Gets flag specifying whether document’s window title bar should display document title.

Returns: boolean value

isEncrypted

boolean isEncrypted()

Gets encrypted status of the document.

Returns: boolean value

isFitWindow

boolean isFitWindow()

Gets flag specifying whether document window must be resized to fit the first displayed page.

Returns: boolean value

isHideMenubar

boolean isHideMenubar()

Gets flag specifying whether menu bar should be hidden when document is active.

Returns: boolean value

isHideToolBar

boolean isHideToolBar()

Gets flag specifying whether toolbar should be hidden when document is active.

Returns: boolean value

isHideWindowUI

boolean isHideWindowUI()

Gets or sets flag specifying whether user interface elements should be hidden when document is active.

Returns: boolean value

isLinearized

boolean isLinearized()

Gets or sets a value indicating whether document is linearized.

Returns: boolean value

isManualDisposeEnabled

boolean isManualDisposeEnabled()

By default method save close internal streams and release memory resources. We can do some operations and continue work with the document after method save if this ManualDispose parameter is enabled.

Returns: boolean value. (Default value == false)

isPdfaCompliant

boolean isPdfaCompliant()

Gets the is document pdf/a compliant.

Returns: boolean value

isPdfUaCompliant

boolean isPdfUaCompliant()

Gets the is document pdfua compliant.

Returns: boolean value

isPickTrayByPdfSize

boolean isPickTrayByPdfSize()

Gets a flag specifying whether the PDF page size shall be used to select the input paper tray.

Returns: boolean value

isXrefGapsAllowed

boolean isXrefGapsAllowed()

Gets or sets the is document pdfa compliant.

Returns: boolean value

optimize

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.

optimizeResources

void optimizeResources()

Optimize resources in the document: 1.

optimizeResources

Optimize resources in the document according to defined optimization strategy.

pageNodesToBalancedTree

void pageNodesToBalancedTree()

Organizes page tree nodes in a document into a balanced tree.

pageNodesToBalancedTree

void pageNodesToBalancedTree(byte nodesNumInSubtrees)

Organizes page tree nodes in a document into a balanced tree.

Parameters:

ParameterTypeDescription
nodesNumInSubtreesDesired number of subnodes. Default value is ten.

processParagraphs

void processParagraphs()

Stores document into stream.

removeMetadata

void removeMetadata()

Removes metadata from the document.

removePdfaCompliance

void removePdfaCompliance()

Remove pdfa compliance from the document

removePdfUaCompliance

void removePdfUaCompliance()

Remove pdfUa compliance from the document

repair

void repair()

Repairs broken document.

resumeUpdate

void resumeUpdate()

resumeUpdate

save

void save()

Save document incrementally (i.e.

save

Stores document into stream.

save

Save document

save

Saves the document with a new name setting its save options.

save

Saves document into the specified file.

save

Saves the document with a new name setting its save options.

saveIncrementally

Saves incrementally the PDF Document to the specified stream.

saveIncrementally

Saves incrementally the PDF Document to the specified stream.

saveIncrementally

Saves incrementally the PDF Document to the specified stream.

saveXml

Save document to XML.

sendTo

Sends the certain pages of the document to the document device for processing.

sendTo

Sends the whole document to the document device for processing.

sendTo

Sends the whole document to the document device for processing.

sendTo

Sends the whole document to the document device for processing.

setAbsentFontTryToSubstitute

void setAbsentFontTryToSubstitute(boolean setAbsentFontTryToSubstitute)

Setting flag for set program determined font in case of absence font.

Parameters:

ParameterTypeDescription
setAbsentFontTryToSubstituteboolean value

setBackground

Sets the background color of the document.

setCenterWindow

void setCenterWindow(boolean value)

Sets flag specifying whether position of the document’s window will be centerd on the screen.

Parameters:

ParameterTypeDescription
valueboolean value

setCollection

Sets collection of document.

setConvertMetadataAndCatalogOnly

void setConvertMetadataAndCatalogOnly(boolean value)

Gets convert parameter for pdf/ua converter (Convert only Metadata and Document Catalog if set true)

Parameters:

ParameterTypeDescription
valueboolean value

setDirection

Sets reading order of text: L2R (left to right) or R2L (right to left).

setDisableFontLicenseVerifications

void setDisableFontLicenseVerifications(boolean value)

Many operations with font can’t be executed if these operations are prohibited by license of this font.

Parameters:

ParameterTypeDescription
valueboolean value By default false.

setDisplayDocTitle

void setDisplayDocTitle(boolean value)

Sets flag specifying whether document’s window title bar should display document title.

Parameters:

ParameterTypeDescription
valueboolean value

setDuplex

void setDuplex(int value)

Gets or sets print duplex mode handling option to use when printing the file from the print dialog.

Parameters:

ParameterTypeDescription
valuePrintDuplex element

setEmbedStandardFonts

void setEmbedStandardFonts(boolean value)

Property which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true.

Parameters:

ParameterTypeDescription
valueboolean value

setEnableSignatureSanitization

void setEnableSignatureSanitization(boolean value)

Gets or sets flag to manage signature fields sanitization.

Parameters:

ParameterTypeDescription
valueboolean value

setFitWindow

void setFitWindow(boolean value)

Sets flag specifying whether document window must be resized to fit the first displayed page.

Parameters:

ParameterTypeDescription
valueboolean value

setHideMenubar

void setHideMenubar(boolean value)

Sets flag specifying whether menu bar should be hidden when document is active.

Parameters:

ParameterTypeDescription
valueboolean value

setHideToolBar

void setHideToolBar(boolean value)

Set flag specifying whether toolbar should be hidden when document is active.

Parameters:

ParameterTypeDescription
valueboolean value

setHideWindowUI

void setHideWindowUI(boolean value)

Sets flag specifying whether user interface elements should be hidden when document is active.

Parameters:

ParameterTypeDescription
valueboolean value

setIgnoreCorruptedObjects

void setIgnoreCorruptedObjects(boolean value)

setLinearized

void setLinearized(boolean value)

Sets a value indicating whether document is linearized.

Parameters:

ParameterTypeDescription
valueboolean value

setManualDisposeEnabled

void setManualDisposeEnabled(boolean manualDisposeEnabled)

By default method save closes internal streams and release memory resources. We can do some operations and continue work with the document after method save is called if this ManualDispose parameter is enabled. But it is strongly recommended to call the dispose method when the Document instance is no longer needed.

Parameters:

ParameterTypeDescription
manualDisposeEnabledboolean value. (Default value == false)

setNonFullScreenPageMode

Sets page mode, specifying how to display the document on exiting full-screen mode.

setOpenAction

Sets action performed at document opening.

setOptimizeSize

void setOptimizeSize(boolean value)

Sets optimization flag.

Parameters:

ParameterTypeDescription
valueboolean value

setPageInfo

Sets the page info.(for generator only, not filled in when reading document)

setPageLayout

Sets page layout which shall be used when the document is opened.

setPageMode

Sets page mode, specifying how document should be displayed when opened.

setPickTrayByPdfSize

void setPickTrayByPdfSize(boolean value)

Sets a flag specifying whether the PDF page size shall be used to select the input paper tray.

Parameters:

ParameterTypeDescription
valueboolean value

setPrintScaling

void setPrintScaling(int value)

Sets print scaling handling option to use when printing the file from the print dialog.

Parameters:

ParameterTypeDescription
valuePrintDuplex element

setTitle

Set Title for Pdf Document

setXmpMetadata

Set XMP metadata of document.

setXrefGapsAllowed

void setXrefGapsAllowed(boolean value)

Gets or sets the is document pdfa compliant.

Parameters:

ParameterTypeDescription
valueboolean value

suppressUpdate

void suppressUpdate()

suppressUpdate

updatePages

void updatePages()

updatePages

validate

Validate document into the specified file.

validate

Validate document into the specified file.