Table of Contents

Class PdfAnnotation

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

A PdfAnnotation is a note that is associated with a page. @see PdfDictionary

public class PdfAnnotation : PdfDictionary
Inheritance
PdfAnnotation
Derived
Inherited Members

Constructors

PdfAnnotation(PdfWriter, float, float, float, float, PdfAction)

Constructs a new PdfAnnotation of subtype link (Action).

public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action)

Parameters

writer PdfWriter
llx float
lly float
urx float
ury float
action PdfAction

PdfAnnotation(PdfWriter, float, float, float, float, PdfString, PdfString)

Constructs a new PdfAnnotation of subtype text.

public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfString title, PdfString content)

Parameters

writer PdfWriter
llx float
lly float
urx float
ury float
title PdfString
content PdfString

PdfAnnotation(PdfWriter, Rectangle)

constructors

public PdfAnnotation(PdfWriter writer, Rectangle rect)

Parameters

writer PdfWriter
rect Rectangle

Fields

AaBlur

public static readonly PdfName AaBlur

Field Value

PdfName

AaDown

public static readonly PdfName AaDown

Field Value

PdfName

AaEnter

public static readonly PdfName AaEnter

Field Value

PdfName

AaExit

public static readonly PdfName AaExit

Field Value

PdfName

AaFocus

public static readonly PdfName AaFocus

Field Value

PdfName

AaJsChange

public static readonly PdfName AaJsChange

Field Value

PdfName

AaJsFormat

public static readonly PdfName AaJsFormat

Field Value

PdfName

AaJsKey

public static readonly PdfName AaJsKey

Field Value

PdfName

AaJsOtherChange

public static readonly PdfName AaJsOtherChange

Field Value

PdfName

AaUp

public static readonly PdfName AaUp

Field Value

PdfName

Annotation

protected bool Annotation

Field Value

bool

AppearanceDown

public static readonly PdfName AppearanceDown

Field Value

PdfName

AppearanceNormal

public static readonly PdfName AppearanceNormal

Field Value

PdfName

AppearanceRollover

public static readonly PdfName AppearanceRollover

Field Value

PdfName

FLAGS_HIDDEN

public const int FLAGS_HIDDEN = 2

Field Value

int

FLAGS_INVISIBLE

public const int FLAGS_INVISIBLE = 1

Field Value

int

FLAGS_LOCKED

public const int FLAGS_LOCKED = 128

Field Value

int

FLAGS_NOROTATE

public const int FLAGS_NOROTATE = 16

Field Value

int

FLAGS_NOVIEW

public const int FLAGS_NOVIEW = 32

Field Value

int

FLAGS_NOZOOM

public const int FLAGS_NOZOOM = 8

Field Value

int

FLAGS_PRINT

public const int FLAGS_PRINT = 4

Field Value

int

FLAGS_READONLY

public const int FLAGS_READONLY = 64

Field Value

int

FLAGS_TOGGLENOVIEW

public const int FLAGS_TOGGLENOVIEW = 256

Field Value

int

Form

protected bool Form

Field Value

bool

HighlightInvert

public static readonly PdfName HighlightInvert

Field Value

PdfName

HighlightNone

public static readonly PdfName HighlightNone

Field Value

PdfName

HighlightOutline

public static readonly PdfName HighlightOutline

Field Value

PdfName

HighlightPush

public static readonly PdfName HighlightPush

Field Value

PdfName

HighlightToggle

public static readonly PdfName HighlightToggle

Field Value

PdfName

MARKUP_HIGHLIGHT

public const int MARKUP_HIGHLIGHT = 0

Field Value

int

MARKUP_SQUIGGLY

attributevalue

public const int MARKUP_SQUIGGLY = 3

Field Value

int

MARKUP_STRIKEOUT

public const int MARKUP_STRIKEOUT = 2

Field Value

int

MARKUP_UNDERLINE

public const int MARKUP_UNDERLINE = 1

Field Value

int

Reference

protected PdfIndirectReference Reference

Field Value

PdfIndirectReference

Used

Holds value of property used.

protected bool Used

Field Value

bool

Writer

protected PdfWriter Writer

Field Value

PdfWriter

templates

protected INullValueDictionary<PdfTemplate, object> templates

Field Value

INullValueDictionary<PdfTemplate, object>

Properties

Action

public PdfAction Action { set; }

Property Value

PdfAction

AppearanceState

public string AppearanceState { set; }

Property Value

string

Border

public PdfBorderArray Border { set; }

Property Value

PdfBorderArray

BorderStyle

