How To Add URL link To PDF Document using PDF Mosaic SDK for .NET

This samples shows how to add a URL link to a document page. You need to use PDFURIAction class to add URL to the PDF document.

URL action

 

using PDFMosaic;
using System;

namespace UriAction2
{
    class UriAction2
    {
        static void Main()
        {
            PDFDocument pdf = new PDFDocument();
            pdf.Pages.Add(new PDFPage(PDFPaperFormat.A4));

            PDFURIAction urlAction = new PDFURIAction(new Uri(@"http://pdfmosaic.com/category/tools/"));

            PDFPushButton button = new PDFPushButton(20, 40, 120, 25, "btn1");
            button.Caption = "PDF Tools created with help of PDF Mosaic SDK";
            button.OnActivated = urlAction;
            button.Font.Size = 8;

            pdf.Pages[0].Annotations.Add(button);

            pdf.Save("AddURLAction.pdf", true);
        }
    }
}