# how-to-replace-standard-pdf-viewer-command-with-custom-command **Repository Path**: mirrors_DevExpress/how-to-replace-standard-pdf-viewer-command-with-custom-command ## Basic Information - **Project Name**: how-to-replace-standard-pdf-viewer-command-with-custom-command - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: 17.2.6+ - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # How to replace a standard PDF Viewer control command with a custom command This example shows how to modify the existing PDF Viewer command functionality. All commands in the PDF Viewer are created using a command provider represented by the PdfCommandProvider class. You can substitute the default command provider with its descendant to create a custom command in place of the default command. Follow the steps below. 1. Create a custom command class (e.g., **CustomNextPageCommand**) that implements the **ICommand** interface. This interface exposes two methods: **CanExecute**, and **Execute**, and the **CanExecuteChanged** event that you need to implement. 2. Create a custom command provider class inherited from the PdfCommandProvider class. You need to override the required members (e.g., the **NextPageCommandInternal** property) to create an instance of the custom command class. So, instead of the default command, the custom command will be used by PdfViewerControl. 3. Use the created **CustomPdfCommandProvider** to substitute the default command provider, for example, to add the built-in NextPage item to PdfViewerControl's Ribbon.