public PdfBorderDictionary BorderStyle { set; }

Property Value

PdfBorderDictionary

Color

public BaseColor Color { set; }

Property Value

BaseColor

DefaultAppearanceString

public PdfContentByte DefaultAppearanceString { set; }

Property Value

PdfContentByte

Flags

public int Flags { set; }

Property Value

int

IndirectReference

public PdfIndirectReference IndirectReference { get; }

Property Value

PdfIndirectReference

Layer

Sets the layer this annotation belongs to.

public IPdfOcg Layer { set; }

Property Value

IPdfOcg

MkAlternateCaption

public string MkAlternateCaption { set; }

Property Value

string

MkAlternateIcon

public PdfTemplate MkAlternateIcon { set; }

Property Value

PdfTemplate

MkBackgroundColor

public BaseColor MkBackgroundColor { set; }

Property Value

BaseColor

MkBorderColor

public BaseColor MkBorderColor { set; }

Property Value

BaseColor

MkNormalCaption

public string MkNormalCaption { set; }

Property Value

string

MkNormalIcon

public PdfTemplate MkNormalIcon { set; }

Property Value

PdfTemplate

MkRolloverCaption

public string MkRolloverCaption { set; }

Property Value

string

MkRolloverIcon

public PdfTemplate MkRolloverIcon { set; }

Property Value

PdfTemplate

MkRotation

public int MkRotation { set; }

Property Value

int

MkTextPosition

public int MkTextPosition { set; }

Property Value

int

Name

Sets the name of the annotation. With this name the annotation can be identified among all the annotations on a page (it has to be unique).

public string Name { set; }

Property Value

string

Page

public int Page { set; }

Property Value

int

PlaceInPage

Getter for property placeInPage.

public int PlaceInPage { get; set; }

Property Value

int

Value of property placeInPage.

Popup

public PdfAnnotation Popup { set; }

Property Value

PdfAnnotation

Rotate

public int Rotate { set; }

Property Value

int

Templates

public INullValueDictionary<PdfTemplate, object> Templates { get; }

Property Value

INullValueDictionary<PdfTemplate, object>

Title

public string Title { set; }

Property Value

string

Methods

CreateFileAttachment(PdfWriter, Rectangle, string, byte[], string, string)

Creates a file attachment annotation. the file will be read from the disk fileStore is not null @throws IOException on error

public static PdfAnnotation CreateFileAttachment(PdfWriter writer, Rectangle rect, string contents, byte[] fileStore, string file, string fileDisplay)

Parameters

writer PdfWriter

the PdfWriter

rect Rectangle

the dimensions in the page of the annotation

contents string

the file description

fileStore byte[]

an array with the file. If it's null

file string

the path to the file. It will only be used if

fileDisplay string

the actual file name stored in the pdf

Returns

PdfAnnotation

the annotation

CreateFileAttachment(PdfWriter, Rectangle, string, PdfFileSpecification)

Creates a file attachment annotation @throws IOException

public static PdfAnnotation CreateFileAttachment(PdfWriter writer, Rectangle rect, string contents, PdfFileSpecification fs)

Parameters

writer PdfWriter
rect Rectangle
contents string
fs PdfFileSpecification

Returns

PdfAnnotation

the annotation

CreateFreeText(PdfWriter, Rectangle, string, PdfContentByte)

public static PdfAnnotation CreateFreeText(PdfWriter writer, Rectangle rect, string contents, PdfContentByte defaultAppearance)

Parameters

writer PdfWriter
rect Rectangle
contents string
defaultAppearance PdfContentByte

Returns

PdfAnnotation

CreateInk(PdfWriter, Rectangle, string, float[][])

public static PdfAnnotation CreateInk(PdfWriter writer, Rectangle rect, string contents, float[][] inkList)

Parameters

writer PdfWriter
rect Rectangle
contents string
inkList float[][]

Returns

PdfAnnotation

CreateLine(PdfWriter, Rectangle, string, float, float, float, float)

public static PdfAnnotation CreateLine(PdfWriter writer, Rectangle rect, string contents, float x1, float y1, float x2, float y2)

Parameters

writer PdfWriter
rect Rectangle
contents string
x1 float
y1 float
x2 float
y2 float

Returns

PdfAnnotation
protected static PdfAnnotation CreateLink(PdfWriter writer, Rectangle rect, PdfName highlight)

Parameters

writer PdfWriter
rect Rectangle
highlight PdfName

Returns

PdfAnnotation
public static PdfAnnotation CreateLink(PdfWriter writer, Rectangle rect, PdfName highlight, int page, PdfDestination dest)

