Skip to content

Commit f306541

Browse files
Merge pull request #1121 from Syncfusion-Content/development
DOCINFRA-2341_merged_using_automation
2 parents e0181c0 + 6b720c2 commit f306541

6 files changed

Lines changed: 160 additions & 1716 deletions

WindowsForms-toc.html

Lines changed: 4 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
layout: post
3+
title: Enhance WinForms PdfViewer with WPF Features | WinForms | Syncfusion
4+
description: Learn how to integrate the WPF PdfViewer in Windows Forms to access advanced features like annotations, form filling, and signatures.
5+
platform: windowsforms
6+
control: PDF Viewer
7+
documentation: ug
8+
---
9+
# How to Add WPF PdfViewer Features to WinForms PdfViewer
10+
11+
To leverage the advanced features offered by the WPF PdfViewer, such as adding annotations, form filling, signatures, stamps, sticky notes, and more, you can [integrate the WPF PdfViewer into the Windows Forms]( https://support.syncfusion.com/kb/article/7882/how-to-host-pdf-viewer-in-windows-forms-application ) and take advantage of its extensive feature sets.
12+
13+
we can host a WPF PdfViewer control within a Windows Forms application using an ElementHost. By embedding the WPF PdfViewer, you can access advanced features available in the WPF control while maintaining a Windows Forms interface.
14+
To host the WPF PdfViewer in the winforms application follow the below steps,
15+
16+
1. Create an UserControl and add the below XAML code to it.
17+
18+
* Add the following Syncfusion namespace in XAML to make use of the WPF [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html)
19+
20+
~~~xaml
21+
<UserControl
22+
xmlns:PdfViewerUserControl="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF">
23+
</UserControl>
24+
~~~
25+
* Declare the WPF [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) in the XAML page.
26+
27+
~~~xaml
28+
<UserControl x:Class="SampleWF.PdfViewer"
29+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
30+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
31+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
32+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
33+
xmlns:local="clr-namespace:SampleWF"
34+
xmlns:Syncfusion="http://schemas.syncfusion.com/wpf"
35+
mc:Ignorable="d"
36+
xmlns:PdfView="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
37+
Loaded="UserControl_Loaded"
38+
>
39+
40+
<Grid>
41+
<PdfView:PdfViewerControl x:Name="pdfViewer"/>
42+
</Grid>
43+
</UserControl>
44+
~~~
45+
* Add the below line of codes in the code behind file.
46+
47+
{% tabs %}
48+
{% highlight c# %}
49+
50+
using System.Windows;
51+
using System.Windows.Controls;
52+
53+
namespace SampleWF
54+
{
55+
/// <summary>
56+
/// Interaction logic for PdfViewer.xaml
57+
/// </summary>
58+
public partial class PdfViewerUserControl : UserControl
59+
{
60+
public PdfViewer()
61+
{
62+
InitializeComponent();
63+
}
64+
65+
private void UserControl_Loaded(object sender, RoutedEventArgs e)
66+
{
67+
pdfViewer.Load(@"../../Data/Windows Store Apps Succinctly.pdf");
68+
}
69+
}
70+
}
71+
72+
{%endhighlight%}
73+
{% endtabs %}
74+
75+
2. Create an ElementHost object in the Form and add the created UserControl's object as child to the ElementHost object.
76+
77+
To do the above step follow the below procedures
78+
79+
{% tabs %}
80+
{% highlight c# %}
81+
82+
using System.Windows.Forms;
83+
using System.Windows.Forms.Integration;
84+
85+
namespace SampleWF
86+
{
87+
88+
public partial class Form1 : Form
89+
{
90+
ElementHost elementHost = null;
91+
public Form1()
92+
{
93+
InitializeComponent();
94+
95+
// Create the ElementHost control to host the WPF PdfViewer
96+
elementHost = new ElementHost();
97+
elementHost.AutoSize = true;
98+
elementHost.Size = panel1.Size;
99+
elementHost.Dock = DockStyle.Fill;
100+
// Adds the ElementHost to the panel1 control
101+
panel1.Controls.Add(elementHost);
102+
103+
// Create the WPF PdfViewer control and assign it as a child of ElementHost
104+
PdfViewerUserControl pdfViewerUserControl = new PdfViewerUserControl();
105+
// Embeds the PdfViewer into the ElementHost
106+
elementHost.Child = pdfViewerUserControl;
107+
108+
// Set additional visual properties for a seamless look and feel
109+
elementHost.Margin = new Padding(0, 0, 0, 0);
110+
elementHost.Region = new Region();
111+
elementHost.BackColor = System.Drawing.Color.White;
112+
}
113+
114+
// Set the form to maximized when it loads
115+
private void Form1_Load(object sender, System.EventArgs e)
116+
{
117+
this.WindowState = FormWindowState.Maximized;
118+
}
119+
}
120+
}
121+
122+
{%endhighlight%}
123+
{% endtabs %}
124+
125+
You can find the sample for you reference [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleWF920548313)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Essential Studio for Windows Forms 2024 Volume 4 Main Release Release Notes
3+
description: Essential Studio for Windows Forms 2024 Volume 4 Main Release Release Notes
4+
platform: windowsforms
5+
documentation: ug
6+
---
7+
8+
# Essential Studio for Windows Forms Release Notes
9+
10+
{% include release-info.html date="December 12, 2024" version="v28.1.33" %}
11+
12+
{% directory path: _includes/release-notes/v28.1.33 %}
13+
14+
{% include {{file.url}} %}
15+
16+
{% enddirectory %}

WindowsForms/System-Requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This section describes the system requirements to use Syncfusion Windows Forms C
3333
### Development Environment
3434

3535
* Microsoft Visual Studio 2015/2017/2019/2022
36-
* .NET Framework 4.0/4.6.2
36+
* .NET Framework 4.6.2
3737
* Lower Syncfusion .NET frameworks can be used in applications because they are compatible with .NET 4.7, .NET 4.7.1, .NET 4.7.2, and .NET 4.8. For example, in the application, the Syncfusion 4.6.2 .NET framework assembly can be referred to as 4.7 or higher target versions.
3838
* .NET 6.0, .NET 7.0, .NET 8.0, .NET 9.0.
3939

WindowsForms/dotnet-core-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In **Solution Explorer**, right-click on **Dependencies** and select **Add Refer
4545

4646
Now, **Reference Manager** dialog will be opened. Here click **Browse** and select the needed assemblies from the location mentioned in below note section. On selecting necessary assemblies, click **Add** and then click **Ok**. Now, required assemblies are added in to the project, like in the below screenshot.
4747

48-
N> You can get Syncfusion Windows Forms (.NET Core) controls assemblies from `netcoreapp3.0` folder in the following location - C:\Program Files (x86)\Syncfusion\Essential Studio\Windows\x.x.x.x\precompiledassemblies
48+
N> You can get Syncfusion Windows Forms (.NET Core) controls assemblies from `net6.0` folder in the following location - C:\Program Files (x86)\Syncfusion\Essential Studio\Windows\x.x.x.x\precompiledassemblies
4949

5050
![NETcore showing assembly](NETcore_images/NETcore_assembly.jpeg)
5151

0 commit comments

Comments
 (0)