Class PdfView

This XAML control displays a PDF.

Inheritance
System.Object
Windows.UI.Xaml.DependencyObject
Windows.UI.Xaml.UIElement
Windows.UI.Xaml.FrameworkElement
Windows.UI.Xaml.Controls.Control
PdfView
Namespace: PSPDFKit.UI
Assembly: PSPDFKit.dll
Syntax
public sealed class PdfView : Control, IDependencyObject, IDependencyObject2, IUIElement, IUIElementOverrides, IUIElement2, IUIElement3, IFrameworkElement, IFrameworkElementOverrides, IFrameworkElement2, IFrameworkElementOverrides2, IFrameworkElement3, IControl, IControlOverrides, IControlProtected, IControl2, IControl3

Constructors

| Improve this Doc View Source

PdfView()

Declaration
public PdfView()

Properties

| Improve this Doc View Source

AutoSave

Automatically save the file when the PdfView is unloaded or a new file is loaded. Default is None.

Declaration
public AutoSaveMode AutoSave { get; set; }
Property Value
Type Description
AutoSaveMode
| Improve this Doc View Source

Controller

The UI controller for the currently opened Document

Declaration
public Controller Controller { get; }
Property Value
Type Description
Controller
| Improve this Doc View Source

Css

Custom CSS for the PdfView

Declaration
public Uri Css { get; set; }
Property Value
Type Description
System.Uri
| Improve this Doc View Source

Document

The currently opened Document.

Declaration
public Document Document { get; }
Property Value
Type Description
Document
| Improve this Doc View Source

License

The PSPDFKit license key.

