Integrate WebViewer into a WinForms Project

Microsoft Edge's WebView2 control allows embedding web technologies (HTML, CSS, and JavaScript) in a WinForms project. It uses Microsoft Edge as the rendering engine to display a WebViewer iFrame component, which can view, annotate, and manipulate PDFs and other documents.

WebViewer provides a slick out-of-the-box responsive UI that enables you to view, annotate and manipulate PDFs and other document types inside any web project.

Click the button below to view the full project in GitHub.

1<html>
2<head>
3 <title>Basic WebViewer</title>
4 <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
5 <!-- Import WebViewer as a script tag -->
6 <script src='webviewer.min.js'></script>
7</head>
8<body style="margin: 0;">
9 <div id='viewer' style='width: 100vw; height: 100vh; margin: 0 auto; padding: 0;'></div>
10 <script>
11 WebViewer.Iframe({
12 path: 'lib', // path to the Apryse 'lib' folder on your server
13 initialDoc: 'WebviewerDemoDoc.pdf',
14 //licenseKey: 'KEY'
15 }, document.getElementById('viewer'))
16 .then(instance => {
17 console.log(instance);
18 });
19 </script>
20</body>
21</html>

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales