Foxit PDF SDK
|
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 annotation 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 (Matrix2D matrix) |
Get annotation rectangle in device coordinate system. More... | |
PDFDictionary | GetDict () |
Get annotation's dictionary object. More... | |
Matrix2D | GetDisplayMatrix (Matrix2D page_display_matrix) |
Get the display matrix, from PDF coordinate system to targeted device coordinate system. 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 | HasProperty (Annot.Property property) |
Whether current annotation has the specified annotation's property. 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] (foxit.pdf.PDFPage). 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:
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. |
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 foxit.pdf.annots.Annot.Flags.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 foxit.pdf.annots.Annot.Flags.e_FlagNoView and foxit.pdf.annots.Annot.Flags.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. |
Enumeration for PDF annotation highlighting mode.
Values of this enumeration should be used alone.
Enumeration for annotation's MK dictionary (an appearance characteristics) entry.
Values of this enumeration should be used alone.
Enumeration for icon and caption relative position in annotation's MK dictionary.
Values of this enumeration should be used alone.
Enumeration for some PDF annotation property.
Values of this enumeration should be used alone.
Enumeration for PDF annotation type.
Values of this enumeration should be used alone.
|
inline |
Constructor, with PDF page and annotation's PDF dictionary.
[in] | page | A valid PDF page. |
[in] | annot_dict | An annotation's PDF dictionary. It should represent an annotation and should be in the PDF page specified by parameter page. |
|
inline |
Constructor, with another annotation object.
[in] | annot | Another annotation object. |
|
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>.
[in] | type | Type of annotation's appearance. Please refer to values starting from foxit.pdf.annots.Annot.AppearanceType.e_AppearanceTypeNormal and this should be one of these values. |
[in] | 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:
border width = 1, border style = foxit.pdf.annots.BorderInfo.Style.e_Solid , border cloud intensity = 0, border dash phase = 0, border dashes array is an empty array. Attention: among supported annotation types (please refer to "Note" comment part of class Annot ), this property will not have effect on appearance of these annotations: note, highlight, underline, strikeout, squiggly, stamp, caret, popup, file attachment, PSInk, redact. For ink annotation, only border width will have effect on ink annotation's appearance.
|
inline |
Get content.
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.
[in] | 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.
Get the display matrix, from PDF coordinate system to targeted device coordinate system.
Display matrix of current annotation can be used with annotation's rectangle to calculate the real area of annotation in target device coordinate system.
[in] | page_display_matrix | The transformation matrix. Usually this is returned by function PDFPage.GetDisplayMatrix . |
|
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 |
Whether current annotation has the specified annotation's property.
[in] | property | Property name. Please refer to values starting from foxit.pdf.annots.Annot.Property.e_PropertyModifiedDate and this should be one of these values. |
|
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] (foxit.pdf.PDFPage).
[in] | 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 foxit.pdf.annots.Annot.Property.e_PropertyBorderColor and foxit.pdf.annots.Annot.Property.e_PropertyFillColor , user should call function Annot.ResetAppearanceStream to make effect on annotation's appearance.
[in] | property | Property name. Please refer to values starting from foxit.pdf.annots.Annot.Property.e_PropertyModifiedDate 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 class 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.
[in] | 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.
Attention: among supported annotation types (please refer to "Note" comment part of class Annot ), this property will not have effect on appearance of these annotations: note, highlight, underline, strikeout, squiggly, stamp, caret, popup, file attachment, PSInk, redact. For ink annotation, only border width will have effect on ink annotation's appearance.
[in] | border | New border information to be set. It should be a valid border information 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 kinds 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.
[in] | content | New content string to be set. |
|
inline |
Set annotation flags.
[in] | flags | The annotation flags. It could be 0, or one or a combination of values starting from foxit.pdf.annots.Annot.Flags.e_FlagInvisible . |
|
inline |
Set last modified date time.
[in] | date_time | The data time to be set. It should contain valid date time data. |
|
inline |
Set unique ID.
[in] | unique_id | New unique ID string to be set. |