Aspose::Pdf::Document class

Document class

Class representing PDF document.

class Document : public System::IDisposable,
                 public Aspose::Pdf::ISupportsMemoryCleanup,
                 public Aspose::Pdf::LicenseManagement::IVentureLicenseTarget

Methods

MethodDescription
BindXml(System::String)Bind xml to document.
BindXml(System::String, System::String)Bind xml/xsl to document.
BindXml(System::SharedPtr<System::IO::Stream>, System::SharedPtr<System::IO::Stream>)Bind xml/xsl to document.
BindXml(System::SharedPtr<System::IO::Stream>, System::SharedPtr<System::IO::Stream>, System::SharedPtr<System::Xml::XmlReaderSettings>)Bind xml/xsl to document.
BindXml(System::SharedPtr<System::IO::Stream>)Bind xml to document.
ChangePasswords(System::String, System::String, System::String)Changes document passwords. This action can be done only using owner password.
Check(bool)Validates document.
Convert(System::String, Aspose::Pdf::PdfFormat, ConvertErrorAction, ConvertTransparencyAction)Convert document and save errors into the specified file.
Convert(System::SharedPtr<System::IO::Stream>, Aspose::Pdf::PdfFormat, ConvertErrorAction, ConvertTransparencyAction)Convert document and save errors into the specified file.
Convert(System::String, Aspose::Pdf::PdfFormat, ConvertErrorAction)Convert document and save errors into the specified file.
Convert(System::SharedPtr<PdfFormatConversionOptions>)Convert document using specified conversion options.
Convert(Document::CallBackGetHocrWithPage, bool)Recognize images inside the document and add hocr strings over it.
Convert(Document::CallBackGetHocr, bool)Recognize images inside the document and add hocr strings over it.
Convert(System::SharedPtr<System::IO::Stream>, Aspose::Pdf::PdfFormat, ConvertErrorAction)Convert document and save errors into the specified stream.
Convert(Fixup, System::SharedPtr<System::IO::Stream>, bool, System::ArrayPtr<System::SharedPtr<System::Object>>)Convert document by applying the Fixup.
Convert(Fixup, System::String, bool, System::ArrayPtr<System::SharedPtr<System::Object>>)Convert document by applying the Fixup.
static Convert(System::String, System::SharedPtr<LoadOptions>, System::String, System::SharedPtr<SaveOptions>)Converts source file in source format into destination file in destination format.
static Convert(System::SharedPtr<System::IO::Stream>, System::SharedPtr<LoadOptions>, System::String, System::SharedPtr<SaveOptions>)Converts stream in source format into destination file in destination format.
static Convert(System::String, System::SharedPtr<LoadOptions>, System::SharedPtr<System::IO::Stream>, System::SharedPtr<SaveOptions>)Converts source file in source format into stream in destination format.
static Convert(System::SharedPtr<System::IO::Stream>, System::SharedPtr<LoadOptions>, System::SharedPtr<System::IO::Stream>, System::SharedPtr<SaveOptions>)Converts stream in source format into stream in destination format.
ConvertPageToPNGMemoryStream(System::SharedPtr<Page>)Convert page to PNG for DSR, OMR, OCR image stream.
Decrypt()Decrypts the document. Call then Save to obtain decrypted version of the document.
Dispose() overrideCloses all resources used by this document.
Document(System::SharedPtr<System::IO::Stream>)Initialize new Document instance from the input stream.
Document(System::SharedPtr<System::IO::Stream>, bool)Initialize new Document instance from the input stream.
Document(System::SharedPtr<System::IO::Stream>, System::String)Initialize new Document instance from the input stream.
Document(System::SharedPtr<System::IO::Stream>, System::String, bool)Initialize new Document instance from the input stream.
Document(System::String)Just init Document using filename . The same as Document(Stream).
Document(System::String, bool)Just init Document using filename . The same as Document(Stream).
Document(System::String, System::String)Initializes new instance of the Document class for working with encrypted document.
Document(System::String, System::String, bool)Initializes new instance of the Document class for working with encrypted document.
Document()Initializes empty document.
Document(PdfVersion)Initializes empty document by version.
Document(System::String, System::SharedPtr<LoadOptions>)Opens an existing document from a file providing necessary converting options to get pdf document.
Document(System::SharedPtr<System::IO::Stream>, System::SharedPtr<LoadOptions>)Opens an existing document from a stream providing necessary converting to get pdf document.
Encrypt(System::String, System::String, System::SharedPtr<Facades::DocumentPrivilege>, Aspose::Pdf::CryptoAlgorithm, bool)Encrypts the document. Call then Save to get encrypted version of the document.
Encrypt(System::String, System::String, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm)Encrypts the document. Call then Save to get encrypted version of the document.
Encrypt(System::String, System::String, Aspose::Pdf::Permissions, Aspose::Pdf::CryptoAlgorithm, bool)Encrypts the document. Call then Save to get encrypted version of the document.
ExportAnnotationsToXfdf(System::String)Exports all document annotations to XFDF file.
ExportAnnotationsToXfdf(System::SharedPtr<System::IO::Stream>)Export all document annotations into stream.
Flatten()Removes all fields from the document and place their values instead.
Flatten(System::SharedPtr<Aspose::Pdf::Forms::Form::FlattenSettings>)Removes all fields (and annotations) from the document and place their values instead.
FlattenTransparency()Replaces transparent content with non-transparent raster and vector graphics.
FreeMemory() overrideClears memory.
get_Actions()Gets document actions. This property is instance of DocumentActions class which allows to get/set BeforClosing, BeforSaving, etc. actions.
get_AllowReusePageContent()Allows to merge page contents to optimize docuement size. If used then differnet but duplicated pages may reference to the same content object. Please note that this mode may cause side effects like changing page content when other page is changed.
get_Background()Gets the background color of the document.
get_CenterWindow()Gets flag specifying whether position of the document’s window will be centerd on the screen.
get_Collection()Gets collection of document.
get_CryptoAlgorithm()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.
get_Destinations()Gets the collection of destinations. Obsolete. Please use NamedDestinations.
get_Direction()Gets reading order of text: L2R (left to right) or R2L (right to left).
get_DisableFontLicenseVerifications() constMany operations with font can’t be executed if these operations are prohibited by license of this font. For example some font can’t be embedded into PDF document if license rules disable embedding for this font. This flag is used to disable any license restrictions for all fonts in current PDF document. Be careful when using this flag. When it is set it means that person who sets this flag, takes all responsibility of possible license/law violations on himself. So He takes it on it’s own risk. It’s strongly recommended to use this flag only when you are fully confident that you are not breaking the copyright law. By default false.
get_DisplayDocTitle()Gets flag specifying whether document’s window title bar should display document title.
get_Duplex()Gets print duplex mode handling option to use when printing the file from the print dialog.
get_EmbeddedFiles()Gets collection of files embedded to document.
get_EmbedStandardFonts() constProperty which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true. All PDF fonts can be embedded into document simply via setting of flag IsEmbedded into true, but PDF standard Type1 fonts is an exception from this rule. Standard Type1 font embedding requires much time, so to embed these fonts it’s necessary not only set flag IsEmbedded into true for specified font but also set an additiona flag on document’s level - EmbedStandardFonts = true; This property can be set only one time for all fonts. By default false.
get_EnableObjectUnload()Get or sets flag which enables document partially be unloaded from memory. This allow to decrease memory usage but may have negative effect on perfomance.
get_EnableSignatureSanitization() constGets flag to manage signature fields sanitization. Enabled by default.
get_FileName()Name of the PDF file that caused this document.
static get_FileSizeLimitToMemoryLoading()Get and set the file size limit for loading an entire file into memory. The value is set in megabytes. The default value is 210 Mb.
get_FitWindow()Gets flag specifying whether document window must be resized to fit the first displayed page.
get_FontUtilities()IDocumentFontUtilities instance.
get_Form()Gets Acro Form of the document.
get_HandleSignatureChange() constThrow Exception if the document will save with changes and have signature.
get_HideMenubar()Gets flag specifying whether menu bar should be hidden when document is active.
get_HideToolBar()Gets flag specifying whether toolbar should be hidden when document is active.
get_HideWindowUI()Gets flag specifying whether user interface elements should be hidden when document is active.
get_Id()Gets the ID.
get_IgnoreCorruptedObjects()Gets flag of ignoring errors in source files. When pages from source document copied into destination document, copying process is stopped with exception if some objects in source files are corrupted when this flag is false. example: dest.Pages.Add(src.Pages); If this flag is set to true then corrupted objects will be replaced with empty values. By default: true.
get_Info()Gets document info.
get_IsEncrypted()Gets encrypted status of the document. True if document is encrypted.
static get_IsLicensed()Gets licensed state of the system. Returns true is system works in licensed mode and false otherwise.
get_IsLinearized()Gets a value indicating whether document is linearized.
get_IsPdfaCompliant()Gets the is document pdfa compliant.
get_IsPdfUaCompliant()Gets the is document pdfua compliant.
get_IsXrefGapsAllowed()Gets the is document pdfa compliant.
get_JavaScript()Collection of JavaScript of document level.
get_LogicalStructure()Gets logical structure of the document.
get_Metadata()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.)
get_NamedDestinations()Collection of Named Destination in the document.
get_NonFullScreenPageMode()Gets page mode, specifying how to display the document on exiting full-screen mode.
get_OpenAction()Gets action performed at document opening.
get_OptimizeSize()Gets optimization flag. When pages are added to document, equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false.
get_Outlines()Gets document outlines.
get_OutputIntents()Gets the collection of Output intents in the document.
get_PageInfo()Gets the page info.(for generator only, not filled in when reading document)
get_PageLabels()Gets page labels in the document.
get_PageLayout()Gets page layout which shall be used when the document is opened.
get_PageMode()Gets page mode, specifying how document should be displayed when opened.
get_Pages()Gets collection of document pages. Note that pages are numbered from 1 in collection.
get_PdfFormat()Gets PDF format.
get_Permissions()Gets permissions of the document.
get_PickTrayByPdfSize()Gets a flag specifying whether the PDF page size shall be used to select the input paper tray.
get_PrintScaling()Gets the page scaling option that shall be selected when a print dialog is displayed for this document.
get_TaggedContent()
get_Version()Gets a version of Pdf from Pdf file header.
GetCatalogValue(System::String)Returns item value from catalog dictionary.
GetObjectById(System::String)Gets a object with specified ID in the document.
GetXmpMetadata(System::SharedPtr<System::IO::Stream>)Get XMP metadata from document.
HasIncrementalUpdate()Checks if the current PDF document has been saved with incremental updates.
ImportAnnotationsFromXfdf(System::String)Imports annotations from XFDF file to document.
ImportAnnotationsFromXfdf(System::SharedPtr<System::IO::Stream>)Imports annotations from stream to document.
LoadFrom(System::String, System::SharedPtr<LoadOptions>)Loads a file, converting it to PDF.
Merge(System::SharedPtr<Document::MergeOptions>, const System::ArrayPtr<System::SharedPtr<Document>>&)Merges documents.
Merge(System::SharedPtr<Document::MergeOptions>, const System::ArrayPtr<System::String>&)Merges documents.
Merge(const System::ArrayPtr<System::SharedPtr<Document>>&)Merges documents.
Merge(const System::ArrayPtr<System::String>&)Merges pdf files.
static MergeDocuments(System::SharedPtr<Document::MergeOptions>, const System::ArrayPtr<System::String>&)Merges documents.
static MergeDocuments(System::SharedPtr<Document::MergeOptions>, const System::ArrayPtr<System::SharedPtr<Document>>&)Merges documents.
static MergeDocuments(const System::ArrayPtr<System::String>&)Merges pdf files.
static MergeDocuments(const System::ArrayPtr<System::SharedPtr<Document>>&)Merges documents.
Optimize()Linearize the document in order to.
OptimizeResources()Optimize resources in the document:
OptimizeResources(System::SharedPtr<Aspose::Pdf::Optimization::OptimizationOptions>)Optimize resources in the document according to defined optimization strategy.
PageNodesToBalancedTree(uint8_t)Organizes page tree nodes in a document into a balanced tree. Only if the document has more than nodesNumInSubtrees page objects, otherwise it does nothing. Do not call this method while iterating over Pages elements, it may give unpredictable results.
ProcessParagraphs()Process paragraphs for generator.
RemoveMetadata()Removes metadata from the document.
RemovePdfaCompliance()Remove pdfa compliance from the document.
RemovePdfUaCompliance()Remove pdfUa compliance from the document.
Repair(System::SharedPtr<Document::RepairOptions>)Repairs broken document.
Save(System::SharedPtr<System::IO::Stream>)Stores document into stream.
Save(System::String)Saves document into the specified file.
Save()Save document incrementally (i.e. using incremental update technique).
Save(System::SharedPtr<SaveOptions>)Saves the document with save options.
Save(System::String, SaveFormat)Saves the document with a new name along with a file format.
Save(System::SharedPtr<System::IO::Stream>, SaveFormat)Saves the document with a new name along with a file format.
Save(System::String, System::SharedPtr<SaveOptions>)Saves the document with a new name setting its save options.
Save(System::SharedPtr<System::IO::Stream>, System::SharedPtr<SaveOptions>)Saves the document to a stream with a save options.
Save(System::SharedPtr<System::Web::HttpResponse>, System::String, ContentDisposition, System::SharedPtr<SaveOptions>)Saves the document to a response stream with a save options.
SaveXml(System::String)Save document to XML.
SendTo(System::SharedPtr<Devices::DocumentDevice>, System::SharedPtr<System::IO::Stream>)Sends the whole document to the document device for processing.
SendTo(System::SharedPtr<Devices::DocumentDevice>, int32_t, int32_t, System::SharedPtr<System::IO::Stream>)Sends the certain pages of the document to the document device for processing.
SendTo(System::SharedPtr<Devices::DocumentDevice>, System::String)Sends the whole document to the document device for processing.
SendTo(System::SharedPtr<Devices::DocumentDevice>, int32_t, int32_t, System::String)Sends the whole document to the document device for processing.
set_AllowReusePageContent(bool)Allows to merge page contents to optimize docuement size. If used then differnet but duplicated pages may reference to the same content object. Please note that this mode may cause side effects like changing page content when other page is changed.
set_Background(System::SharedPtr<Color>)Sets the background color of the document.
set_CenterWindow(bool)Sets flag specifying whether position of the document’s window will be centerd on the screen.
set_Collection(System::SharedPtr<Aspose::Pdf::Collection>)Gets collection of document.
set_Direction(Aspose::Pdf::Direction)Sets reading order of text: L2R (left to right) or R2L (right to left).
set_DisableFontLicenseVerifications(bool)Many operations with font can’t be executed if these operations are prohibited by license of this font. For example some font can’t be embedded into PDF document if license rules disable embedding for this font. This flag is used to disable any license restrictions for all fonts in current PDF document. Be careful when using this flag. When it is set it means that person who sets this flag, takes all responsibility of possible license/law violations on himself. So He takes it on it’s own risk. It’s strongly recommended to use this flag only when you are fully confident that you are not breaking the copyright law. By default false.
set_DisplayDocTitle(bool)Sets flag specifying whether document’s window title bar should display document title.
set_Duplex(PrintDuplex)Sets print duplex mode handling option to use when printing the file from the print dialog.
set_EmbedStandardFonts(bool)Property which declares that document must embed all standard Type1 fonts which has flag IsEmbedded set into true. All PDF fonts can be embedded into document simply via setting of flag IsEmbedded into true, but PDF standard Type1 fonts is an exception from this rule. Standard Type1 font embedding requires much time, so to embed these fonts it’s necessary not only set flag IsEmbedded into true for specified font but also set an additiona flag on document’s level - EmbedStandardFonts = true; This property can be set only one time for all fonts. By default false.
set_EnableObjectUnload(bool)Get or sets flag which enables document partially be unloaded from memory. This allow to decrease memory usage but may have negative effect on perfomance.
set_EnableSignatureSanitization(bool)Sets flag to manage signature fields sanitization. Enabled by default.
static set_FileSizeLimitToMemoryLoading(int32_t)Get and set the file size limit for loading an entire file into memory. The value is set in megabytes. The default value is 210 Mb.
set_FitWindow(bool)Sets flag specifying whether document window must be resized to fit the first displayed page.
set_HandleSignatureChange(bool)Throw Exception if the document will save with changes and have signature.
set_HideMenubar(bool)Sets flag specifying whether menu bar should be hidden when document is active.
set_HideToolBar(bool)Sets flag specifying whether toolbar should be hidden when document is active.
set_HideWindowUI(bool)Sets flag specifying whether user interface elements should be hidden when document is active.
set_IgnoreCorruptedObjects(bool)Sets flag of ignoring errors in source files. When pages from source document copied into destination document, copying process is stopped with exception if some objects in source files are corrupted when this flag is false. example: dest.Pages.Add(src.Pages); If this flag is set to true then corrupted objects will be replaced with empty values. By default: true.
set_IsLinearized(bool)Sets a value indicating whether document is linearized.
set_IsXrefGapsAllowed(bool)Sets the is document pdfa compliant.
set_NonFullScreenPageMode(Aspose::Pdf::PageMode)Sets page mode, specifying how to display the document on exiting full-screen mode.
set_OpenAction(System::SharedPtr<Annotations::IAppointment>)Sets action performed at document opening.
set_OptimizeSize(bool)Sets optimization flag. When pages are added to document, equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false.
set_PageInfo(System::SharedPtr<Aspose::Pdf::PageInfo>)Sets the page info.(for generator only, not filled in when reading document)
set_PageLayout(Aspose::Pdf::PageLayout)Sets page layout which shall be used when the document is opened.
set_PageMode(Aspose::Pdf::PageMode)Sets page mode, specifying how document should be displayed when opened.
set_PickTrayByPdfSize(bool)Sets a flag specifying whether the PDF page size shall be used to select the input paper tray.
set_PrintScaling(Aspose::Pdf::PrintScaling)Sets the page scaling option that shall be selected when a print dialog is displayed for this document.
static SetDefaultFileSizeLimitToMemoryLoading()Sets the file size limit for loading an entire file into memory to default value equals 210 Mb.
SetTitle(System::String)Set Title for PdfDocument.
SetXmpMetadata(System::SharedPtr<System::IO::Stream>)Set XMP metadata of document.
Validate(System::String, Aspose::Pdf::PdfFormat)Validate document into the specified file.
Validate(System::SharedPtr<System::IO::Stream>, Aspose::Pdf::PdfFormat)Validate document into the specified file.
Validate(System::SharedPtr<PdfFormatConversionOptions>)Validate document into the specified file.

Fields

FieldDescription
static DefaultNodesNumInSubtrees

Typedefs

TypedefDescription
CallBackGetHocrThe call back procedure for hocr recognize.
CallBackGetHocrWithPageThe call back procedure for hocr recognize.
FontSubstitutionHandlerRepresents the method that will handle FontSubstitution event.

See Also