PDF Mosaic: How to add URL link to PDF document using PDF Mosaic SDK for .NET


Home       Features       Download       Tutorial       Version History       License       PDF Mosaic Blog       Source Code

 

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

Use PDFURIAction class to add URL to the PDF document
 

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(@"https://www.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);
        }
    }
}

 


Home       Features       Download       Tutorial       Version History       License       PDF Mosaic Blog       Source Code