Skip to main content

PdfGraphics.AddLinkToUri(RectangleF, Uri) Method

Adds a link to a URI at the specified page rectangle.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.1.Drawing.dll


public void AddLinkToUri(
    RectangleF linkArea,
    Uri uri


Name Type Description
linkArea RectangleF

A page area (in the world coordinate system) where you can add a link.

uri Uri

A Uri object that is the link URI.


This method specifies the page area on which you can click to refer to the URI defined by the uri parameter.

To draw a link on the PDF page, use one of the following methods:

PdfGraphics.AddToPageForeground, PdfGraphics.AddToPageBackground
These methods allow you to draw content on an existing page.
Draws content on a new page.


Coordinate system transformations (e.g., system rotation) are not taken into account when the AddLinkToUri method is called.

The code sample below demonstrates how to use the PdfGraphics.AddLinkToUri method to create a link to a URI.

Add a Link to the Uri

View Example

using System;
using DevExpress.Pdf;
using System.Drawing;

namespace AddLinkToUri {
    class Program {
        static void Main(string[] args) {

            using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {

                // Create an empty document.

                // Create and draw graphics.
                using (PdfGraphics graphics = processor.CreateGraphics()) {

                    // Create a link to URI specifying link area and URI.
                    graphics.AddLinkToUri(new RectangleF(310, 150, 180, 15), new Uri(""));

                    // Render a page with graphics.
                    processor.RenderNewPage(PdfPaperSize.Letter, graphics);

        static void DrawGraphics(PdfGraphics graphics) {

            // Draw a text line on the page. 
            using (Font font = new Font("Arial", 10)) {
                SolidBrush blue = (SolidBrush)Brushes.Blue;
                graphics.DrawString("", font, blue, 310, 150);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddLinkToUri(RectangleF, Uri) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also