Show / Hide Table of Contents

# Class Markup

The meaning of an annotation’s Contents entry varies by annotation type. Typically, it is the text that shall be displayed for the annotation or, if the annotation does not display text, an alternate description of the annotation’s contents in human-readable form. In either case, the Contents entry is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes. Many annotation types are defined as markup annotations because they are used primarily to mark up PDF documents. These annotations have text that appears as part of the annotation and may be displayed in other ways by a conforming reader, such as in a Comments pane. Markup annotations may be divided into the following groups:

- Free text annotations display text directly on the page. The annotation’s Contents entry specifies the displayed text.
- Most other markup annotations have an associated pop-up window that may contain text. The annotation’s Contents entry specifies the text that shall be displayed when the pop-up window is opened. These include text, line, square, circle, polygon, polyline, highlight,underline, squiggly-underline, strikeout, rubber stamp, caret, ink, and file attachment annotations.
- Sound annotations do not have a pop-up window but may also have associated text specified by the Contents entry. When separating text into paragraphs, a CARRIAGE RETURN (0Dh) shall be used and not, for example, a LINE FEED character (0Ah). A subset of markup annotations is called text markup annotations.

The remaining annotation types are not considered markup annotations:

- The pop-up annotation type shall not appear by itself; it shall be associated with a markup annotation that uses it to display text. If an annotation has no parent, the Contents entry shall represent the text of the annotation, otherwise it shall be ignored by a conforming reader.
- For all other annotation types (Link, Movie, Widget, PrinterMark, and TrapNet), the Contents entry shall provide an alternate representation of the annotation’s contents in human-readable form, which is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes.

##### Inheritance

object
Annot
Markup
Caret
Circle
FileAttachment
FreeText
Ink
Line
Redaction
RubberStamp
Sound
Square
Text
TextMarkup

##### Implements

IDisposable

##### Inherited Members

Annot.Dispose()
Annot.Dispose(bool)
Annot.GetHandleInternal()
Annot.GetRefHandleInternal()
Annot.CreateInternal(IntPtr, object)
Annot.Create(SDFDoc, Annot.Type, Rect)
Annot.op_Assign(Annot)
Annot.Equals(object)
Annot.IsValid()
Annot.GetSDFObj()
Annot.GetType()
Annot.IsMarkup()
Annot.GetRect()
Annot.GetVisibleContentBox()
Annot.SetRect(Rect)
Annot.GetContents()
Annot.SetContents(string)
Annot.GetPage()
Annot.SetPage(Page)
Annot.GetUniqueID()
Annot.SetUniqueID(string)
Annot.GetDate()
Annot.SetDate(Date)
Annot.GetFlag(Annot.Flag)
Annot.SetFlag(Annot.Flag, bool)
Annot.GetBorderStyle()
Annot.SetBorderStyle(Annot.BorderStyle)
Annot.GetAppearance()
Annot.GetAppearance(Annot.AnnotationState)
Annot.GetAppearance(Annot.AnnotationState, string)
Annot.SetAppearance(Obj)
Annot.SetAppearance(Obj, Annot.AnnotationState)
Annot.SetAppearance(Obj, Annot.AnnotationState, string)
Annot.RemoveAppearance()
Annot.RemoveAppearance(Annot.AnnotationState)
Annot.RemoveAppearance(Annot.AnnotationState, string)
Annot.Flatten(Page)
Annot.GetActiveAppearanceState()
Annot.SetActiveAppearanceState(string)
Annot.GetColorAsRGB()
Annot.GetColorAsCMYK()
Annot.GetColorAsGray()
Annot.GetColorCompNum()
Annot.SetColor(ColorPt, int)
Annot.SetColor(ColorPt)
Annot.GetStructParent()
Annot.SetStructParent(int)
Annot.GetOptionalContent()
Annot.SetOptionalContent(Obj)
Annot.Resize(Rect)
Annot.GetRotation()
Annot.SetRotation(int)
Annot.RefreshAppearance()
Annot.GetCustomData(string)
Annot.SetCustomData(string, string)
Annot.DeleteCustomData(string)
object.Equals(object, object)
object.GetHashCode()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF.Annots

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class Markup : Annot, IDisposable

### Constructors

#### Markup(Annot)

Creates a Markup annotation and initialize it using given annotation object.

##### Declaration

    public Markup(Annot ann)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | ann | the annot

##### Remarks

The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Markup(Obj)

Creates a Markup annotation and initialize it using given `SDF.Obj` object.

##### Declaration

    public Markup(Obj d)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | d | existing Markup object

##### Remarks

The constructor does not copy any data, but is instead the logical equivalent of a type cast.

### Methods

#### ~Markup()

Releases all resources used by the Annot

##### Declaration

    protected ~Markup()

#### GetBorderEffect()

Gets the Border Effect of the Markup Annotation.

