AutoLink
Represents a link with a destination or action.
public class AutoLink : Link, IAnnotation, IArea, ICoordinate, ISerializable
Public Class AutoLink
Inherits Link
Implements IAnnotation, IArea, ICoordinate, ISerializable
Inheritance: ObjectPageElementTaggablePageElementLinkAutoLink
Implements: IAnnotation, IArea, ICoordinate, ISerializable
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
The following example shows Auto Link placement.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create an Auto Layout
Dim MyAutoLayout As AutoLayout = New AutoLayout(PageSize.A4, PageOrientation.Portrait, 50)
' Create a Text Area
Dim label As TextArea = MyAutoLayout.AddText("TextArea Page Element:")
label.TextColor = RgbColor.Red
' Create an UrlAction
Dim action As UrlAction = New UrlAction("http://www.mydomain.com")
' Call AddAutoLink method from autoLayout object to get the link
Dim link As AutoLink = MyAutoLayout.AddAutoLink("CLICK HERE", action)
link.Label.TextColor = RgbColor.Blue
link.Label.FontSize = 18
' Call GetDocument method from autoLayout object to get the document
Dim document As Document = MyAutoLayout.GetDocument()
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create an Auto Layout
AutoLayout autoLayout = new AutoLayout(PageSize.A4, PageOrientation.Portrait, 50);
// Create a Text Area
TextArea label = autoLayout.AddText("Link Page Element:", false, 30);
label.TextColor = RgbColor.Red;
// Create an UrlAction
UrlAction action = new UrlAction("http://www.mydomain.com");
// Call AddAutoLink method from autoLayout object to get the link
AutoLink link = autoLayout.AddAutoLink("CLICK HERE", action);
link.Label.TextColor = RgbColor.Blue;
link.Label.FontSize = 18;
// Call GetDocument method from autoLayout object to get the document
Document document = autoLayout.GetDocument();
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This class can be used to place links on the PDF.
NOTE: This page element cannot be used within a table cell, or transformation group.Properties
Action | Gets the Action to be taken by the link. (Inherited from Link) |
AlternateDescription | Gets or sets the alternate description of the link. (Inherited from Link) |
Height | Gets or sets the height of the link. (Inherited from Link) |
ID | Gets or sets the ID of the page element. (Inherited from PageElement) |
IgnoreMargins | Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement) |
Label | Gets or Sets the Label for the link. |
RelativeTo | Gets and sets placement of the page element on the page. (Inherited from PageElement) |
Tag | Gets or sets the structure element of the link. (Inherited from Link) |
TagOrder | Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement) |
Width | Gets or sets the width of the link. (Inherited from Link) |
X | Gets or sets the X coordinate of the link. (Inherited from Link) |
Y | Gets or sets the Y coordinate of the link. (Inherited from Link) |
Methods
Draw(PageWriter) | Draws the link to the given PageWriter object. |
DrawAnnotation(DocumentWriter) | Draws the link to the given DocumentWriter object. (Inherited from Link) |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |