Click or drag to resize

PdfViewer Methods

The PdfViewer type exposes the following members.

Methods
 NameDescription
Public methodClose Releases the resources used by this control
Public methodCloseDocument Closes the document displayed in the viewer.
Public methodDispose Releases the resources used by this control (the browser instance of the viewer).
Public methodFind(String) Searches the displayed document for a text (not case sensitive, also inside words). See Find(String, Boolean, Boolean).
Public methodFind(String, Boolean, Boolean) Searches the displayed document for a text, highlights every match and scrolls the first match from the current page on into view. SearchCompleted is raised with the number of matches when the whole document is searched. An empty text removes the highlights of the previous search.
Public methodFindNext Selects the next match of the last search (after the last match, the first one) and scrolls it into view. SearchCompleted is raised with the selected match.
Public methodFindPrevious Selects the previous match of the last search (before the first match, the last one) and scrolls it into view. SearchCompleted is raised with the selected match.
Public methodStatic memberGetPageCount(Stream) A fast method to obtain the page count of a specified PDF document.
Public methodStatic memberGetPageCount(String) A fast method to obtain the page count of a specified PDF document.
Public methodGoBackwardStack Goes to the previous view in the navigation history (for example back from a link), if it exists.
Public methodGoForwardStack Goes to the next view in the navigation history, if it exists.
Public methodGoToFirstPage Goes to the first page in the document.
Public methodGoToLastPage Goes to the last page in the document.
Public methodGoToNextPage Goes to the next page in the document, if it exists.
Public methodGoToPreviousPage Goes to the previous page in the document, if it exists.
Public methodStatic memberInstallWebView2Runtime Installs the Evergreen Microsoft Edge WebView2 Runtime for the current user with Microsoft's installer (WebView2BootstrapperPath, run silently; it downloads the runtime) and waits for it, for up to 5 minutes. Returns true when the installer succeeded and the runtime is installed. Call it from a background thread: it blocks while the runtime is installed.
Public methodLoadBytes Opens and displays the PDF document in the specified byte array.
Public methodLoadFile Opens and displays the specified PDF file.
Public methodLoadStream Opens and displays the PDF document in the specified stream. The stream is read when the method is called.
Protected methodOnCurrentPageChanged Raises the CurrentPageChanged event.
Protected methodOnDocumentLoaded Raises the DocumentLoaded event.
Protected methodOnLoadError Raises the LoadError event.
Protected methodOnPasswordRequired Raises the PasswordRequired event.
Protected methodOnSearchCompleted Raises the SearchCompleted event.
Public methodPrint Prints the document according to the options selected in the print dialog. This method returns immediately, even if the printing has not completed. NOTE: If security settings do not allow printing, this method will be ignored.
Public methodPrintAll Prints the entire document on the default printer without displaying a dialog. This method returns immediately, even if the printing has not completed. Use PrintAsync(Int32, Int32, String) to know the result.
Public methodPrintAllFit Prints the entire document on the default printer without displaying a dialog. This method returns immediately, even if the printing has not completed.
Public methodPrintAsync Prints pages of the document without displaying a dialog.
Public methodPrintPages Prints the specified pages on the default printer without displaying a dialog. This method returns immediately, even if the printing has not completed.
Public methodPrintPagesFit Prints the specified pages on the default printer without displaying a dialog. This method returns immediately, even if the printing has not completed.
Public methodPrintWithDialog Prints the document according to the options selected in the print dialog. This method returns immediately, even if the printing has not completed. NOTE: If security settings do not allow printing, this method will be ignored.
Public methodReloadPdfDocument Call this method to reload the currently loaded PDF document after changing the PdfViewerPreferences or the PdfSecurityOptions.
Public methodSetCurrentHighlight Highlights the specified rectangle on the current page. A rectangle with no width or height removes the highlight.
Public methodSetCurrentPage Goes to the specified page in the document.
Public methodSetLayoutMode Sets the layout mode for a page view according to the specified string.
Public methodSetNamedDest Changes the page view to the named destination in the specified string.
Public methodSetPageMode Sets the page mode according to the specified string.
Public methodSetShowScrollbars Determines whether scrollbars will appear in the document view.
Public methodSetShowToolbar Determines whether the toolbar will appear in the viewer.
Public methodSetView Sets the view of a page according to the specified string.
Public methodSetViewRect Scrolls and zooms the current page so that the specified rectangle fills the view.
Public methodSetViewScroll Sets the view of a page according to the specified string, and scrolls the page by the specified offset.
Public methodSetZoom Sets the magnification according to the specified value.
Public methodSetZoomScroll Sets the magnification according to the specified value, and scrolls the current page so that the specified point is at the top left corner of the view.
Top
See Also