DocumentViewer Object (IDocumentViewer Interface)
The DocumentViewer object is an ActiveX control that allows you to view the list of pages in the document and monitor their state. You can also save the recognized document or open it in the selected application using the commands available in the component. A document is connected to the component via the FRDocument property.
The Document Viewer component may look as follows depending on the value of the Mode property:
- Details view
Provides detailed information about each document page.
- Thumbnails view
Displays document pages as thumbnails.
You can modify the appearance of the component via its properties. For example, you can add buttons to its toolbar and remove them from it via the Toolbar property, or modify the context menu of the component via the PopupMenu property. See Customizing the Context Menu and Toolbar of a Visual Component for details.
The information about monitoring the document is reported through special outgoing interfaces. These interfaces are IDocumentViewerEvents (for C++) and a dispinterface DIDocumentViewerEvents (for Visual Basic).
It's worth noting that Visual Basic users should not care for details of event interfaces implementation as this development platform provides easy means for handling them. This object may be declared WithEvents in Visual Basic.
For C++ user this fact means that it supports the IConnectionPointContainer interface. To receive notification events, a C++ user should create an object derived from the IDocumentViewerEvents interface, then set up the connection between it and events source implemented in DocumentViewer object by standard COM means.
The Document Viewer component can be connected to the Component Synchronizer component, in which case all the events in Document Viewer will be automatically transmitted to other components connected to the Synchronizer and the whole application will work synchronously.
Properties
Name | Type | Description |
---|---|---|
ActivePage | FRPage | Specifies the active page in Document Viewer. If there is no active page, the value of this property is 0. |
CaptionPaneEnabled | VARIANT_BOOL |
Specifies whether the caption pane of Document Viewer is enabled. If this property is FALSE, caption pane is not displayed. By default, the value is TRUE. |
ContextMenuEnabled | VARIANT_BOOL |
Specifies whether the context menu of Document Viewer is enabled. If this property is FALSE, context menu is never displayed. By default, the value is TRUE. |
Commands | Commands, read-only | Provides access to the commands available in Document Viewer. See the list of commands available in Document Viewer. |
FRDocument | FRDocument | Specifies the document connected to Document Viewer. |
LanguagePaneEnabled | VARIANT_BOOL |
Specifies whether the language page of Document Viewer is enabled. If this property is FALSE, language page is not displayed. By default, the value is TRUE. |
Locked | VARIANT_BOOL |
Specifies whether Document Viewer is locked. This property is useful in the following situations:
In this case, we recommend that you set this property to TRUE before analysis, recognition, synthesis or export, and set it to FALSE after the end of the operation. In this case, the document cannot be spoilt from Document Viewer. By default, the value is FALSE. |
Mode | DocumentViewerModeEnum |
Specifies the current mode of Document Viewer: Details or Thumbnails view. By default, the mode is DVM_Thumbnails. |
PopupMenu | PopupMenu, read-only | Provides access to the settings of the context menu. |
ProcessingParams | DocumentProcessingParams |
Specifies the default processing parameters for the document. These parameters are used if the analysis and recognition processes are called directly from Document Viewer. Note: If Document Viewer is connected to Component Synchronizer, use the IComponentSynchronizer::ProcessingParams property to change parameters used for processing. If you change processing parameters via the property of Document Viewer, errors may occur. |
Title | BSTR |
Specifies the title of the Document Viewer component. By default, it is "Pages". |
Toolbar | Toolbar, read-only | Provides access to the toolbar settings. |
SelectedPagesIndices | IntsCollection | Provides access to the collection of indices of selected pages. |
SettingsPath | BSTR |
Specifies the path to the folder which contains files with the settings of Document Viewer. Other Visual Components have the same property. Each Visual Component should use its own folder with settings. The value of this property is constructed from the path to the folder, in which ABBYY FineReader Engine stores user-specific data, and the name of its subfolder. By default, the folder with user-specific data is the FineReader Engine data folder. It can be changed during initialization of FineReader Engine (via the InitializeEngine function, or via the IEngineLoader::InitializeEngine method). The default name of the subfolder is an arbitrary GUID. To change the name of the subfolder, you should specify the new name in the properties of the component in Visual Studio at design time. If you try to specify the value of the property at run time, this value is ignored. If you add the component to a form in Visual Studio when designing, the value of the property is defined either automatically with the default value, or manually with a custom value. In both cases the value is defined at design time. If for some reason the value of the property is not defined at design time (e.g., if you generate the component dynamically at run time), the component creates a new folder with the settings each time the component is initialized. To avoid multiplication of the folders, you should delete the created settings folder after the component deinitialization. In this case, you can use only the default settings of the component and cannot save the settings between sessions. |
WindowHandle | __int64, read-only | Returns the window handle of the client area. |
Methods
Name | Description |
---|---|
UpdateOptions | Updates the settings specified in the Options dialog box of Document Viewer. You may need to call this method, if the options have been changed in some other Visual Component, to update the options of Document Viewer to the current state. |
Samples
This component is used in the following code samples: VisualComponents.
See also
IComponentSynchronizer::DocumentViewer
Creating an Application with a Graphical User Interface
Customizing the Context Menu and Toolbar of a Visual Component
9/17/2024 3:14:41 PM