- How to use a system font for rendering text
- Customize the GUI interaction of a radio button
- Customize the UI interaction of a check box
- How to reduce PDF file size
- How do I create graphics with Icc based colors
- Draw interactively on a PDF page
- Verify a custom digital PDF signature
- How do I use PDFControls.NET in a WPF application
- Fill PDF form
- Flatten PDF form
- Digitally sign a PDF form in C# or VB.NET
- C# render pdf in browser using MVC
- Add hyperlink to PDF
- Rotate a PDF page
- Change the formatting of a numeric field
- Override MouseWheel event
- How to create a thumbnail viewer
- EMF to PDF as vector image
- EMF to PDF as raster image
- Add a rubber stamp annotation with a custom icon
- Create a text annotation in PDF with rich text
- Read and write meta data from PDF
- Use multiple licenses
Add hyperlink to PDF
This code samples draws a hyperlink on an existing PDF page. The link is added as a link annotation. A URI action is associated with the mouse up event.
<![CDATA[using (FileStream fileIn = new FileStream("in.pdf", FileMode.Open, FileAccess.Read))
{
Document pdf = new Document(fileIn);
Page page = pdf.Pages[0];
Link link = new Link();
page.Links.Add(link);
// position link at the top-right corner
link.Height = 40;
link.Width = 100;
link.Left = page.Width - link.Width;
link.Bottom = page.Height - link.Height;
// add a UriAction to the mouse up event
link.MouseUpActions.Add(new UriAction("http://www.tallcomponents.com"));
using (FileStream fileOut = new FileStream("out.pdf", FileMode.Create, FileAccess.Write))
{
pdf.Write(fileOut);
}
}
Using fileIn As New FileStream("..\..\..\inputDocuments\BlueWater.pdf", FileMode.Open, FileAccess.Read)
Dim pdf As New Document(fileIn)
Dim page As Page = pdf.Pages(0)
Dim link As New Link()
page.Links.Add(link)
' position link at the top-right corner
link.Height = 40
link.Width = 100
link.Left = page.Width - link.Width
link.Bottom = page.Height - link.Height
' add a UriAction to the mouse up event
link.MouseUpActions.Add(New UriAction("http://www.tallcomponents.com"))
Using fileOut As New FileStream("..\..\out.pdf", FileMode.Create, FileAccess.Write)
pdf.Write(fileOut)
End Using
End Using

Download PDFControls.NET 2.0
We will send you a download link
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download
We have sent an email with a download link. Alternatively, you may want to use the NuGet package manager to install our library.
Nuget ID
Use the NugetID and start right away, or download the package and install it handmatically