PDFDocumentView¶
Namespace: O2S.Components.PDF4NET.View
Defines a viewer control for PDF files.
Inheritance Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ContentControl → UserControl → PDFDocumentView
Implements IPDFView
Remarks
Use this control to display PDF files in Windows Presentation Foundation applications. 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 window's constructor connect the document view to a PDFVisualDocument:
public MainWindow()
{
// ...
document = new PDFVisualDocument();
documentView.Document = document;
// ...
}
When the window is closed, the viewer control need to be disposed explicitly as follows:
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
document.Close();
documentView.Dispose();
document.Dispose();
}
Fields¶
ResizeHandleStyleProperty¶
ShowAnnotationsCustomizationMenu Dependency Property
RestrictAnnotationsToVisiblePageAreaProperty¶
RestrictAnnotationsToVisiblePageArea Dependency Property
ShowAnnotationsProperty¶
ShowAnnotations Dependency Property
ShowDefaultAnnotationContextMenuProperty¶
ShowDefaultAnnotationContextMenu Dependency Property
ShowDefaultPageContextMenuProperty¶
ShowDefaultPageContextMenu Dependency Property
ShowFormFieldsProperty¶
ShowAnnotations Dependency Property
ShowPageNumberIndicatorProperty¶
Zoom Dependency Property
ZoomProperty¶
Zoom Dependency Property
Constructors¶
PDFDocumentView()¶
Initializes a new PDFDocumentView object.
Properties¶
ActualHeight¶
Property Value
ActualWidth¶
Property Value
AllowDrop¶
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.
AreAnyTouchesCaptured¶
Property Value
AreAnyTouchesCapturedWithin¶
Property Value
AreAnyTouchesDirectlyOver¶
Property Value
AreAnyTouchesOver¶
Property Value
Background¶
Property Value
BindingGroup¶
Property Value
BitmapEffect¶
Caution¶
BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.
Property Value
BitmapEffectInput¶
Caution¶
BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.
Property Value
BorderBrush¶
Property Value
BorderThickness¶
Property Value
CacheMode¶
Property Value
Clip¶
Property Value
ClipToBounds¶
Property Value
CommandBindings¶
Property Value
Content¶
Property Value
ContentStringFormat¶
Property Value
ContentTemplate¶
Property Value
ContentTemplateSelector¶
Property Value
ContextMenu¶
Property Value
Cursor¶
Property Value
DataContext¶
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.
DependencyObjectType¶
Property Value
DesiredSize¶
Property Value
Dispatcher¶
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.
Effect¶
Property Value
FlowDirection¶
Property Value
Focusable¶
Property Value
FocusVisualStyle¶
Property Value
FontFamily¶
Property Value
FontSize¶
Property Value
FontStretch¶
Property Value
FontStyle¶
Property Value
FontWeight¶
Property Value
ForceCursor¶
Property Value
Foreground¶
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.
HasAnimatedProperties¶
Property Value
HasContent¶
Property Value
Height¶
Property Value
HorizontalAlignment¶
Property Value
HorizontalContentAlignment¶
Property Value
InputBindings¶
Property Value
InputScope¶
Property Value
IsArrangeValid¶
Property Value
IsEnabled¶
Property Value
IsFocused¶
Property Value
IsHitTestVisible¶
Property Value
IsInitialized¶
Property Value
IsInputMethodEnabled¶
Property Value
IsKeyboardFocused¶
Property Value
IsKeyboardFocusWithin¶
Property Value
IsLoaded¶
Property Value
IsManipulationEnabled¶
Property Value
IsMeasureValid¶
Property Value
IsMouseCaptured¶
Property Value
IsMouseCaptureWithin¶
Property Value
IsMouseDirectlyOver¶
Property Value
IsMouseOver¶
Property Value
IsSealed¶
Property Value
IsStylusCaptured¶
Property Value
IsStylusCaptureWithin¶
Property Value
IsStylusDirectlyOver¶
Property Value
IsStylusOver¶
Property Value
IsTabStop¶
Property Value
IsVisible¶
Property Value
Language¶
Property Value
LayoutTransform¶
Property Value
Margin¶
Property Value
MaxHeight¶
Property Value
MaxWidth¶
Property Value
MinHeight¶
Property Value
MinWidth¶
Property Value
Name¶
Property Value
Opacity¶
Property Value
OpacityMask¶
Property Value
OverridesDefaultStyle¶
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
PersistId¶
Caution¶
PersistId is an obsolete property and may be removed in a future release. The value of this property is not defined.
Property Value
RenderSize¶
Property Value
RenderTransform¶
Property Value
RenderTransformOrigin¶
Property Value
ResizeHandleStyle¶
Gets or sets the style of the resize handles for annotations.
Property Value
ResizeHandleStyle
A PDFDocumentView.ResizeHandleStyle enum member specifying the style of the resize handles.
Resources¶
Property Value
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.
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 annotation context menu should be displayed when right-clicking on an annotation.
Property Value
Boolean
True if default annotation 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 annotations should be displayed or not.
Property Value
Boolean
True if the annotations 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.
SnapsToDevicePixels¶
Property Value
Style¶
Property Value
TabIndex¶
Property Value
Tag¶
Property Value
Template¶
Property Value
TemplatedParent¶
Property Value
TextSearchResultAppearance¶
Gets or sets the appearance used for highlighting the text search results.
Property Value
PathVisualAppearance
A PathVisualAppearance object specifying the appearance 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.
ToolTip¶
Property Value
TouchesCaptured¶
Property Value
TouchesCapturedWithin¶
Property Value
TouchesDirectlyOver¶
Property Value
TouchesOver¶
Property Value
Triggers¶
Property Value
Uid¶
Property Value
UseLayoutRounding¶
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.
VerticalAlignment¶
Property Value
VerticalContentAlignment¶
Property Value
Visibility¶
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¶
Dispose()¶
Disposes 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
InitializeComponent()¶
InitializeComponent
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.
UpdateOnDpiChange()¶
Updates the viewer content when the monitor dpi changes.
Remarks
This method should be called by client application in response to dpi change events. If this method is not called when the monitor dpi changes then the layout of the viewer content might get scrambled and the current document needs to be closed and reopened.
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.
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.
ContextMenuClosing¶
ContextMenuOpening¶
DataContextChanged¶
DragEnter¶
DragLeave¶
DragOver¶
Drop¶
FocusableChanged¶
GiveFeedback¶
GotFocus¶
GotKeyboardFocus¶
GotMouseCapture¶
GotStylusCapture¶
GotTouchCapture¶
Initialized¶
IsEnabledChanged¶
IsHitTestVisibleChanged¶
IsKeyboardFocusedChanged¶
IsKeyboardFocusWithinChanged¶
IsMouseCapturedChanged¶
IsMouseCaptureWithinChanged¶
IsMouseDirectlyOverChanged¶
IsStylusCapturedChanged¶
IsStylusCaptureWithinChanged¶
IsStylusDirectlyOverChanged¶
IsVisibleChanged¶
KeyDown¶
KeyUp¶
LayoutUpdated¶
Loaded¶
LostFocus¶
LostKeyboardFocus¶
LostMouseCapture¶
LostStylusCapture¶
LostTouchCapture¶
ManipulationBoundaryFeedback¶
ManipulationCompleted¶
ManipulationDelta¶
ManipulationInertiaStarting¶
ManipulationStarted¶
ManipulationStarting¶
MouseDoubleClick¶
MouseDown¶
MouseEnter¶
MouseLeave¶
MouseLeftButtonDown¶
MouseLeftButtonUp¶
MouseMove¶
MouseRightButtonDown¶
MouseRightButtonUp¶
MouseUp¶
MouseWheel¶
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.
PreviewDragEnter¶
PreviewDragLeave¶
PreviewDragOver¶
PreviewDrop¶
PreviewGiveFeedback¶
PreviewGotKeyboardFocus¶
PreviewKeyDown¶
PreviewKeyUp¶
PreviewLostKeyboardFocus¶
PreviewMouseDoubleClick¶
PreviewMouseDown¶
PreviewMouseLeftButtonDown¶
PreviewMouseLeftButtonUp¶
PreviewMouseMove¶
PreviewMouseRightButtonDown¶
PreviewMouseRightButtonUp¶
PreviewMouseUp¶
PreviewMouseWheel¶
PreviewQueryContinueDrag¶
PreviewStylusButtonDown¶
PreviewStylusButtonUp¶
PreviewStylusDown¶
PreviewStylusInAirMove¶
PreviewStylusInRange¶
PreviewStylusMove¶
PreviewStylusOutOfRange¶
PreviewStylusSystemGesture¶
PreviewStylusUp¶
PreviewTextInput¶
PreviewTouchDown¶
PreviewTouchMove¶
PreviewTouchUp¶
QueryContinueDrag¶
QueryCursor¶
RequestBringIntoView¶
SelectedContentContextMenu¶
Gets or sets the event that is fired when a context menu should be displayed for selected content.
SizeChanged¶
SourceUpdated¶
StylusButtonDown¶
StylusButtonUp¶
StylusDown¶
StylusEnter¶
StylusInAirMove¶
StylusInRange¶
StylusLeave¶
StylusMove¶
StylusOutOfRange¶
StylusSystemGesture¶
StylusUp¶
TargetUpdated¶
TextInput¶
ToolTipClosing¶
ToolTipOpening¶
TouchDown¶
TouchEnter¶
TouchLeave¶
TouchMove¶
TouchUp¶
Unloaded¶
UserInteractionModeChanged¶
Gets or sets the event that is fired when the PDFDocumentView.UserInteractionMode has changed.
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.