##### Declaration

    public Markup.BorderEffect GetBorderEffect()

##### Returns

Type | Description
--- | ---
Markup.BorderEffect | An entry from the enum "BorderEffect" that represents the border effect.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetBorderEffectIntensity()

Gets the Border Effect Intensity of the Markup Annotation.

##### Declaration

    public double GetBorderEffectIntensity()

##### Returns

Type | Description
--- | ---
double | A number representing the border effect.

##### Remarks

The BorderEffectIntensity value is a number describing the intensity of the effect, in the range 0 to 2. Default value: 0.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetContentRect()

Gets the inner bounding rectangle of the Square. (Optional; PDF 1.5)

##### Declaration

    public Rect GetContentRect()

##### Returns

Type | Description
--- | ---
Rect | A difference between the inner bounding rectangle and a positon rectangle may occur in situations where a border effect (described by BE) causes the size of the Rect to increase beyond that of the square or Square

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetCreationDates()

Gets the creation date of the Markup Annotation

##### Declaration

    public Date GetCreationDates()

##### Returns

Type | Description
--- | ---
Date | A Date object indicating the date the Markup Annotation is created

##### Remarks

The Date object not only includes date, it actually includes both date and time when the annotation was created. This corresponds to the 'CreationDate' field of the markup annotation's dictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetInteriorColor()

Sets the interior color of the Square. (Optional; PDF 1.4 )

##### Declaration

    public ColorPt GetInteriorColor()

##### Returns

Type | Description
--- | ---
ColorPt | interior color

##### Remarks

it is necessary to make sure the consistancy between the ColorPt type and the ColorSpace.Type value. e_device_gray corresponds to an array of two numbers; e_device_rgb corresponds to an array of 3 numbers, e_device_cmyk corresponds to an array of 4 numnbers, while e_null correspons to an arry of 0 number. Entries out of the specified color space array length will be desgarded. However, missing entries for a specified color space will throw exception either when setting the color or when later retrieving color(colorspace) information.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetInteriorColorCompNum()

Gets the number indicating interior color space of the Square.

##### Declaration

    public int GetInteriorColorCompNum()

##### Returns

Type | Description
--- | ---
int | An integer indicating a color space value from the ColorSpace.Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable, orelse 0 corresponding to "e_null" if the color is transparent.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetOpacity()

Gets the contant opacity value corresponding to the annotation.

##### Declaration

    public double GetOpacity()

##### Returns

Type | Description
--- | ---
double | A number indicating the opacity value corresponding to the annotation.

##### Remarks

The constant opacity value shall be used in painting the annotation. This value shall apply to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. The specified value shall not used if the annotation has an appearance stream in that case, the appearance stream shall specify any transparency. (However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate the CA value into the stream’s content.) The implicit blend mode is Normal. Default value: 1.0. If no explicit appearance stream is defined for the annotation, it may bepainted by implementation-dependent means that do not necessarily conform to the PDF imaging model; in this case, the effect of this entry is implementation-dependent as well.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetPadding()

Gets the rectangle difference of the Square. (Optional; PDF 1.5)

##### Declaration

    public Rect GetPadding()

##### Returns

Type | Description
--- | ---
Rect | A set of four numbers(represented as a Rect object) specifying the difference on the four different directions.

##### Remarks

rectangle difference is A set of four numbers that shall describe the numerical differences between two rectangles: the Rect entry of the annotation and the actual boundaries of the underlying square or Square. Such a difference may occur in situations where a border effect (described by BE) causes the size of the Rect to increase beyond that of the square or Square. The four numbers shall correspond to the differences in default user space between the left, top, right, and bottom coordinates of Rect and those of the square or Square, respectively. Each value shall be greater than or equal to 0. The sum of the top and bottom differences shall be less than the height of Rect, and the sum of the left and right differences shall be less than the width of Rect.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetPopup()

Gets the Popup object associated with this Markup annotation.

##### Declaration

    public Popup GetPopup()

##### Returns

Type | Description
--- | ---
Popup | A Popup object that is associated with this Markup annotation.

##### Remarks

The Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSubject()

Gets subject of the Markup Annotation.

##### Declaration

    public string GetSubject()

##### Returns

Type | Description
--- | ---
string | A string representing the subject of the Markup Annotation

##### Remarks

The subject is The Text representing a short description of the subject being addressed by the annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetTitle()

Gets the title of the Markup Annotation.

##### Declaration

    public string GetTitle()

##### Returns

Type | Description
--- | ---
string | A string representing the title of the Markup Annotation

##### Remarks

The title is The text label that shall be displayed in the title bar of the annotation’s pop-up window when open and active. This entry shall identify the user who added the annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### RotateAppearance(double)

Rotates the appearance of the Markup Annotation.

##### Declaration

    public void RotateAppearance(double angle)

##### Parameters

Type | Name | Description
--- | --- | ---
double | angle | the new rotation

