PDF Mosaic: How to add URI action in PDF document


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

 

This sample shows how to create a URI action.

A URI action causes a URI (Uniform Resource Identifier) to be resolved.

using PDFMosaic;
using System;
 
namespace UriAction
{
    class UriAction
    {
        static void Main()
        {
            PDFDocument document = new PDFDocument();
            PDFPage page = new PDFPage(PDFPaperFormat.A4);
 
            PDFURIAction action = new PDFURIAction(new Uri("https://www.pdfmosaic.com/"));
            PDFPushButton button = new PDFPushButton(20, 40, 100, 20, "btn1");
            button.Caption = "PDF Mosaic site";
            button.OnActivated = action;
            button.Font.Size = 8;
 
            page.Annotations.Add(button);
 
            document.Pages.Add(page);
            document.Save("UriAction.pdf", true);
        }
    }
}

 


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