Class PdfLinkAnnotation
- Namespace
- PdfSharp.Pdf.Annotations
- Assembly
- PdfSharp.dll
Represents a link annotation.
public sealed class PdfLinkAnnotation : PdfAnnotation, ICloneable, IEnumerable<KeyValuePair<string, PdfItem?>>, IEnumerable
- Inheritance
-
PdfLinkAnnotation
- Implements
- Inherited Members
Constructors
PdfLinkAnnotation()
Initializes a new instance of the PdfLinkAnnotation class.
public PdfLinkAnnotation()
PdfLinkAnnotation(PdfDocument)
Initializes a new instance of the PdfLinkAnnotation class.
public PdfLinkAnnotation(PdfDocument document)
Parameters
document
PdfDocument
Methods
CreateDocumentLink(PdfRectangle, int, XPoint?)
Creates a link within the current document.
public static PdfLinkAnnotation CreateDocumentLink(PdfRectangle rect, int destinationPage, XPoint? point = null)
Parameters
rect
PdfRectangleThe link area in default page coordinates.
destinationPage
intThe one-based destination page number.
point
XPoint?The position in the destination page.
Returns
CreateDocumentLink(PdfRectangle, string)
Creates a link within the current document using a named destination.
public static PdfLinkAnnotation CreateDocumentLink(PdfRectangle rect, string destinationName)
Parameters
rect
PdfRectangleThe link area in default page coordinates.
destinationName
stringThe named destination’s name.
Returns
CreateDocumentLink(PdfRectangle, string, string, bool?)
Creates a link to an external PDF document using a named destination.
public static PdfLinkAnnotation CreateDocumentLink(PdfRectangle rect, string documentPath, string destinationName, bool? newWindow = null)
Parameters
rect
PdfRectangleThe link area in default page coordinates.
documentPath
stringThe path to the target document.
destinationName
stringThe named destination’s name in the target document.
newWindow
bool?True, if the destination document shall be opened in a new window. If not set, the viewer application should behave in accordance with the current user preference.
Returns
CreateEmbeddedDocumentLink(PdfRectangle, string, bool?)
Creates a link to an embedded document.
public static PdfLinkAnnotation CreateEmbeddedDocumentLink(PdfRectangle rect, string destinationPath, bool? newWindow = null)
Parameters
rect
PdfRectangleThe link area in default page coordinates.
destinationPath
stringThe path to the named destination through the embedded documents. The path is separated by '' and the last segment is the name of the named destination. The other segments describe the route from the current (root or embedded) document to the embedded document holding the destination. ".." references to the parent, other strings refer to a child with this name in the EmbeddedFiles name dictionary.
newWindow
bool?True, if the destination document shall be opened in a new window. If not set, the viewer application should behave in accordance with the current user preference.
Returns
CreateEmbeddedDocumentLink(PdfRectangle, string, string, bool?)
Creates a link to an embedded document in another document.
public static PdfLinkAnnotation CreateEmbeddedDocumentLink(PdfRectangle rect, string documentPath, string destinationPath, bool? newWindow = null)
Parameters
rect
PdfRectangleThe link area in default page coordinates.
documentPath
stringThe path to the target document.
destinationPath
stringThe path to the named destination through the embedded documents in the target document. The path is separated by '' and the last segment is the name of the named destination. The other segments describe the route from the root document to the embedded document. Each segment name refers to a child with this name in the EmbeddedFiles name dictionary.
newWindow
bool?True, if the destination document shall be opened in a new window. If not set, the viewer application should behave in accordance with the current user preference.
Returns
CreateFileLink(PdfRectangle, string)
Creates a link to a file.
public static PdfLinkAnnotation CreateFileLink(PdfRectangle rect, string fileName)
Parameters
rect
PdfRectanglefileName
string
Returns
CreateWebLink(PdfRectangle, string)
Creates a link to the web.
public static PdfLinkAnnotation CreateWebLink(PdfRectangle rect, string url)
Parameters
rect
PdfRectangleurl
string