PDFDocumentView¶
Namespace: O2S.Components.PDF4NET.View
Defines a viewer control for PDF files.
Inheritance Object → MarshalByRefObject → Component → Control → PDFDocumentView
Implements IPDFView
Remarks
Use this control to display PDF files. Set the PDFDocumentView.Document property to display the desired PDF document. Set the PDFDocumentView.Zoom property to adjust the zoom level. Use the PDFDocumentView.PageDisplayLayout property to specify how the pages are arranged in the viewer. The PDFDocumentView.UserInteractionMode property can be used to specify how the user interacts with the PDF document displayed in the viewer.
Example
In your form's constructor connect the document view to a PDFVisualDocument:
public AppForm()
{
InitializeComponent();
// ...
document = new PDFVisualDocument();
documentView.Document = document;
// ...
}
When the form is closed, the viewer control need to be disposed explicitly as follows:
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
document.Close();
documentView.Dispose();
document.Dispose();
}
Constructors¶
PDFDocumentView()¶
Initializes a new PDFDocumentView object.
Properties¶
AccessibilityObject¶
Property Value
AccessibleDefaultActionDescription¶
Property Value
AccessibleDescription¶
Property Value
AccessibleName¶
Property Value
AccessibleRole¶
Property Value
AllowDrop¶
Property Value
Anchor¶
Property Value
AnnotationSelectionRectangleAppearance¶
Gets or sets the appearance of the annotation selection rectangle.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the drawn appearance of the annotation selection
rectangle.
AnnotationToolTips¶
Gets or sets the annotation tooltips.
Property Value
PDFVisualAnnotationToolTip
A PDFVisualAnnotationToolTip object that describes how tooltips should be displayed for
annotations.
Remarks
Use this property to configure the content and the color scheme of the annotation tooltips. Setting this property to null will disable the annotation tooltips.
AutoScrollOffset¶
Property Value
BackColor¶
Property Value
BackgroundImage¶
Property Value
BackgroundImageLayout¶
Property Value
BindingContext¶
Property Value
Bottom¶
Property Value
Bounds¶
Property Value
CanFocus¶
Property Value
CanSelect¶
Property Value
Capture¶
Property Value
CausesValidation¶
Property Value
ClientRectangle¶
Property Value
ClientSize¶
Property Value
CompanyName¶
Property Value
Container¶
Property Value
ContainsFocus¶
Property Value
ContentPosition¶
Gets the content position.
Property Value
Point
The position of the content displayed in the viewer control.
Remarks
The position is relative to the top left corner of the viewer control.
ContentSize¶
Gets the content size.
Property Value
Size
The size of the content displayed in the viewer control.
ContextMenu¶
Property Value
ContextMenuStrip¶
Property Value
Controls¶
Property Value
Created¶
Property Value
Cursor¶
Property Value
DataBindings¶
Property Value
DefaultCircleAnnotationAppearance¶
Gets or sets the default appearance of the circle annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the circle annotation.
DefaultCloudSquareAnnotationAppearance¶
Gets or sets the default appearance of the cloud square annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the cloud square
annotation.
DefaultFileAttachmentAnnotationAppearance¶
Gets or sets the default appearance of the file attachment annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the file attachment
annotation.
DefaultFormFieldAppearance¶
Gets or sets the default appearance of the form fields.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the form fields.
DefaultFreeTextAnnotationAppearance¶
Gets or sets the default appearance of the free text annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the free text annotation.
DefaultHighlightAnnotationAppearance¶
Gets or sets the default appearance of the highlight annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the highlight annotation.
DefaultInkAnnotationAppearance¶
Gets or sets the default appearance of the ink annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the ink annotation.
DefaultLineAnnotationAppearance¶
Gets or sets the default appearance of the line annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the line annotation.
DefaultLinkAnnotationAppearance¶
Gets or sets the default appearance of the link annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the link annotation.
Remarks
The PathVisualAppearance.Fill property is not used for link annotations
DefaultPolylineAnnotationAppearance¶
Gets or sets the default appearance of the polyline annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the polyline annotation.
DefaultRubberStampAnnotationAppearance¶
Gets or sets the default appearance of the rubber stamp annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the rubber stamp
annotation.
Remarks
This property is only used for the design mode of the annotation. The actual apperance of the stamp is predefined and cannot be changed.
DefaultSquareAnnotationAppearance¶
Gets or sets the default appearance of the square annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the square annotation.
DefaultSquigglyAnnotationAppearance¶
Gets or sets the default appearance of the squiggly annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the squiggly annotation.
DefaultStrikeoutAnnotationAppearance¶
Gets or sets the default appearance of the strikeout annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the strikeout annotation.
DefaultTextAnnotationAppearance¶
Gets or sets the default appearance of the text annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the text annotation.
DefaultUnderlineAnnotationAppearance¶
Gets or sets the default appearance of the underline annotation.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the default appearance of the underline annotation.
DeviceDpi¶
Property Value
DisplayRectangle¶
Property Value
Disposing¶
Property Value
Dock¶
Property Value
Document¶
Gets or sets the document displayed in the viewer.
Property Value
PDFVisualDocument
A visual document that encapsulates the file to be displayed.
Enabled¶
Property Value
Focused¶
Property Value
Font¶
Property Value
ForeColor¶
Property Value
FormDesigner¶
Gets the active form designer.
Property Value
PDFVisualFormDesigner
A PDFVisualFormDesigner object for performing layout operations on the selected form fields or
null if the PDFDocumentView.UserInteractionMode is not PDFUserInteractionMode.EditFormFields.
GraphicRendererFactory¶
Gets or sets the graphic renderer factory.
Property Value
IGraphicRendererFactory
A factory for creating graphic renderers used by the PDF rendering process.
Handle¶
Property Value
HasChildren¶
Property Value
Height¶
Property Value
ImeMode¶
Property Value
InvokeRequired¶
Property Value
IsAccessible¶
Property Value
IsDisposed¶
Property Value
IsHandleCreated¶
Property Value
IsMirrored¶
Property Value
LayoutEngine¶
Property Value
Left¶
Property Value
Location¶
Property Value
Margin¶
Property Value
MaximumSize¶
Property Value
MinimumSize¶
Property Value
Name¶
Property Value
Padding¶
Property Value
PageDisplayLayout¶
Gets or sets the current page display layout.
Property Value
Remarks
The page display layout defines how the PDF pages are arranged and displayed in the viewer control.
PageNumber¶
Gets or sets the page number.
Property Value
Int32
The number of the page to be displayed in the viewer.
Parent¶
Property Value
PreferredSize¶
Property Value
ProductName¶
Property Value
ProductVersion¶
Property Value
RecreatingHandle¶
Property Value
Region¶
Property Value
ResizeHandleStyle¶
Gets or sets the style of the resize handles.
Property Value
ResizeHandleStyle
A PDFDocumentView.ResizeHandleStyle enum member specifying the style of the resize handles.
RestrictAnnotationsToVisiblePageArea¶
Gets or sets a flag indicating whether annotations can be added or moved only in the visible page area.
Property Value
Boolean
If true, then annotations can be added, moved or resized only in the page visible area.
Remarks
This property applies only to annotations handled through the PDFDocumentView control.
Right¶
Property Value
RightToLeft¶
Property Value
SelectionRectangleAppearance¶
Gets or sets the appearance of the selection rectangle.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the drawn appearance of the selection rectangle.
ShowAnnotations¶
Gets or sets a value indicating whether the annotations should be displayed or not.
Property Value
Boolean
True if the annotations should be displayed, false otherwise. Default is true.
ShowDefaultAnnotationContextMenu¶
Gets of sets a flag indicating whether the default annotations context menu should be displayed when right-clicking on an annotation.
Property Value
Boolean
True if default annotations context menu should be displayed.
ShowDefaultPageContextMenu¶
Gets of sets a flag indicating whether the default page context menu should be displayed when right-clicking on a page.
Property Value
Boolean
True if default page context menu should be displayed.
ShowFormFields¶
Gets or sets a value indicating whether the form fields should be displayed or not.
Property Value
Boolean
True if the form fields should be displayed, false otherwise. Default is true.
ShowPageNumberIndicator¶
Shows or hides the page number indicator in the bottom left corner of the PDFDocumentView control.
Property Value
Boolean
True to show the page number indicator, false to hide it.
Site¶
Property Value
Size¶
Property Value
TabIndex¶
Property Value
TabStop¶
Property Value
Tag¶
Property Value
Text¶
Property Value
TextSearchResultColor¶
Gets or sets the color used for highlighting the text search results.
Property Value
Color
A object specifying the color to be used for highlighting the text search results.
TextSelectionAppearance¶
Gets or sets the appearance of the text selection.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the drawn appearance of the text selection.
Top¶
Property Value
TopLevelControl¶
Property Value
UserInteractionMode¶
Gets or sets the user interaction mode.
Property Value
PDFUserInteractionMode
A PDFUserInteractionMode num member specifying how the end user interacts with the control.
UseWaitCursor¶
Property Value
Visible¶
Property Value
Width¶
Property Value
Zoom¶
Gets or sets the zoom level.
Property Value
Int32
The zoom level used for displaying the PDF pages.
ZoomMode¶
Gets or sets the current zoom mode.
Property Value
PDFZoomMode
A PDFZoomMode enumeration member specifying how the PDFDocumentView.Zoom value is handled.
Methods¶
ConvertPagePointToViewerPoint(Int32, PDFPoint)¶
Converts a page point in page visual coordinates to a viewer point in viewer coordinates.
Parameters
pageNumber Int32
The page number for which the conversion is performed.
pagePoint PDFPoint
The page point in visual coordinates (PDF points relative to top left corner of the visible page area)
Returns
Point
A object in viewer coordinates, relative to top left corner of the viewer control.
GetSelectedAnnotations()¶
Gets the collection of selected annotations in the control.
Returns
PDFVisualAnnotation[]
An array holding the selected annotations in the control or null if no annotations are selected
GetVisiblePages()¶
Gets the list of visible pages.
Returns
Int32[]
An array of page numbers, specifying the pages that are visible in the viewer.
ScrollToPageLocation(PDFVisualPage, Double, Double)¶
Scrolls the viewer to the specified page at the given location.
Parameters
visualPage PDFVisualPage
The page to scroll to.
x Double
Location's x coordinate on the page where to scroll.
y Double
Location's Y coordinate on the page where to scroll.
Events¶
AfterAnnotationAdd¶
Gets or sets the event that is fired after an annotation has been added through the PDFDocumentView control.
AfterAnnotationDelete¶
Gets or sets the event that is fired after an annotation has been deleted.
AfterAnnotationMove¶
Gets or sets the event that is fired after an annotation has been moved.
AfterAnnotationResize¶
Gets or sets the event that is fired after an annotation has been resized.
AfterContentSelect¶
Gets or sets the event that is fired after content has been selected on the page.
AfterFieldAdd¶
Gets or sets the event that is fired after a form field has been added through the PDFDocumentView control.
AfterLinkExecute¶
Gets or sets the event that is fired after a link has been executed.
AfterPageDelete¶
Gets or sets the event that is fired after a page has been deleted.
AnnotationClick¶
Gets or sets the event that is fired when an annotation has been clicked.
AnnotationContextMenu¶
Gets or sets the event that is fired when an annotation context menu should be displayed.
AnnotationDeselected¶
Gets or sets the event that is fired when an annotation is deselected the PDFDocumentView control.
AnnotationDoubleClick¶
Gets or sets the event that is fired when an annotation has been double clicked.
AnnotationSelected¶
Gets or sets the event that is fired when an annotation is selected the PDFDocumentView control.
AnnotationToolTipContentRequested¶
Gets or sets the event that is fired when content is needed for annotation tooltip.
public event EventHandler<PDFVisualAnnotationToolTipContentRequestedEventArgs> AnnotationToolTipContentRequested;
AnnotationToolTipPopup¶
Gets or sets the event that is fired before an annotation tooltip is displayed.
BackColorChanged¶
BackgroundImageChanged¶
BackgroundImageLayoutChanged¶
BeforeAnnotationAdd¶
Gets or sets the event that is fired before an annotation is added through the PDFDocumentView control.
BeforeAnnotationDelete¶
Gets or sets the event that is fired when an annotation is about to be deleted using the DEL key.
BeforeAnnotationMove¶
Gets or sets the event that is fired when an annotation is about to be moved.
BeforeAnnotationResize¶
Gets or sets the event that is fired when an annotation is about to be resized.
BeforeFieldAdd¶
Gets or sets the event that is fired before a form field is added through the PDFDocumentView control.
BeforeLinkExecute¶
Gets or sets the event that is fired before a link is executed.
BeforePageDelete¶
Gets or sets the event that is fired when a page is about to be deleted using the default page context menu.
BindingContextChanged¶
CausesValidationChanged¶
ChangeUICues¶
Click¶
ClientSizeChanged¶
ContentPainted¶
Gets or sets the event that is fired after the viewer content has been drawn.
ContentPositionChanged¶
Gets or sets the event that is fired when the content position has changed.
ContentSizeChanged¶
Gets or sets the event that is fired when the size of displayed content changes.
ContextMenuChanged¶
ContextMenuStripChanged¶
ControlAdded¶
ControlRemoved¶
CursorChanged¶
Disposed¶
DockChanged¶
DoubleClick¶
DpiChangedAfterParent¶
DpiChangedBeforeParent¶
DragDrop¶
DragEnter¶
DragLeave¶
DragOver¶
EnabledChanged¶
Enter¶
FontChanged¶
ForeColorChanged¶
GiveFeedback¶
GotFocus¶
HandleCreated¶
HandleDestroyed¶
HelpRequested¶
ImeModeChanged¶
Invalidated¶
KeyDown¶
KeyPress¶
KeyUp¶
Layout¶
Leave¶
LocationChanged¶
LostFocus¶
MarginChanged¶
MouseCaptureChanged¶
MouseClick¶
MouseDoubleClick¶
MouseDown¶
MouseEnter¶
MouseHover¶
MouseLeave¶
MouseMove¶
MouseUp¶
MouseWheel¶
Move¶
PaddingChanged¶
PageClick¶
Gets or sets the event that is fired when a page has been clicked.
PageContextMenu¶
Gets or sets the event that is fired when a page context menu should be displayed.
PageDoubleClick¶
Gets or sets the event that is fired when a page has been double clicked.
PageNumberChanged¶
Gets or sets the event that is fired when the page number has changed.
PageRenderingCancelled¶
Gets or sets the event that is fired when the page stops displaying content.
PageRenderingCompleted¶
Gets or sets the event that is fired when the page content for the page visible area is displayed in full.
PageRenderingStarted¶
Gets or sets the event that is fired when a page begins to be displayed.
Paint¶
ParentChanged¶
PreviewKeyDown¶
QueryAccessibilityHelp¶
QueryContinueDrag¶
RegionChanged¶
Resize¶
RightToLeftChanged¶
SelectedContentContextMenu¶
Gets or sets the event that is fired when a context menu should be displayed for selected content.
SizeChanged¶
StyleChanged¶
SystemColorsChanged¶
TabIndexChanged¶
TabStopChanged¶
TextChanged¶
UserInteractionModeChanged¶
Gets or sets the event that is fired when the PDFDocumentView.UserInteractionMode has changed.
Validated¶
Validating¶
VisibleChanged¶
ZoomChanged¶
Gets or sets the event that is fired when the zoom has changed.
ZoomModeChanged¶
Gets or sets the event that is fired when the PDFDocumentView.ZoomMode has changed.