GetDocumentInfo

Editor.GetDocumentInfo method

Returns metadata about the document, that was loaded to this ‘Editor’ instance

public IDocumentInfo GetDocumentInfo(string password)
Parameter Type Description
password String User can specify a password for a document, if this document is encrypted with the password. May be NULL or empty string, that is equivalent to the absent password. For those document formats, which do not have a password protection feature, this argument will be ignored. If the document is encrypted, and password in not specified in this parameter, but it was specified before in the load options while creating this Editor instance, it will be used.

Return Value

Format-specific inheritor of IDocumentInfo interface, that indicates detected format with format-specific metadata, or NULL, if document was not recognized as supportable or is corrupted.

Exceptions

exception condition
ObjectDisposedException Is thrown when Editor instance was already disposed when “GetDocumentInfo” is invoked
PasswordRequiredException Is thrown when loaded document is password protected, but the password was not specified in the parameter “password” and in the loading options during creation of the instance
IncorrectPasswordException Is thrown when loaded document is password protected, password is specified, but is incorrect
InvalidOperationException Is thrown when unexpected error of unknown nature has occured

Remarks

GetDocumentInfo method is useful when it is unclear of which format is the input document, is it password-protected and/or how many pages/worksheets/slides it contains. Based on this metadata, returned by GetDocumentInfo, it is possible to correctly adjust the load and edit options for the main processing pipeline.

GetDocumentInfo method always returns full data, it is not affected by the trial mode, its usage doesn’t write off the consumed bytes or credits.

Learn more

See Also