pdftron::PDF::Annots::Markup Class Reference

Markup is a base class for a number of annotations types that are used to mark up PDF documents. More...

#include <Markup.h>

Inheritance diagram for pdftron::PDF::Annots::Markup:

Inheritance graph
[legend]
Collaboration diagram for pdftron::PDF::Annots::Markup:

Collaboration graph
[legend]

List of all members.

Public Types

enum  BorderEffect { e_None, e_Cloudy }
 Border Effect Style. More...

Public Member Functions

 Markup (SDF::Obj d=0)
 Creates a markup annotation and initializes it using given Cos/SDF object.
 Markup (const Annot &ann)
 Creates a markup annotation and initializes it using given annotation object.
UString GetTitle ()
 Returns the title of the markup annotation.
void SetTitle (const UString &title)
 Sets the title of the markup annotation.
void SetTitle (const char *title)
 Sets the title of the markup annotation.
Popup GetPopup () const
 Returns the Popup object associated with this markup annotation.
void SetPopup (const Popup &bs)
 Sets the Popup object associated with this markup annotation.
double GetOpacity () const
void SetOpacity (double op)
 Sets the opacity value for the annotation.
UString GetSubject () const
 Returns the subject of the Markup annotation.
void SetSubject (const UString &subj)
 Sets subject of the Markup annotation.
Date GetCreationDates () const
void SetCreationDates (const Date &dt)
 Sets the creation date for the markup annotation.
BorderEffect GetBorderEffect () const
void SetBorderEffect (BorderEffect effect=e_None)
 Sets the border effect of the markup annotation.
double GetBorderEffectIntensity () const
void SetBorderEffectIntensity (double intensity=0)
 Sets the border effect intensity of the markup annotation.
ColorPt GetInteriorColor () const
 Returns the interior color of the annotation.
int GetInteriorColorCompNum () const
 Returns the number indicating the interior color space of the annotation.
void SetInteriorColor (const ColorPt &c, int CompNum)
 Sets the interior color of the Markup annotation.
Rect GetContentRect () const
 Returns the inner bounding rectangle of the Markup annotation.
void SetContentRect (const Rect &cr)
 Sets the inner bounding rectangle of the Markup annotation.
Rect GetPadding () const
 Returns the rectangle difference between overall annotation rectangle and content rectangle.
void SetPadding (const Rect &rd)
 Sets the rectangle difference between overall annotation rectangle and content rectangle.
void SetPadding (double x)


Detailed Description

Markup is a base class for a number of annotations types that are used 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:

Note:
The pop-up annotation type must not appear by itself; it must be associated with a markup annotation that uses it to display text.
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. When separating text into paragraphs, a CARRIAGE RETURN (0Dh) must be used.

Member Enumeration Documentation

Border Effect Style.

Enumerator:
e_None  No effect.
e_Cloudy  Use "cloudy" border.


Constructor & Destructor Documentation

pdftron::PDF::Annots::Markup::Markup ( SDF::Obj  d = 0  ) 

Creates a markup annotation and initializes it using given Cos/SDF object.

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

pdftron::PDF::Annots::Markup::Markup ( const Annot ann  )  [inline]

Creates a markup annotation and initializes it using given annotation object.

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


Member Function Documentation

UString pdftron::PDF::Annots::Markup::GetTitle (  ) 

Returns the title of the markup annotation.

Returns:
A string representing the title of the markup annotation, or null is the title is not specified.
Note:
The title is The text label that is displayed in the title bar of the annotation’s pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.

void pdftron::PDF::Annots::Markup::SetTitle ( const UString title  ) 

Sets the title of the markup annotation.

(Optional; PDF 1.1)

Parameters:
title A string.
Note:
The title is The text label that is displayed in the title bar of the annotation’s pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.

void pdftron::PDF::Annots::Markup::SetTitle ( const char *  title  ) 

Sets the title of the markup annotation.

(Optional; PDF 1.1)

Parameters:
title A string.
Note:
The title is The text label that is displayed in the title bar of the annotation’s pop-up window when open and active Markup annotation. This entry is also used to identify the user who added the annotation. It corresponds to the 'T' field of the annotation's dictionary.

Popup pdftron::PDF::Annots::Markup::GetPopup (  )  const

Returns the Popup object associated with this markup annotation.