Parameters

writer PdfWriter
rect Rectangle
highlight PdfName
page int
dest PdfDestination

Returns

PdfAnnotation
public static PdfAnnotation CreateLink(PdfWriter writer, Rectangle rect, PdfName highlight, string namedDestination)

Parameters

writer PdfWriter
rect Rectangle
highlight PdfName
namedDestination string

Returns

PdfAnnotation
public static PdfAnnotation CreateLink(PdfWriter writer, Rectangle rect, PdfName highlight, PdfAction action)

Parameters

writer PdfWriter
rect Rectangle
highlight PdfName
action PdfAction

Returns

PdfAnnotation

CreateMarkup(PdfWriter, Rectangle, string, int, float[])

public static PdfAnnotation CreateMarkup(PdfWriter writer, Rectangle rect, string contents, int type, float[] quadPoints)

Parameters

writer PdfWriter
rect Rectangle
contents string
type int
quadPoints float[]

Returns

PdfAnnotation

CreatePopup(PdfWriter, Rectangle, string, bool)

public static PdfAnnotation CreatePopup(PdfWriter writer, Rectangle rect, string contents, bool open)

Parameters

writer PdfWriter
rect Rectangle
contents string
open bool

Returns

PdfAnnotation

CreateScreen(PdfWriter, Rectangle, string, PdfFileSpecification, string, bool)

Creates a screen PdfAnnotation @throws IOException

public static PdfAnnotation CreateScreen(PdfWriter writer, Rectangle rect, string clipTitle, PdfFileSpecification fs, string mimeType, bool playOnDisplay)

Parameters

writer PdfWriter
rect Rectangle
clipTitle string
fs PdfFileSpecification
mimeType string
playOnDisplay bool

Returns

PdfAnnotation

a screen PdfAnnotation

CreateSquareCircle(PdfWriter, Rectangle, string, bool)

public static PdfAnnotation CreateSquareCircle(PdfWriter writer, Rectangle rect, string contents, bool square)

Parameters

writer PdfWriter
rect Rectangle
contents string
square bool

Returns

PdfAnnotation

CreateStamp(PdfWriter, Rectangle, string, string)

public static PdfAnnotation CreateStamp(PdfWriter writer, Rectangle rect, string contents, string name)

Parameters

writer PdfWriter
rect Rectangle
contents string
name string

Returns

PdfAnnotation

CreateText(PdfWriter, Rectangle, string, string, bool, string)

public static PdfAnnotation CreateText(PdfWriter writer, Rectangle rect, string title, string contents, bool open, string icon)

Parameters

writer PdfWriter
rect Rectangle
title string
contents string
open bool
icon string

Returns

PdfAnnotation

GetMkColor(BaseColor)

public static PdfArray GetMkColor(BaseColor color)

Parameters

color BaseColor

Returns

PdfArray

IsAnnotation()

Getter for property annotation.

public bool IsAnnotation()

Returns

bool

Value of property annotation.

IsForm()

Getter for property form.

public bool IsForm()

Returns

bool

Value of property form.

SetAdditionalActions(PdfName, PdfAction)

public void SetAdditionalActions(PdfName key, PdfAction action)

Parameters

key PdfName
action PdfAction

SetAppearance(PdfName, string, PdfTemplate)

public void SetAppearance(PdfName ap, string state, PdfTemplate template)

Parameters

ap PdfName
state string
template PdfTemplate

SetAppearance(PdfName, PdfTemplate)

public void SetAppearance(PdfName ap, PdfTemplate template)

Parameters

ap PdfName
template PdfTemplate

SetHighlighting(PdfName)

Sets the annotation's highlighting mode. The values can be HIGHLIGHT_NONE , HIGHLIGHT_INVERT , HIGHLIGHT_OUTLINE and HIGHLIGHT_PUSH ;

public void SetHighlighting(PdfName highlight)

Parameters

highlight PdfName

the annotation's highlighting mode

SetMkIconFit(PdfName, PdfName, float, float, bool)

public void SetMkIconFit(PdfName scale, PdfName scalingType, float leftoverLeft, float leftoverBottom, bool fitInBounds)

Parameters

scale PdfName
scalingType PdfName
leftoverLeft float
leftoverBottom float
fitInBounds bool

SetPage()

public void SetPage()

SetUsed()

public virtual void SetUsed()

ShallowDuplicate(PdfAnnotation)

public static PdfAnnotation ShallowDuplicate(PdfAnnotation annot)

Parameters

annot PdfAnnotation

Returns

PdfAnnotation