Declaration
public string License { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MessageBoxImage

MessageBox image.

Declaration
public BitmapImage MessageBoxImage { get; set; }
Property Value
Type Description
Windows.UI.Xaml.Media.Imaging.BitmapImage
| Improve this Doc View Source

MessageBoxText

MessageBox text.

Declaration
public string MessageBoxText { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MessageBoxVisibility

Visibility of the MessageBox.

Declaration
public Visibility MessageBoxVisibility { get; set; }
Property Value
Type Description
Windows.UI.Xaml.Visibility
| Improve this Doc View Source

PdfFileSource

A Windows.Storage.StorageFile representing a document to open.

Declaration
public StorageFile PdfFileSource { get; set; }
Property Value
Type Description
Windows.Storage.StorageFile
| Improve this Doc View Source

PdfFileSourceProperty

Declaration
public static DependencyProperty PdfFileSourceProperty { get; }
Property Value
Type Description
Windows.UI.Xaml.DependencyProperty
| Improve this Doc View Source

PdfUriSource

A System.Uri representing a document to open.

Declaration
public Uri PdfUriSource { get; set; }
Property Value
Type Description
System.Uri
| Improve this Doc View Source

PdfUriSourceProperty

Declaration
public static DependencyProperty PdfUriSourceProperty { get; }
Property Value
Type Description
Windows.UI.Xaml.DependencyProperty
| Improve this Doc View Source

PreventTextCopy

When copying of text is disabled, it's still possible to select text but copying either using the shortcut or a context menu will have no effect. Changing this property has no effect after a document has loaded. Load the document again if you wish to update this property.

Declaration
public bool PreventTextCopy { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ReadOnly

Make the document read only if set to true.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ResetViewStatePropertiesOnLoad

If set to 'true' then each time a new document is shown the view state properties, such as ShowAnnotations and ShowToolbar are reset to their default setting. Default setting is 'true'.

Declaration
public bool ResetViewStatePropertiesOnLoad { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ShowAnnotations

Show or hide annotations.

Declaration
public bool ShowAnnotations { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ShowToolbar

Show or hide the UI Toolbar.

Declaration
public bool ShowToolbar { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

WebViewVisibility

Visibility of the WebView.

Declaration
public Visibility WebViewVisibility { get; set; }
Property Value
Type Description
Windows.UI.Xaml.Visibility

Methods

| Improve this Doc View Source

GetToolbarItems()

Gets the IToolbarItems shown.

Declaration
public IList<IToolbarItem> GetToolbarItems()
Returns
Type Description
System.Collections.Generic.IList<IToolbarItem>

Current list of toolbar items

| Improve this Doc View Source

OnApplyTemplate()

Windows.UI.Xaml.FrameworkElement.Windows.UI.Xaml.IFrameworkElementOverrides.OnApplyTemplate()
Declaration
protected override void OnApplyTemplate()
Overrides
Windows.UI.Xaml.FrameworkElement.Windows.UI.Xaml.IFrameworkElementOverrides.OnApplyTemplate()
| Improve this Doc View Source

OpenStorageFileAsync(StorageFile)

Asynchronously Open a PDF document represented by a Windows.Storage.StorageFile

Declaration
public IAsyncAction OpenStorageFileAsync(StorageFile file)
Parameters
Type Name Description
Windows.Storage.StorageFile file

The Windows.Storage.StorageFile representing the PDF.

Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

OpenStorageFileWithPasswordAsync(StorageFile, String)

Asynchronously Open a PDF document represented by a Windows.Storage.StorageFile

Declaration
public IAsyncAction OpenStorageFileWithPasswordAsync(StorageFile file, string password)
Parameters
Type Name Description
Windows.Storage.StorageFile file

The Windows.Storage.StorageFile representing the PDF.

System.String password

The password required to open the PDF.

Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

OpenUriAsync(Uri)

Asynchronously Open a PDF document represented by a Windows.Foundation.Uri

Declaration
public IAsyncAction OpenUriAsync(Uri uri)
Parameters
Type Name Description
System.Uri uri

The Windows.Foundation.Uri representing the PDF.

Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

OpenUriAsync(Uri, String)

Asynchronously Open a PDF document represented by a Windows.Foundation.Uri

Declaration
public IAsyncAction OpenUriAsync(Uri uri, string password)
Parameters
Type Name Description
System.Uri uri

The Windows.Foundation.Uri representing the PDF.

System.String password

The password required to open the PDF.

Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

ResetAsync()

Resets the WebView to it's initial state

Declaration
public IAsyncAction ResetAsync()
Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

SetToolbarItemsAsync(IList<IToolbarItem>)

Sets the IToolbarItems to be show. This will overwrite any items currently held by the toolbar. If the view is not initialized, the item will be cached and set when the view is ready.

Declaration
public IAsyncAction SetToolbarItemsAsync(IList<IToolbarItem> toolbarItems)
Parameters
Type Name Description
System.Collections.Generic.IList<IToolbarItem> toolbarItems
Returns
Type Description
Windows.Foundation.IAsyncAction
| Improve this Doc View Source

ShowMessage(String)

Hides the currently displayed PDF, if any, and shows a message.

Declaration
public void ShowMessage(string message)
Parameters
Type Name Description
System.String message

The message to show.

Events

| Improve this Doc View Source

InitializationCompletedHandler

The event handler invoked once the PdfView has completed initialization.

Declaration
public event TypedEventHandler<PdfView, Document> InitializationCompletedHandler
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, Document>
| Improve this Doc View Source

OnDocumentOpened

The event handler invoked whenever a document is opened.

Declaration
public event TypedEventHandler<PdfView, Document> OnDocumentOpened
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, Document>
| Improve this Doc View Source

OnFileExported

This event handler is invoked whenever a document is exported successfully to a Windows.Storage.StorageFile.

Declaration
public event TypedEventHandler<PdfView, StorageFile> OnFileExported
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, Windows.Storage.StorageFile>
| Improve this Doc View Source

OnFileExportFailed

This event handler is invoked whenever a document failed to export to a Windows.Storage.StorageFile.

Declaration
public event TypedEventHandler<PdfView, Exception> OnFileExportFailed
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, System.Exception>
| Improve this Doc View Source

OnSuspendUnloading

The event handler is invoked whenever the PdfView is about to unload and suspends closing of the document. You must call Completed on the Windows.Foundation.Deferral once finished.

Declaration
public event TypedEventHandler<PdfView, Deferral> OnSuspendUnloading
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, Windows.Foundation.Deferral>
| Improve this Doc View Source

OnViewModeChange

Event handler for the PdfViewMode changes.

Declaration
public event TypedEventHandler<PdfView, PdfViewModeChange> OnViewModeChange
Event Type
Type Description
Windows.Foundation.TypedEventHandler<PdfView, PdfViewModeChange>