Returns:
A Popup object that is associated with this markup annotation.
Note:
The Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.

void pdftron::PDF::Annots::Markup::SetPopup ( const Popup bs  ) 

Sets the Popup object associated with this markup annotation.

(Optional; PDF 1.3 )

Parameters:
bs A Popup object that is associated with this markup annotation.
Note:
the Popup is An indirect reference to a pop-up annotation for entering or editing the text associated with this annotation.

double pdftron::PDF::Annots::Markup::GetOpacity (  )  const

Returns:
The opacity value. Default value: 1.0.
Note:
This value is applied 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. When an appearance stream is presented with the annotation, this entry is ignored.(However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate this Opacity entry into the stream’s content.)

This corresponds to the 'CA' field of the annotation's dictionary.

void pdftron::PDF::Annots::Markup::SetOpacity ( double  op  ) 

Sets the opacity value for the annotation.

(Optional; PDF 1.4 )

Parameters:
op A number indicating the Markup annotation's opacity value. Default value: 1.0.
Note:
This value is applied 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. When an appearance stream is presented with the annotation, this entry is ignored.(However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate this Opacity entry into the stream’s content.)

This corresponds to the 'CA' field of the annotation's dictionary.

UString pdftron::PDF::Annots::Markup::GetSubject (  )  const

Returns the subject of the Markup annotation.

(PDF 1.5)

Returns:
A string representing the subject of the Markup annotation.
Note:
The subject is a short piece of text description about the annotation.

This corresponds to the 'Subj' field of the annotation's dictionary.

void pdftron::PDF::Annots::Markup::SetSubject ( const UString subj  ) 

Sets subject of the Markup annotation.

(Optional; PDF 1.5 )

Parameters:
subj A string representing the subject of the Markup annotation.
Note:
The subject is a short piece of text description about the annotation.

This corresponds to the 'Subj' field of the annotation's dictionary.

Date pdftron::PDF::Annots::Markup::GetCreationDates (  )  const

Returns:
The creation date for the markup annotation.

void pdftron::PDF::Annots::Markup::SetCreationDates ( const Date dt  ) 

Sets the creation date for the markup annotation.

(Optional; PDF 1.5 )

Parameters:
dt A Date object indicating the date the markup annotation is created.

BorderEffect pdftron::PDF::Annots::Markup::GetBorderEffect (  )  const

Returns:
the border effect of the markup annotation. Default value: e_None.
Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.
Note:
When "e_Cloudy" is chosen,the width and dash array specified by the annotation's BorderStyle entry needs to be taken into consideration.

void pdftron::PDF::Annots::Markup::SetBorderEffect ( BorderEffect  effect = e_None  ) 

Sets the border effect of the markup annotation.

(Optional; PDF 1.5 )

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Parameters:
effect An entry from the enum "BorderEffect" that represents the border effect of the Markup annotation. Default value: e_None.
Note:
When "e_Cloudy" is chosen,the width and dash array specified by the annotation's BorderStyle entry needs to be taken into consideration.

double pdftron::PDF::Annots::Markup::GetBorderEffectIntensity (  )  const

Returns:
A number describing the intensity of the border effect, in the range 0 to 2.
Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.
Parameters:
effect An entry from the enum "BorderEffect" that represents the border effect of the Markup annotation.
Note:
this parameter applies only if border effect is e_Cloudy. 0

void pdftron::PDF::Annots::Markup::SetBorderEffectIntensity ( double  intensity = 0  ) 

Sets the border effect intensity of the markup annotation.

(Optional; valid only if Border effect is Cloudy)

Beginning with PDF 1.5, some annotations (square, circle, and polygon) may have a 'BE' entry, which is a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. Beginning with PDF 1.6, the free text annotation may also have a BE entry.

Parameters:
effect An entry from the enum "BorderEffect" that represents the border effect of the Markup annotation.
intensity A number describing the intensity of the border effect, in the range 0 (which is default) to 2.
Note:
this parameter applies only if Border effect is e_Cloudy.

ColorPt pdftron::PDF::Annots::Markup::GetInteriorColor (  )  const

Returns the interior color of the annotation.

Returns:
A ColorPt object that denotes the color of the annotation.
Note:
The color can be in different color spaces: Gray, RGB, or CMYK. Call "GetInteriorColorCompNum" to access the color space information.

