Public Member Functions | |
Annot (PDFPage page, PDFDictionary annot_dict) | |
Constructor, with PDF page and annotation's PDF dictionary. More... | |
Annot (Annot annot) | |
Constructor, with another Annot object. More... | |
Annot () | |
Constructor. | |
PDFStream | GetAppearanceStream (Annot.AppearanceType type, string appearance_state) |
Get annotation's appearance stream with specified type and state. More... | |
int | GetBorderColor () |
Get border color. More... | |
BorderInfo | GetBorderInfo () |
Get border information. More... | |
string | GetContent () |
Get content. More... | |
RectI | GetDeviceRect (bool is_transform_icon, Matrix2D matrix) |
Get annotation rectangle in device coordinate system. More... | |
PDFDictionary | GetDict () |
Get annotation's dictionary object. More... | |
int | GetFlags () |
Get annotation flags. More... | |
int | GetIndex () |
Get the index of current annotation in the page which current annotation belongs to. More... | |
DateTime | GetModifiedDateTime () |
Get last modified date time. More... | |
PDFDictionary | GetOptionalContent () |
Get the PDF dictionary of annotation's optional content. More... | |
PDFPage | GetPage () |
Get the related PDF page. More... | |
RectF | GetRect () |
Get rectangle, in PDF coordinate system . More... | |
Annot.Type | GetType () |
Get actual annotation type of current annotation. More... | |
string | GetUniqueID () |
Get unique ID. More... | |
bool | IsEmpty () |
Check whether current object is empty or not. More... | |
bool | IsMarkup () |
Check if current annotation is a markup annotation. More... | |
bool | Move (RectF rect) |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system . More... | |
bool | RemoveProperty (Annot.Property property) |
Remove a specified annotation's property. More... | |
bool | ResetAppearanceStream () |
Reset appearance stream. More... | |
void | SetBorderColor (int color) |
Set border color. More... | |
void | SetBorderInfo (BorderInfo border) |
Set border information. More... | |
void | SetContent (string content) |
Set content. More... | |
void | SetFlags (int flags) |
Set annotation flags. More... | |
void | SetModifiedDateTime (DateTime date_time) |
Set last modified date time. More... | |
void | SetUniqueID (string unique_id) |
Set unique ID. More... | |
An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a wide variety of standard annotation types.
Class Annot is the base class for all kinds of PDF annotations. It offers the base functions to get/set annotation's common properties, to move an annotation or reset appearance stream of an annotation. For concrete annotation types, please refer to derived classes. To get the count of annotations or get/add/remove an annotation, please refer to class pdf::PDFPage.
This class object can also be used to construct objects of other classes in order to do some more operation in annotation or access specified information of annotation:
To access additional actions, please construct an actions::AdditionalAction object with Annot object. Only a few types of annotations may have additional action. For more details, please refer to class action::AdditionalAction.
To search text in annotation, please construct a TextSearch object with Annot object. The searching can only support some types of annotations. For more details, please refer to class TextSearch.
|
strong |
|
strong |
Enumeration for PDF annotation flags.
Values of this enumeration can be used alone or in combination.
Enumerator | |
---|---|
e_FlagInvisible | Annotation flag: invisible. If set, do not display the annotation if it does not belong to one of the standard annotation types and no annotation handler is available. If clear, display such an non-standard annotation using an appearance stream specified by its appearance dictionary, if any. |
e_FlagHidden | Annotation flag: hidden. If set, do not display or print the annotation or allow it to interact with the user, regardless of its annotation type or whether an annotation handler is available. |
e_FlagPrint | Annotation flag: print. If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of whether it is displayed on the screen. This can be useful, for example, for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page. |
e_FlagNoZoom | Annotation flag: no zoom. If set, do not scale the annotation's appearance to match the magnification of the page. The location of the annotation on the page (defined by the upper-left corner of its annotation rectangle) remains fixed, regardless of the page magnification. See below for further discussion. |
e_FlagNoRotate | Annotation flag: no rotate. If set, do not rotate the annotation's appearance to match the rotation of the page. The upper-left corner of the annotation rectangle remains in a fixed location on the page, regardless of the page rotation. |
e_FlagNoView | Annotation flag: no view. If set, do not display the annotation on the screen or allow it to interact with the user. The annotation may be printed (depending on the setting of flag e_FlagPrint) but should be considered hidden for purposes of on-screen display and user interaction. |
e_FlagReadOnly | Annotation flag: read only. If set, do not allow the annotation to interact with the user. The annotation may be displayed or printed (depending on the settings of flags e_FlagNoView and e_FlagPrint) but should not respond to mouse clicks or change its appearance in response to mouse motions.
|
e_FlagLocked | Annotation flag: locked. If set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field. |
e_FlagToggleNoView | Annotation flag: toggle no view. If set, invert the interpretation of the NoView flag for certain events. A typical use is to have an annotation that appears only when a mouse cursor is held over it. |
e_FlagLockedContents | Annotation flag: locked contents. If set, do not allow the contents of the annotation to be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size. |
|
strong |
Enumeration for PDF annotation highlighting mode.
Values of this enumeration should be used alone.
|
strong |
Enumeration for annotation's MK dictionary (an appearance characteristics) entry.
Values of this enumeration should be used alone.
|
strong |
Enumeration for icon and caption relative position in annotation's MK dictionary.
Values of this enumeration should be used alone.
|
strong |
Enumeration for some PDF annotation property.
Values of this enumeration should be used alone.
|
strong |
Enumeration for PDF annotation type.
Values of this enumeration should be used alone.
|
inline |
Constructor, with PDF page and annotation's PDF dictionary.
page | A valid PDF page. |
annot_dict | An annotation's PDF dictionary. It should represent an annotation and should be in the PDF page specified by parameter page. |
|
inline |
|
inline |
Get annotation's appearance stream with specified type and state.
For more details, please refer to "AP" and "AS" entries in "TABLE 8.15 Entries common to all annotation
dictionaries" in <PDF reference 1.7>.
type | Type of annotation's appearance. Please refer to e_AppearanceTypeXXX and it should be one of these values. |
appearance_state | Annotation's appearance state, which is used to select the applicable appearance stream from an appearance sub- dictionary. If this is an empty string, Foxit PDF SDK will choose the appearance state specified by the "AS" (Appearance State) entry in the annotation dictionary. |
|
inline |
Get border color.
This property has effect on annotation's appearance.
|
inline |
Get border information.
This property has effect on annotation's appearance. For an annotation which does not have border information, the default border information will be returned: BorderInfo::GetWidth = 1, BorderInfo::GetPageLabelStyle = e_Solid, BorderInfo::cloud_intensity = 0, BorderInfo::dash_phase = 0, BorderInfo::dashes is an empty array.
|
inline |
Get content.
|
inline |
Get annotation rectangle in device coordinate system.
This is a useful function to get the device rectangle of an annotation, but not support pop-up annotation.
For the rectangle conversion, the result rectangle is always "normalized", which is using device coordinate system: left is always smaller than right, and top is always smaller than bottom.
is_transform_icon | true means to transform (like rotate or scale) icon's rectangle with page, while false means not transform icon's rectangle with page. This parameter only affects on note (known as text annotation in PDF reference 1.7) and file attachment annotations, because they are shown as icon. |
matrix | A matrix used to transform from PDF coordinate system to device coordinate system. Usually, this is returned by function pdf::PDFPage::GetDisplayMatrix and also used for rendering. |
|
inline |
Get annotation's dictionary object.
|
inline |
Get annotation flags.
|
inline |
Get the index of current annotation in the page which current annotation belongs to.
|
inline |
Get last modified date time.
|
inline |
Get the PDF dictionary of annotation's optional content.
|
inline |
Get the related PDF page.
|
inline |
Get rectangle, in PDF coordinate system .
|
inline |
Get actual annotation type of current annotation.
|
inline |
Get unique ID.
|
inline |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
|
inline |
Check if current annotation is a markup annotation.
|
inline |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system .
rect | New rectangle to specify the new position where current annotation is to be moved to. It should be valid in PDF coordinate system . |
|
inline |
Remove a specified annotation's property.
This function can be used to remove some optional properties of an annotation. When appearance related property is removed successfully, such as e_PropertyBorderColor and e_PropertyFillColor, user should call function Annot::ResetAppearanceStream to make effect on annotation's appearance.
property | Property name. Please refer to e_PropertyXXX values and this should be one of these values. |
|
inline |
Reset appearance stream.
Annotation's appearance is stored as stream in PDF document. When any appearance related property is changed by corresponding setting functions, if user wants the effect to be shown in annotation's appearance, current function should be called.
Please check "Note" part in the comment of Annot to see which types of annotations can be reset appearance by current function and also check comment in classes of these annotations to see if any property is required before resetting appearance stream.
|
inline |
Set border color.
This property has effect on annotation's appearance. If user wants the new border color has effect on annotation's appearance, please call function Annot::ResetAppearanceStream after setting the new border color.
color | New border color to be set. Format: 0xRRGGBB. |
|
inline |
Set border information.
This property has effect on annotation's appearance. If user wants the new border information has effect on annotation's appearance, please call function Annot::ResetAppearanceStream after setting the new border information.
border | New border information to be set. It should be a valid BorderInfo object. If any value of parameter border is invalid, this function will fail to set new border information to current annotation. |
|
inline |
Set content.
For free text annotation and line annotation (which has enabled caption), they would show content in their appearance. So for these kind of annotations, this property would have effect on annotation's appearance. If user wants the effect to be shown in the appearance of these kind of annotations, please call function Annot::ResetAppearanceStream after setting new content.
content | New content string to be set. |
|
inline |
Set annotation flags.
flags | The annotation flags. It could be 0, or one or a combination of e_FlagXXX values. |
|
inline |
Set last modified date time.
date_time | The data time to be set. It should contain valid date time data. |
|
inline |
Set unique ID.
unique_id | New unique ID string to be set. |