Knowledgebase (2345)
Children categories
In this document, I will introduce you how to add Spire.DocViewer controls to Toolbox for WPF application.
How To
Right-click on the blank part of the Toolbox - "Add Tab" - name the new Tab "Spire WPF Controls":

Right-click on the blank part below "Spire WPF Controls" - "Choose Items" - "WPF Components" - "Browse" to the "Bin" folder - find the file "Spire.DocViewer.Wpf.dll" - "Open".

Click "OK". Then you have added controls to Toolbox successfully.

There are three ways to add Spire.DocViewer controls to Toolbox for Windows Forms application.
In this document, these ways are introduced. Hoping this document can be helpful to you.
The First Solution
Set the CheckBox below to the CheckState "Checked" during installing Spire.DocViewer.

After installment is completed, controls will be added to the Toolbox.
The Second Solution
If you have already installed Spire.DocViewer, you can also add controls this way:
"Start" - "Programs" - "e-iceblue" - "Spire.DocViewer" : Click "Add Controls into VS Toolbox".

Click "Add" to add controls.

The Third Solution
Right-click on the blank part of the Toolbox - "Add Tab" - name the new Tab "Spire Controls":

Right-click on the blank part below "Spire Controls" - "Choose Items" - ".NET Framework Components" - "Browse" to the "Bin" folder - find the file "Spire.DocViewer.Forms.dll" - "Open"

Click "OK". Then you have added controls to Toolbox successfully.

Spire.PDF for .NET is a PDF library which enables users to handle the whole PDF document with wide range of tasks in C#, VB.NET. Spire.PDF supports to create PDF links, extract PDF links, update PDF links and remove PDF links from a PDF file. This article mainly shows how to extract and update link from a PDF file in C#.
Before the steps and codes, please check the original PDF file at first:

Firstly we need to create a new Document object and load a PDF file which needs to extract and update the links. The links are represented as annotations in a PDF file. Before extract and update the link from a PDF file, we need to extract all the AnnotationsWidget objects.
The following code snippet shows you how to extract links from the PDF file.
//Load an existing PDF file
PdfDocument document = new PdfDocument();
document.LoadFromFile(@"..\..\output.pdf");
//Get the first page
PdfPageBase page = document.Pages[0];
//Get the annotation collection
PdfAnnotationCollection widgetCollection = page.Annotations;
//Verify whether widgetCollection is not null or not
if (widgetCollection.Count > 0)
{
foreach (var obj in widgetCollection)
{
//Get the TextWebLink Annotation
if (obj is PdfTextWebLinkAnnotationWidget)
{
PdfTextWebLinkAnnotationWidget link = obj as PdfTextWebLinkAnnotationWidget;
The following code snippet shows you how to update the link in PDF file
//Change the url of TextWebLink Annotation
link.Url = "http://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html";
//Saves PDF document to file.
document.SaveToFile("sample.pdf");
This picture will show you the link has been updated in the PDF file.
