Knowledgebase (2330)
Children categories
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.

PDF Bookmarks is widely used to help us locate and link to points that we want to go. Spire.PDF for .NET, a powerful PDF component, not only enables developers to add bookmarks, get bookmark information, but also helps us to remove the bookmarks that we want. This article will show you how to delete bookmark from the PDF document in C# easily.
First, check the PDF document with bookmarks.

Here comes to the steps of how to remove the bookmarks in C#.
- Download Spire.PDF for .NET and install it correctly. The Spire.PDF installation is clean, professional and wrapped up in a MSI installer.
- Add Spire.Pdf.dll as reference in the downloaded Bin folder though the below path: "..\Spire.Pdf\Bin\NET4.0\ Spire.Pdf.dll".
- Check the code snippet of how to delete the bookmarks. With Spire.PDF.NET, we can remove both the particular bookmark and remove all the bookmarks at one time.
using Spire.Pdf;
namespace DeletePDFBookmark
{
class Program
{
static void Main(string[] args)
{
//Create a new PDF document and load from the file.
PdfDocument document = new PdfDocument();
document.LoadFromFile(@"D:\Bookmark.pdf");
//remove the first bookmark
document.Bookmarks.RemoveAt(0);
//remove all bookmarks
document.Bookmarks.Clear();
//save the document to file.
document.SaveToFile("result.pdf");
}
}
}
Please check the effective screenshots:

