Table of Contents

Class PdfTextMarkupAnnotation

Namespace
iText.Kernel.Pdf.Annot
Assembly
itext.kernel.dll
public class PdfTextMarkupAnnotation : PdfMarkupAnnotation
Inheritance
PdfTextMarkupAnnotation
Inherited Members

Constructors

PdfTextMarkupAnnotation(Rectangle, PdfName, float[])

public PdfTextMarkupAnnotation(Rectangle rect, PdfName subtype, float[] quadPoints)

Parameters

rect Rectangle
subtype PdfName
quadPoints float[]

PdfTextMarkupAnnotation(PdfDictionary)

Instantiates a new PdfTextMarkupAnnotation instance based on PdfDictionary instance, that represents existing annotation object in the document.

protected PdfTextMarkupAnnotation(PdfDictionary pdfObject)

Parameters

pdfObject PdfDictionary

the PdfDictionary representing annotation object

See Also

Fields

MarkupHighlight

Subtypes

public static readonly PdfName MarkupHighlight

Field Value

PdfName

MarkupSquiggly

public static readonly PdfName MarkupSquiggly

Field Value

PdfName

MarkupStrikeout

public static readonly PdfName MarkupStrikeout

Field Value

PdfName

MarkupUnderline

public static readonly PdfName MarkupUnderline

Field Value

PdfName

Methods

CreateHighLight(Rectangle, float[])

Creates a text markup annotation of highlight style subtype.

public static PdfTextMarkupAnnotation CreateHighLight(Rectangle rect, float[] quadPoints)

Parameters

rect Rectangle

the annotation rectangle, defining the location of the annotation on the page in default user space units.

quadPoints float[]

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral shall encompasses a word or group of contiguous words in the text underlying the annotation. The text is oriented with respect to the edge connecting first two vertices.

Returns

PdfTextMarkupAnnotation

created PdfTextMarkupAnnotation of Highlight type.

Remarks

Creates a text markup annotation of highlight style subtype.

IMPORTANT NOTE on quadPoints argument: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.

CreateSquiggly(Rectangle, float[])

Creates a text markup annotation of squiggly-underline type.

public static PdfTextMarkupAnnotation CreateSquiggly(Rectangle rect, float[] quadPoints)

Parameters

rect Rectangle

the annotation rectangle, defining the location of the annotation on the page in default user space units.

quadPoints float[]

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral shall encompasses a word or group of contiguous words in the text underlying the annotation. The text is oriented with respect to the edge connecting first two vertices.

Returns

PdfTextMarkupAnnotation

created PdfTextMarkupAnnotation of squiggly-underline type.

Remarks

Creates a text markup annotation of squiggly-underline type.

IMPORTANT NOTE on quadPoints argument: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.

CreateStrikeout(Rectangle, float[])

Creates a text markup annotation of strikeout style subtype.

public static PdfTextMarkupAnnotation CreateStrikeout(Rectangle rect, float[] quadPoints)

Parameters

rect Rectangle

the annotation rectangle, defining the location of the annotation on the page in default user space units.

quadPoints float[]

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral shall encompasses a word or group of contiguous words in the text underlying the annotation. The text is oriented with respect to the edge connecting first two vertices.

Returns

PdfTextMarkupAnnotation

created PdfTextMarkupAnnotation of Strikeout type.

Remarks

Creates a text markup annotation of strikeout style subtype.

IMPORTANT NOTE on quadPoints argument: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.

CreateUnderline(Rectangle, float[])

Creates a text markup annotation of underline style subtype.

public static PdfTextMarkupAnnotation CreateUnderline(Rectangle rect, float[] quadPoints)

Parameters

rect Rectangle

the annotation rectangle, defining the location of the annotation on the page in default user space units.

quadPoints float[]

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Each quadrilateral shall encompasses a word or group of contiguous words in the text underlying the annotation. The text is oriented with respect to the edge connecting first two vertices.

Returns

PdfTextMarkupAnnotation

created PdfTextMarkupAnnotation of Underline type.

Remarks

Creates a text markup annotation of underline style subtype.

IMPORTANT NOTE on quadPoints argument: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.

GetQuadPoints()

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.

public virtual PdfArray GetQuadPoints()

Returns

PdfArray

an PdfArray of 8 × n numbers specifying the coordinates of n quadrilaterals.

Remarks

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Quadrilaterals are used to define a word or group of contiguous words in the text underlying the text markup annotation.

IMPORTANT NOTE: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.

GetSubtype()

public override PdfName GetSubtype()

Returns

PdfName

SetQuadPoints(PdfArray)

Sets n quadrilaterals in default user space by passing an PdfArray of 8 × n numbers.

public virtual PdfTextMarkupAnnotation SetQuadPoints(PdfArray quadPoints)

Parameters

quadPoints PdfArray

an PdfArray of 8 × n numbers specifying the coordinates of n quadrilaterals.

Returns

PdfTextMarkupAnnotation

this PdfTextMarkupAnnotation instance.

Remarks

Sets n quadrilaterals in default user space by passing an PdfArray of 8 × n numbers. Quadrilaterals are used to define a word or group of contiguous words in the text underlying the text markup annotation.

IMPORTANT NOTE: According to Table 179 in ISO 32000-1, the QuadPoints array lists the vertices in counterclockwise order and the text orientation is defined by the first and second vertex. This basically means QuadPoints is specified as lower-left, lower-right, top-right, top-left. HOWEVER, Adobe's interpretation (tested at least with Acrobat 10, Acrobat 11, Reader 11) is top-left, top-right, lower-left, lower-right (Z-shaped order). This means that if the QuadPoints array is specified according to the standard, the rendering is not as expected. Other viewers seem to follow Adobe's interpretation. Hence we recommend to use and expect QuadPoints array in Z-order, just as Acrobat and probably most other viewers expect.