We’ve created and updating regularly our sample code library so you may quickly learn PDF viewer control hosted in WPF and the step-by-step process in C#. PDF viewer control hosted in WPF in C# can be implemented with ByteScout PDF Viewer SDK. ByteScout PDF Viewer SDK is the visual component that you can use to quickly create your own pdf viewer application or add pdf vieweing functionality into your existing app. into your WinForms application. Includes support for selection using mouse, returns coordinates, you may add custom painting on top of pdf displayed.
You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. This C# sample code should be copied and pasted into your application’s code editor. Then just compile and run it to see how it works. Enjoy writing a code with ready-to-use sample C# codes to add PDF viewer control hosted in WPF functions using ByteScout PDF Viewer SDK in C#.
ByteScout PDF Viewer SDK is available as free trial. You may get it from our website along with all other source code samples for C# applications.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using System.Windows; namespace PdfViewerInWpf { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { } }
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
using System; using System.Drawing; using System.Windows; namespace PdfViewerInWpf { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { // Load a sample document on startup pdfViewerControl1.InputFile = "sample.pdf"; } private void menuItemOpen_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog { Filter = "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*" }; bool? result = dlg.ShowDialog(); if (result == true) pdfViewerControl1.InputFile = dlg.FileName; } } }
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples