Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ documentation: ug

[WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) control allows users to navigate to the bookmarks present in the loaded PDF document at the UI level.

## Steps to perform bookmark navigation in PdfViewerControl.
## Steps to perform bookmark navigation in PdfViewerControl

1. Open the bookmarks contained PDF document to enable the bookmark button in [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html).
1. Open a PDF document containing bookmarks to enable the bookmark button in [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html).
2. Clicking on the bookmark button from the left pane will list the bookmarks present in the PDF document.
3. To jump to a specific section, click its name in the bookmark pane.
4. If the bookmark has some children, you can explore them by clicking on the “+” button to the left of it.
4. If the bookmark has child bookmarks, you can explore them by clicking on the “+” button to the left of it.

![Bookmark Button in WinForms PDF Viewer toolbar](Bookmark_Navigation_images/Bookmark_Navigation_images1.png)

Expand Down Expand Up @@ -93,7 +93,7 @@ private void PdfViewer_DocumentLoaded(object sender, EventArgs args)
{% endhighlight %}
{% endtabs %}

N> The sample project to perform the operation is available in the [GitHub](https://github.com/SyncfusionExamples/WinForms-PDFViewer-Examples/tree/master/Bookmarks Navigation/PDFBookmarks).
N> The sample project to perform the operation is available in the [GitHub](https://github.com/SyncfusionExamples/WinForms-PDFViewer-Examples/tree/master/Bookmarks%20Navigation/PDFBookmarks).

## Enabling and disabling bookmark feature

Expand Down Expand Up @@ -127,6 +127,6 @@ pdfViewerControl.IsBookmarkEnabled = false
{% endhighlight %}
{% endtabs %}

The following screenshot shown the Bookmark navigation in PDF Viewer.
The following screenshot shows the Bookmark navigation in PDF Viewer.

![Bookmark Navigation](Bookmark_Navigation_images/Bookmark_Navigation_images2.png)
24 changes: 12 additions & 12 deletions Document-Processing/PDF/PDF-Viewer/winforms/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ You can create a **Windows Forms Application** using Visual Studio via [Microsof

## Assemblies Deployment

To add a WinForms PdfViewer component to your application by installing it via NuGet packages(Recommended) or by manually adding the required assemblies to the project.
To add a WinForms PdfViewer component to your application by installing it via NuGet packages (Recommended) or by manually adding the required assemblies to the project.

{% tabcontents %}
{% tabcontent NuGet Package %}

The [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) (PdfViewerControl) and dependent assemblies can be found from the below location in your machine.
The [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) (PdfViewerControl) and dependent assemblies can be found at the following location on your machine.

### Install Syncfusion<sup style="font-size:70%">&reg;</sup> Windows Forms PdfViewer NuGet packages

Expand All @@ -38,7 +38,7 @@ To add **Windows Forms PdfViewer** component in the application, open the NuGet

### Add Syncfusion® WinForms PdfViewer Assemblies

Below table describes, list of assemblies required to be added in project when the [WinForms PdfViewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) control is used in your application.
The table below lists the required assemblies to be added in project when the [WinForms PdfViewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) control is used in your application.

<table>
<tr>
Expand All @@ -60,24 +60,24 @@ This library is responsible for Pdfium integration and image generation, enhanci
<tr>
<td>
Syncfusion.PdfViewer.Windows.dll</td><td>
This component contains the rendering area and other related UI elements.</td></tr>
This assembly contains the rendering area and other related UI elements.</td></tr>
<tr>
<td>
Syncfusion.Shared.Base.dll</td><td>
This component contains various UI controls (ColorPickerPalette and Numeric UpDown) that are used in the PDF Viewer.</td></tr>
This assembly contains various UI controls (ColorPickerPalette and Numeric UpDown) that are used in the PDF Viewer.</td></tr>
</table>

{% endtabcontent %}

{% endtabcontents %}

N>* Starting with version 23.1.x, Syncfusion PdfToImageConverter is necessary for PdfViewer applications.
N>* Starting with v16.2.0.x, if you reference Syncfusion<sup>&reg;</sup>; assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion&reg; license key in your Windows Forms application to use our components.
N>* Starting with version 16.2.0.x, if you reference Syncfusion<sup>&reg;</sup>; assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to [this licensing guide](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion&reg; license key in your Windows Forms application to use our components.


## Add Windows Forms PdfViewer component

WinForms PdfViewer control can be added to an application either through the designer (XAML) or programmatically using code.
WinForms PdfViewer control can be added to an application either through the Windows Forms Designer or programmatically using code.

{% tabcontents %}
{% tabcontent Via Designer %}
Expand All @@ -90,7 +90,7 @@ WinForms PdfViewer control can be added to an application either through the des

![Windows forms pdfviewer displays properties window of control](Getting-Started_images/Getting-Started_img2.png)

3. This will add the instance 'pdfViewerControl1' to the Designer cs file. The PDF can be loaded in the Form1.cs file using the [Load](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_Forms_PdfViewer_PdfViewerControl_Load_System_String_) method.
3. This will add the instance 'pdfViewerControl1' to the Designer.cs file. The PDF can be loaded in the Form1.cs file using the [Load](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_Forms_PdfViewer_PdfViewerControl_Load_System_String_) method.

{% tabs %}
{% highlight c# tabtitle="C#" %}
Expand Down Expand Up @@ -129,7 +129,7 @@ Imports Syncfusion.Windows.Forms.PdfViewer
{% endtabs %}


2. Create PdfViewerControl instance and load the PDF in Form1.cs.
2. Create a PdfViewerControl instance and load the PDF inside Constructor in Form1.cs. Also place the sample PDF document in the project folder.

{% tabs %}
{% highlight c# tabtitle="C#" %}
Expand All @@ -143,7 +143,7 @@ Controls.Add(pdfViewerControl1);
pdfViewerControl1.Dock = DockStyle.Fill;

//Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf");
pdfViewerControl1.Load(@"../../Sample.pdf");

{% endhighlight %}
{% highlight vb tabtitle="VB.NET" %}
Expand All @@ -157,7 +157,7 @@ Controls.Add(pdfViewerControl1)
pdfViewerControl1.Dock = DockStyle.Fill

'Loading the document in the PdfViewerControl
pdfViewerControl1.Load("Sample.pdf")
pdfViewerControl1.Load(@"../../Sample.pdf")

{% endhighlight %}
{% endtabs %}
Expand All @@ -170,7 +170,7 @@ pdfViewerControl1.Load("Sample.pdf")

N>[View Sample in GitHub.](https://github.com/syncfusion/pdf-viewer-sdk-winforms-demos/tree/master/pdfviewer/Getting%20Started/Pdf%20Viewer%20Demo)

N> You can also explore our [WinForms PDF Viewer example](https://github.com/syncfusion/winforms-demos/tree/master/pdfviewer) that shows you how to render and configure the PDF Viewer. Looking for the full WinForms PDF Viewer component overview, features, pricing, and documentation? Visit the [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) page.
N> You can also explore our [WinForms PDF Viewer example](https://github.com/syncfusion/pdf-viewer-sdk-winforms-demos/tree/master/pdfviewer) that shows you how to render and configure the PDF Viewer. Looking for the full WinForms PDF Viewer component overview, features, pricing, and documentation? Visit the [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) page.

## See Also
- [Working with PdfViewerControl](./working-with-pdf-viewer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ string fileName = pdfViewer.DocumentInformation.FileName;
'Initialize the PDF Viewer
pdfViewer As New PdfViewerControl()
'Loads the PDF document in PDF Viewer
pdfViewer.Load("../../Data/Barcode.pdf")
pdfViewer.Load("input.pdf")

'Gets the filename of loaded PDF document
Dim fileName As String = pdfViewer.DocumentInformation.FileName
Expand Down Expand Up @@ -60,7 +60,7 @@ string filePath = pdfViewer.DocumentInformation.FilePath;
'Initialize the PDF Viewer
pdfViewer As New PdfViewerControl()
'Loads the PDF document in PDF Viewer
pdfViewer.Load("../../Data/Barcode.pdf")
pdfViewer.Load("input.pdf")

'Gets the file path of loaded PDF document
Dim filePath As String = pdfViewer.DocumentInformation.FilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ control: PdfViewerControl
documentation: ug
---

# Hide or disable the Toolbar Button
# Hide or disable Toolbar Buttons

In the WinForms PDF Viewer, there is an API called [ToolbarSettings](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.DocumentToolbarSettings.html) that allows you to access and manage toolbar buttons. To hide a specific button, use the IsVisible property associated with that button. By setting IsVisible to false, the button will be hidden from the toolbar.

The following code snippet demonstrates how to hide the Open and Save buttons in the WinForms PDF Viewer control.

{% tabs %}
{%highlight c#%}
//Load the document ot PDFViewer control
pdfviewerControl.Load("Input.pdf");
//Change the visibility of open and save button
//Load the document to PDFViewer control
pdfviewerControl.Load("Input.pdf");

//Change the visibility of Open and Save buttons
pdfviewerControl.ToolbarSettings.OpenButton.IsVisible = false;
pdfviewerControl.ToolbarSettings.SaveButton.IsVisible = false;

Expand All @@ -35,6 +35,6 @@ pdfviewerControl.ToolbarSettings.SaveButton.IsVisible = False
{%endhighlight%}
{% endtabs %}

The following is the image of a PDF document which hides the Open and Save button in Toolbar.
The following image shows the PDF Viewer with the Open and Save buttons hidden in the toolbar.

![Hide or disable Toolbar Buttons in Windows PdfViewer](Hide-or-Disabling-Toolbar-Buttons_images/Hide-or-Disabling-Toolbar-Button_img1.png)
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ documentation: ug
---
# How to Add WPF PdfViewer Features to WinForms PdfViewer

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.
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.

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.
You 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.

## Steps to host the WPF PdfViewer in the WinForms application

1. Add an WPF UserControl and install the [Syncfusion.PdfViewer.WPF](https://www.nuget.org/packages/Syncfusion.PdfViewer.WPF) NuGet package to your WinForms application.
1. Add a WPF UserControl and install the [Syncfusion.PdfViewer.WPF](https://www.nuget.org/packages/Syncfusion.PdfViewer.WPF) NuGet package to your WinForms application.

2. Add the following Syncfusion&reg; namespace in XAML to make use of the WPF [PdfViewerControl.](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html)
2. Add the following Syncfusion&reg; namespace in XAML to make use of the WPF [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html).

~~~xaml
<UserControl
Expand All @@ -36,13 +36,15 @@ we can host a WPF PdfViewer control within a Windows Forms application using an

{% tabs %}
{% highlight c# %}
using System.Windows;
using System.Windows.Controls;

/// <summary>
/// Interaction logic for PdfViewer.xaml
/// Interaction logic for PdfViewerUserControl.xaml
/// </summary>
public partial class PdfViewerUserControl : UserControl
{
public PdfViewer()
public PdfViewerUserControl()
{
InitializeComponent();
}
Expand All @@ -56,7 +58,7 @@ we can host a WPF PdfViewer control within a Windows Forms application using an
{%endhighlight%}
{% endtabs %}

5. Add a panel to the form. Create an ElementHost object in the Form and add the created UserControl's object as child to the ElementHost object. Add the elementHost as a child to the panel as mentioned below.
5. Add a panel to the form. Create an ElementHost object in the Form and add the created UserControl's instance as a child of the ElementHost object. Add the elementHost as a child of the panel as mentioned below.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -104,4 +106,4 @@ namespace SampleWF
{%endhighlight%}
{% endtabs %}

You can find the complete sample in the [Github](https://github.com/SyncfusionExamples/WinForms-PDFViewer-Examples/tree/master/How-to/Host-WPFPdfViewer-in-Winforms/HostedPdfViewer) for your reference.
You can find the complete sample in the [GitHub](https://github.com/SyncfusionExamples/WinForms-PDFViewer-Examples/tree/master/How-to/Host-WPFPdfViewer-in-Winforms/HostedPdfViewer) for your reference.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ documentation: ug

# Get a mouse position to the page

The [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html) notifies, you when performing the mouse click and mouse move operations in the PDF pages through the `PageClicked` and `PageMouseMove` events respectively. It also provides information such as the page index and mouse position to the page.
The [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html) notifies you when performing the mouse click and mouse move operations in the PDF pages through the `PageClicked` and `PageMouseMove` events respectively. It also provides information such as the page index and mouse position on the page.

## Page clicked event

The `PageClicked` event occurs when performing the mouse click operation on a PDF page, which is being displayed in the viewer. It provides the page index and the mouse position information through the [PageClickedEventArgs](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PageClickedEventArgs.html) The following code shows how to wire the event in [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html).
The `PageClicked` event occurs when performing the mouse click operation on a PDF page, which is being displayed in the viewer. It provides the page index and the mouse position information through the [PageClickedEventArgs](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PageClickedEventArgs.html). The following code shows how to wire the event in [PdfViewerControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html).

{% tabs %}
{% highlight c# %}
Expand All @@ -34,13 +34,13 @@ namespace PageMouseEventsDemo
pdfViewerControl1.PageClicked += PdfViewer_PageClicked;
}
#endregion
#region Event
void PdfViewer_PageClicked(object sender, PageClickedEventArgs args)
{
//Find the page number in which the mouse clicks occurred.
int currentPage = args.PageIndex;
//Find the mouse position on above the document page
//Find the mouse position on the document page.
System.Drawing.PointF mousePosition = args.Position;
}
#endregion
Expand Down Expand Up @@ -68,16 +68,16 @@ namespace PageMouseEventsDemo
//Load the PDF file.
pdfViewerControl1.Load("../../Data/HTTP Succinctly.pdf");
//Wire the `PageMouseMove` event.
pdfViewerControl1.PageMouseMove += Pdfviewer_PageMouseMove;
pdfViewerControl1.PageMouseMove += PdfViewer_PageMouseMove;
}
#endregion
#region Event
void Pdfviewer_PageMouseMove(object sender, PageMouseMoveEventArgs args)
void PdfViewer_PageMouseMove(object sender, PageMouseMoveEventArgs args)
{
//Find the page number in which the mouse clicks occurred.
//Find the page number in which the mouse moves occurred.
int currentPage = args.PageIndex;
//Find the mouse position on above the document page
//Find the mouse position on the document page.
System.Drawing.PointF mousePosition = args.Position;
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ documentation: UG

# Working with Interaction Modes in Windows Forms PDF Viewer

The [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) supports following cursor modes for easy interaction with the PDF documents:
The [WinForms PDF Viewer](https://www.syncfusion.com/pdf-viewer-sdk/winforms-pdf-viewer) supports the following cursor modes for easy interaction with the PDF documents:

* Selection mode
* Panning mode
Expand Down
Loading