According to PDF Reference Manual interior color is not the property that is expected for Markup annotations in general, but it applies to many derived annotations (Line,Square,Circle,Polygon,PolyLine,Redaction) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use interior color will ignore the interior color ('IC' entry), if present in their annotation dictionary. In case no color is specified, CMYK white is returned.

int pdftron::PDF::Annots::Markup::GetInteriorColorCompNum (  )  const

Returns the number indicating the interior color space of the annotation.

Returns:
An integer indicating the number of channels forming the color space. 3 corresponds to RGB, 4 corresponds to CMYK, and 1 corresponds to Gray. If the interior is transparent, the return value is 0.

void pdftron::PDF::Annots::Markup::SetInteriorColor ( const ColorPt c,
int  CompNum 
)

Sets the interior color of the Markup annotation.

Parameters:
c A ColorPt object that denotes the color of the Markup annotation.
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.
Note:
It is necessary to make sure the consistency between the type of parameter c and the value of parameter CompNum. RGB ColorPt corresponds to 3, CMYK ColorPt corresponds to 4, Gray ColorPt corresponds to 1, and transparent corresponds to 0.

According to PDF Reference Manual interior color is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use interior color will ignore the interior color ('IC' entry), if present in their annotation dictionary.

Entries out of the specified color space array length will be discarded. Missing entries for a specified color space will lead to potential exceptions.

Rect pdftron::PDF::Annots::Markup::GetContentRect (  )  const

Returns the inner bounding rectangle of the Markup annotation.

Returns:
A rectangle specifying the region where content should be displayed.
Note:
This rectangle can be same as or inside of the annotation’s rectangle. If it is smaller, such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. For FreeText annotation with a callout, content rectangle specifies an inner region for the text to be displayed.

According to PDF Reference Manual content rectangle is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes (FreeText,Square,Circle,Caret) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use this property will ignore the content rectangle ('RD' entry), if present in their annotation dictionary.

void pdftron::PDF::Annots::Markup::SetContentRect ( const Rect cr  ) 

Sets the inner bounding rectangle of the Markup annotation.

(Optional)

Parameters:
cr A Rect struct to be assign to the 'RD' entry of the annotation dictionary.
Note:
This rectangle can be same as or inside of the annotation’s rectangle. If it is smaller, such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. For FreeText annotation with a callout, content rectangle specifies an inner region for the text to be displayed.

According to PDF Reference Manual content rectangle is not the property that is expected for Markup annotations in general, but it applies to many derived annotation classes (FreeText,Square,Circle,Caret) and therefore get()/set() methods are provided in the base class Markup. Annotations that do not use this property will ignore the content rectangle ('RD' entry), if present in their annotation dictionary.

Rect pdftron::PDF::Annots::Markup::GetPadding (  )  const

Returns the rectangle difference between overall annotation rectangle and content rectangle.

Returns:
A set of four numbers represented as a Rect struct.
Note:
The four numbers of the returning struct specify the difference between two rectangles: the Rect entry of the annotation and the actual bounding box of the underlying rectangle. Such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. The four numbers of the returning struct correspond to the differences in default user space, between the left, top, right, and bottom of the two above mentioned rectangles.

GetPadding() and GetContentRectangle() both use 'RD' entry of the annotation dictionary, but represent it to user in different ways.

See also:
GetContentRect()

void pdftron::PDF::Annots::Markup::SetPadding ( const Rect rd  ) 

Sets the rectangle difference between overall annotation rectangle and content rectangle.

(Optional)

Parameters:
rd A set of four numbers represented as a Rect struct
Note:
The four numbers of rd specify the difference between two rectangles: the Rect entry of the annotation and the actual bounding box of the underlying rectangle. Such a difference may occur in situations where a border effect causes the size of the annotation Rect entry to increase beyond that of the rectangle. The four numbers of the rd correspond to the differences in default user space, between the left, top, right, and bottom of the two above mentioned rectangles.

SetPadding() and SetContentRectangle() both use 'RD' entry of the annotation dictionary. Two methods are provided to give users additional flexibility and ease of use in setting the values of the 'RD' field.

See also:
GetContentRect()

void pdftron::PDF::Annots::Markup::SetPadding ( double  x  ) 


© 2002-2010 PDFTron Systems Inc.