Foxit PDF SDK
|
Public Member Functions | |
constructor () | |
Constructor. | |
constructor (page, annot_dict) | |
Constructor, with PDF page and annotation's PDF dictionary. More... | |
GetAppearanceStream (type, appearance_state) | |
Get annotation's appearance stream with specified type and state. More... | |
GetBorderColor () | |
Get border color. More... | |
GetBorderInfo () | |
Get border information. More... | |
GetContent () | |
Get content. More... | |
GetDeviceRect (matrix) | |
Get annotation rectangle in device coordinate system. More... | |
GetDict () | |
Get annotation's dictionary object. More... | |
GetDisplayMatrix (page_display_matrix) | |
Get the display matrix, from PDF coordinate system to targeted device coordinate system. More... | |
GetFlags () | |
Get annotation flags. More... | |
GetIndex () | |
Get the index of current annotation in the page which current annotation belongs to. More... | |
GetModifiedDateTime () | |
Get last modified date time. More... | |
GetOptionalContent () | |
Get the PDF dictionary of annotation's optional content. More... | |
GetPage () | |
Get the related PDF page. More... | |
GetRect () | |
Get rectangle, in PDF coordinate system. More... | |
GetType () | |
Get actual annotation type of current annotation. More... | |
GetUniqueID () | |
Get unique ID. More... | |
HasProperty (property) | |
Whether current annotation has the specified annotation's property. More... | |
IsEmpty () | |
Check whether current object is empty or not. More... | |
IsMarkup () | |
Check if current annotation is a markup annotation. More... | |
Move (rect) | |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More... | |
Move (rect, is_reset_appearance) | |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More... | |
RemoveProperty (property) | |
Remove a specified annotation's property. More... | |
ResetAppearanceStream () | |
Reset appearance stream. More... | |
ResetAppearanceStream (is_generate_new_appearance_obj) | |
Reset appearance stream. More... | |
SetBorderColor (color) | |
Set border color. More... | |
SetBorderInfo (border) | |
Set border information. More... | |
SetContent (content) | |
Set content. More... | |
SetFlags (flags) | |
Set annotation flags. More... | |
SetModifiedDateTime (date_time) | |
Set last modified date time. More... | |
SetUniqueID (unique_id) | |
Set unique ID. More... | |
Static Public Attributes | |
static | e_3D |
Annotation type: 3D annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_AppearanceTypeDown |
Annotation's down appearance. | |
static | e_AppearanceTypeNormal |
Enumeration for the type of annotation's appearance. More... | |
static | e_AppearanceTypeRollover |
Annotation's rollover appearance. | |
static | e_Caret |
Annotation type: caret annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Circle |
Annotation type: circle annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_FileAttachment |
Annotation type: file attachment annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_FlagHidden |
Annotation flag: hidden. More... | |
static | e_FlagInvisible |
Enumeration for PDF annotation flags. More... | |
static | e_FlagLocked |
Annotation flag: locked. More... | |
static | e_FlagLockedContents |
Annotation flag: locked contents. More... | |
static | e_FlagNoRotate |
Annotation flag: no rotate. More... | |
static | e_FlagNoView |
Annotation flag: no view. More... | |
static | e_FlagNoZoom |
Annotation flag: no zoom. More... | |
static | e_FlagPrint |
Annotation flag: print. More... | |
static | e_FlagReadOnly |
Annotation flag: read only. More... | |
static | e_FlagToggleNoView |
Annotation flag: toggle no view. More... | |
static | e_FreeText |
Annotation type: free text annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Highlight |
Annotation type: highlight annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_HighlightingInvert |
Highlighting mode: Invert, which is to invert the contents of the annotation rectangle. | |
static | e_HighlightingNone |
Enumeration for PDF annotation highlighting mode. More... | |
static | e_HighlightingOutline |
Highlighting mode: Outline, which is to invert the annotation's border. | |
static | e_HighlightingPush |
Highlighting mode: Push, which is to display the annotation's down appearance, if any. | |
static | e_HighlightingToggle |
Highlighting mode: Toggle. This is only useful for widget annotation. | |
static | e_Ink |
Annotation type: ink annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Line |
Annotation type: line annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Link |
Annotation type: link annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_MKEntryBackgroundColor |
Background color entry. "BG" in MK dictionary. | |
static | e_MKEntryBorderColor |
Border color entry. "BC" in MK dictionary. | |
static | e_MKEntryDownCaption |
Down caption (or alternate caption) entry. "AC" in MK dictionary. More... | |
static | e_MKEntryDownIcon |
Down icon (or alternate icon) entry. "IX" in MK dictionary. More... | |
static | e_MKEntryIconCaptionRelation |
Icon and caption relation entry. "TP" in MK dictionary. More... | |
static | e_MKEntryIconFit |
Icon fit information entry. "IF" in MK dictionary. More... | |
static | e_MKEntryNormalCaption |
Normal caption entry. "CA" in MK dictionary. More... | |
static | e_MKEntryNormalIcon |
Normal icon entry. "I" in MK dictionary. More... | |
static | e_MKEntryRolloverCaption |
Rollover caption entry. "RC" in MK dictionary. More... | |
static | e_MKEntryRolloverIcon |
Rollover icon entry. "RI" in MK dictionary. More... | |
static | e_MKEntryRotation |
Enumeration for annotation's MK dictionary (an appearance characteristics) entry. More... | |
static | e_MKRelationCaptionAboveIcon |
Caption above the icon. | |
static | e_MKRelationCaptionBelowIcon |
Caption below the icon. | |
static | e_MKRelationCaptionLeft |
Caption to the left of the icon. | |
static | e_MKRelationCaptionOvrlayOnIcon |
Caption overlaid directly on the icon. | |
static | e_MKRelationCaptionRight |
Caption to the right of the icon. | |
static | e_MKRelationNoCaption |
No caption; icon only. | |
static | e_MKRelationNoIcon |
Enumeration for icon and caption relative position in annotation's MK dictionary. More... | |
static | e_Movie |
Annotation type: movie annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Note |
Annotation type: note annotation, which is just "Text" annotation - one of standard annotation in <PDF reference 1.7>. | |
static | e_PagingSeal |
Annotation type: paging seal annotation. A Foxit PDF SDK custom annotation type (not a standard annotation type). | |
static | e_Polygon |
Annotation type: polygon annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_PolyLine |
Annotation type: polyline annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Popup |
Annotation type: pop-up annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_PrinterMark |
Annotation type: printer's mark annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_PropertyBorderColor |
Annotation property: border color. More... | |
static | e_PropertyCreationDate |
Annotation property: creation date. More... | |
static | e_PropertyFillColor |
Annotation property: fill color. More... | |
static | e_PropertyModifiedDate |
Enumeration for some PDF annotation property. More... | |
static | e_PSInk |
Annotation type: pressure sensitive ink annotation. | |
static | e_Redact |
Annotation type: redact annotation. | |
static | e_RichMedia |
Annotation type: rich media annotation. | |
static | e_Screen |
Annotation type: screen annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Sound |
Annotation type: sound annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Square |
Annotation type: square annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Squiggly |
Annotation type: squiggly annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Stamp |
Annotation type: stamp annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_StrikeOut |
Annotation type: strikeout annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_TrapNet |
Annotation type: trap network annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Underline |
Annotation type: underline annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_UnknownType |
Enumeration for PDF annotation type. More... | |
static | e_Watermark |
Annotation type: watermark annotation. One of standard annotation in <PDF reference 1.7>. | |
static | e_Widget |
Annotation type: widget annotation. One of standard annotation in <PDF reference 1.7>. 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 FSDK.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 FSDK.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:
FSDK.Annot.constructor | ( | page | , |
annot_dict | |||
) |
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. |
FSDK.Annot.GetAppearanceStream | ( | type | , |
appearance_state | |||
) |
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 FSDK.Annot.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. |
FSDK.Annot.GetBorderColor | ( | ) |
Get border color.
This property has effect on annotation's appearance.
FSDK.Annot.GetBorderInfo | ( | ) |
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 = FSDK.BorderInfo.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 FSDK.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.
FSDK.Annot.GetContent | ( | ) |
Get content.
FSDK.Annot.GetDeviceRect | ( | matrix | ) |
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 FSDK.PDFPage.GetDisplayMatrix and also used for rendering. |
FSDK.Annot.GetDict | ( | ) |
Get annotation's dictionary object.
FSDK.Annot.GetDisplayMatrix | ( | page_display_matrix | ) |
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 FSDK.PDFPage.GetDisplayMatrix. |
FSDK.Annot.GetFlags | ( | ) |
Get annotation flags.
FSDK.Annot.GetIndex | ( | ) |
Get the index of current annotation in the page which current annotation belongs to.
FSDK.Annot.GetModifiedDateTime | ( | ) |
Get last modified date time.
FSDK.Annot.GetOptionalContent | ( | ) |
Get the PDF dictionary of annotation's optional content.
FSDK.Annot.GetPage | ( | ) |
Get the related PDF page.
FSDK.Annot.GetRect | ( | ) |
Get rectangle, in PDF coordinate system.
FSDK.Annot.GetType | ( | ) |
Get actual annotation type of current annotation.
FSDK.Annot.GetUniqueID | ( | ) |
Get unique ID.
FSDK.Annot.HasProperty | ( | property | ) |
Whether current annotation has the specified annotation's property.
[in] | property | Property name. Please refer to values starting from FSDK.Annot.e_PropertyModifiedDate and this should be one of these values. |
FSDK.Annot.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
FSDK.Annot.IsMarkup | ( | ) |
Check if current annotation is a markup annotation.
FSDK.Annot.Move | ( | rect | ) |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system.
[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. |
FSDK.Annot.Move | ( | rect | , |
is_reset_appearance | |||
) |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system.
[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. |
[in] | is_reset_appearance | A boolean value specifies whether to reset annotation's appearance after moving. |
FSDK.Annot.RemoveProperty | ( | property | ) |
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 FSDK.Annot.e_PropertyBorderColor and FSDK.Annot.e_PropertyFillColor, user should call function FSDK.Annot.ResetAppearanceStream to make effect on annotation's appearance.
[in] | property | Property name. Please refer to values starting from FSDK.Annot.e_PropertyModifiedDate and this should be one of these values. |
FSDK.Annot.ResetAppearanceStream | ( | ) |
Reset appearance stream.
Annotation's appearance is stored as stream in PDF document. Any appearance-related property can be changed through the corresponding setting functions. For this change to take effect, this function should be called to update the annotation's appearance.
Please check "Note" part in the comment of class FSDK.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.
FSDK.Annot.ResetAppearanceStream | ( | is_generate_new_appearance_obj | ) |
Reset appearance stream.
Annotation's appearance is stored as stream in PDF document. Any appearance-related property can be changed through the corresponding setting functions. For this change to take effect, this function should be called to update the annotation's appearance.
Please check "Note" part in the comment of class FSDK.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.
[in] | is_generate_new_appearance_obj | true means to generate a new appearance object to reset the appearance of the current annotation, while false means to reset the appearance of annotations that share this appearance stream. The parameter has only effect on widget annotation's appearance. |
FSDK.Annot.SetBorderColor | ( | color | ) |
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 FSDK.Annot.ResetAppearanceStream after setting the new border color.
[in] | color | New border color to be set. Format: 0xRRGGBB. |
FSDK.Annot.SetBorderInfo | ( | border | ) |
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 FSDK.Annot.ResetAppearanceStream after setting the new border information.
Attention: among supported annotation types (please refer to "Note" comment part of class FSDK.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. |
FSDK.Annot.SetContent | ( | content | ) |
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 FSDK.Annot.ResetAppearanceStream after setting new content.
[in] | content | New content string to be set. |
FSDK.Annot.SetFlags | ( | flags | ) |
Set annotation flags.
[in] | flags | The annotation flags. It could be 0, or one or a combination of values starting from FSDK.Annot.e_FlagInvisible. |
FSDK.Annot.SetModifiedDateTime | ( | date_time | ) |
Set last modified date time.
[in] | date_time | The data time to be set. It should contain valid date time data. |
FSDK.Annot.SetUniqueID | ( | unique_id | ) |
Set unique ID.
[in] | unique_id | New unique ID string to be set. |
|
static |
Enumeration for the type of annotation's appearance.
Values of this enumeration should be used alone.
Annotation's normal appearance.
|
static |
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.
|
static |
Enumeration for PDF annotation flags.
Values of this enumeration can be used alone or in combination.
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.
|
static |
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.
|
static |
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.
|
static |
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.
|
static |
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 FSDK.Annot.e_FlagPrint) but should be considered hidden for purposes of on-screen display and user interaction.
|
static |
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.
|
static |
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.
|
static |
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 FSDK.Annot.e_FlagNoView and FSDK.Annot.e_FlagPrint) but should not respond to mouse clicks or change its appearance in response to mouse motions.
|
static |
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.
|
static |
Enumeration for PDF annotation highlighting mode.
Values of this enumeration should be used alone.
Highlighting mode: No highlighting.
|
static |
Down caption (or alternate caption) entry. "AC" in MK dictionary.
|
static |
Down icon (or alternate icon) entry. "IX" in MK dictionary.
|
static |
Icon and caption relation entry. "TP" in MK dictionary.
|
static |
Icon fit information entry. "IF" in MK dictionary.
|
static |
Normal caption entry. "CA" in MK dictionary.
|
static |
Normal icon entry. "I" in MK dictionary.
|
static |
Rollover caption entry. "RC" in MK dictionary.
|
static |
Rollover icon entry. "RI" in MK dictionary.
|
static |
Enumeration for annotation's MK dictionary (an appearance characteristics) entry.
Values of this enumeration should be used alone.
Rotation entry. "R" in MK dictionary.
|
static |
Enumeration for icon and caption relative position in annotation's MK dictionary.
Values of this enumeration should be used alone.
No icon; captin only.
|
static |
Annotation property: border color.
Free text annotation can have border color property but not support to remove this property from free text annotation.
|
static |
Annotation property: creation date.
Only markup annotations can have creation date property.
|
static |
Annotation property: fill color.
Only following types of annotations can have fill color property:
square, circle, free text, line, polygon, polyline, redact.
|
static |
Enumeration for some PDF annotation property.
Values of this enumeration should be used alone.
Annotation property: modified date.
|
static |
Enumeration for PDF annotation type.
Values of this enumeration should be used alone.
Annotation type: unknown.
|
static |
Annotation type: widget annotation. One of standard annotation in <PDF reference 1.7>.