Articles in this section
Category / Section

How to host PDF Viewer in windows forms application?

2 mins read

WinForms PDF viewer does not support adding or editing the annotations in PDF documents. As a workaround, the PDF viewer WPF control can be hosted in WF application that supports text markup and shape annotations in the PDF document. Refer to the following code sample.


// Declare the ElementHost variable
        ElementHost elementHost = null;
   // Wire up the Load event
            this.Load += new System.EventHandler(this.Form1_Load);
private void Form1_Load(object sender, System.EventArgs e)
            // Create the ElementHost control
            elementHost = new ElementHost();
            elementHost.AutoSize = true;
            elementHost.Size = panel1.Size;
            elementHost.Dock = DockStyle.Fill;
            PdfViewer wordEditor = new PdfViewer();
            elementHost.Child = wordEditor;
            elementHost.Margin = new Padding(0, 0, 0, 0);
            elementHost.Region = new Region();
            elementHost.BackColor = System.Drawing.Color.White;

Find the sample for your reference from the following link:


I hope you enjoyed learning about how to host PDF Viewer WPF in windows forms.

You can refer to our WinForms PDF Viewer feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms PDF Viewer documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms PDF Viewer and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Please sign in to leave a comment