##### Remarks

Apply a rotation to an existing appearance. This rotation will be reflected in the bounding rect of the annot (which will be updated), but not in any other part of the annotation dictionary. This will effectively create a custom appearance for the annotation, and any subsequent calls to `RefreshAppearance` will clear this transformation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetBorderEffect(BorderEffect)

Sets the Border Effect of the Markup Annotation. (Optional; PDF 1.5 )

##### Declaration

    public void SetBorderEffect(Markup.BorderEffect effect)

##### Parameters

Type | Name | Description
--- | --- | ---
Markup.BorderEffect | effect | An entry from the enum "BorderEffect" that represents the border effect.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetBorderEffectIntensity(double)

Sets the Border Effect Intensity of the Markup Annotation. (Optional; valid only if Border effect is Cloudy)

##### Declaration

    public void SetBorderEffectIntensity(double intensity)

##### Parameters

Type | Name | Description
--- | --- | ---
double | intensity | A number representing the border effect.

##### Remarks

The BorderEffectIntensity value is a number describing the intensity of the effect, in the range 0 to 2. Default value: 0.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetContentRect(Rect)

Sets the inner bounding rectangle of the Square. (Optional; PDF 1.5)

##### Declaration

    public void SetContentRect(Rect cr)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | cr | the new content rect

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetCreationDates(Date)

Sets the creation date of the Markup Annotation. (Optional; PDF 1.5 )

##### Declaration

    public void SetCreationDates(Date dt)

##### Parameters

Type | Name | Description
--- | --- | ---
Date | dt | the new creation dates

##### Remarks

The Date object not only includes date, it actually includes both date and time when the annotation was created. This corresponds to the 'CreationDate' field of the markup annotation's dictionary.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetInteriorColor(ColorPt, int)

Gets the interior color of the Square.

##### Declaration

    public void SetInteriorColor(ColorPt c, int CompNum)

##### Parameters

Type | Name | Description
--- | --- | ---
ColorPt | c | A ColorPt object that denotes the color of the Markup annotation.
int | CompNum | An integer indicating the number of channels forming the color space used. It also defines the length of the array to be allocated for storing the entries of c.

##### Remarks

that the color can be in different color spaces: Gray, RGB, or CMYK. Call "GetInteriorColorCompNum" to access the color space information corresponding to the interioir color.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOpacity(double)

Sets the contant opacity value corresponding to the annotation. (Optional; PDF 1.4 )

##### Declaration

    public void SetOpacity(double op)

##### Parameters

Type | Name | Description
--- | --- | ---
double | op | the new opacity

##### Remarks

The constant opacity value shall be used in painting the annotation. This value shall apply to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. The specified value shall not used if the annotation has an appearance stream in that case, the appearance stream shall specify any transparency. (However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate the CA value into the stream’s content.) The implicit blend mode is Normal. Default value: 1.0. If no explicit appearance stream is defined for the annotation, it may bepainted by implementation-dependent means that do not necessarily conform to the PDF imaging model; in this case, the effect of this entry is implementation-dependent as well.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetPadding(Rect)

Sets the rectangle difference of the Square. (Optional; PDF 1.5)

##### Declaration

    public void SetPadding(Rect rd)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rd | A set of four numbers(represented as a Rect object) specifying the difference on the four different directions.

##### Remarks

rectangle difference is A set of four numbers that shall describe the numerical differences between two rectangles: the Rect entry of the annotation and the actual boundaries of the underlying square or Square. Such a difference may occur in situations where a border effect (described by BE) causes the size of the Rect to increase beyond that of the square or Square. The four numbers shall correspond to the differences in default user space between the left, top, right, and bottom coordinates of Rect and those of the square or Square, respectively. Each value shall be greater than or equal to 0. The sum of the top and bottom differences shall be less than the height of Rect, and the sum of the left and right differences shall be less than the width of Rect.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetPopup(Popup)

Sets the Popup object associated with this Markup annotation. (Optional; PDF 1.3 )

##### Declaration

    public void SetPopup(Popup bs)

##### Parameters

Type | Name | Description
--- | --- | ---
Popup | bs | the new popup

##### Remarks

the Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetSubject(string)

Sets subject of the Markup Annotation. (Optional; PDF 1.5 )

##### Declaration

    public void SetSubject(string subj)

##### Parameters

Type | Name | Description
--- | --- | ---
string | subj | the new subject

##### Remarks

The subject is The Text representing a short description of the subject being addressed by the annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetTitle(string)

Sets the title of the Markup Annotation. (Optional; PDF 1.1)

##### Declaration

    public void SetTitle(string title)

##### Parameters

Type | Name | Description
--- | --- | ---
string | title | A string representing the title of the Markup Annotation

##### Remarks

The title is The text label that shall be displayed in the title bar of the annotation’s pop-up window when open and active. This entry shall identify the user who added the annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable