Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfLinkAnnotationFacade.SetUri(String) Method

Sets a URI string associated with the annotation.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.2.Core.dll

NuGet Package: DevExpress.Pdf.Core

#Declaration

public void SetUri(
    string uri
)

#Parameters

Name Type Description
uri String

A URI string to which the link annotation refers.

#Remarks

The code sample below changes the URI associated with the link annotation:

using DevExpress.Pdf;
using System.Linq;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Demo.pdf");

    // Access the first page properties
    PdfPageFacade page = processor.DocumentFacade.Pages[0];

    // Retrieve all link annotations
    var linkAnnotations = page.Annotations.Where(annotation => annotation.Type == PdfAnnotationType.Link);
    foreach (PdfLinkAnnotationFacade linkAnnotation in linkAnnotations)
    {
        // Change URI of a specific annotation
        if (linkAnnotation.Name == "link1")
        {
            linkAnnotation.SetUri("https://docs.devexpress.com/");
        }
    }
    processor.SaveDocument("..\\..\\Result_1.pdf");
}
See Also