|
Foxit PDF SDK
|
Public Member Functions | |
| def | GetAppearanceStream (type, appearance_state) |
| Get annotation's appearance stream with specified type and state. More... | |
| def | GetBorderColor () |
| Get border color. More... | |
| def | GetBorderInfo () |
| Get border information. More... | |
| def | GetContent () |
| Get content. More... | |
| def | GetDeviceRect (matrix) |
| Get annotation rectangle in device coordinate system. More... | |
| def | GetDict () |
| Get annotation's dictionary object. More... | |
| def | GetDisplayMatrix (page_display_matrix) |
| Get the display matrix, from [PDF coordinate system] () to targeted device coordinate system. More... | |
| def | GetFlags () |
| Get annotation flags. More... | |
| def | GetIndex () |
| Get the index of current annotation in the page which current annotation belongs to. More... | |
| def | GetModifiedDateTime () |
| Get last modified date time. More... | |
| def | GetOptionalContent () |
| Get the PDF dictionary of annotation's optional content. More... | |
| def | GetPage () |
| Get the related PDF page. More... | |
| def | GetRect () |
| Get rectangle, in [PDF coordinate system] (). More... | |
| def | GetType () |
| Get actual annotation type of current annotation. More... | |
| def | GetUniqueID () |
| Get unique ID. More... | |
| def | HasProperty (property) |
| Whether current annotation has the specified annotation's property. More... | |
| def | IsEmpty () |
| Check whether current object is empty or not. More... | |
| def | IsMarkup () |
| Check if current annotation is a markup annotation. More... | |
| def | Move (rect) |
| Move current annotation to a new position, specified by a new rectangle in [PDF coordinate system] (). More... | |
| def | Move (rect, is_reset_appearance) |
| Move current annotation to a new position, specified by a new rectangle in [PDF coordinate system] (). More... | |
| def | RemoveProperty (property) |
| Remove a specified annotation's property. More... | |
| def | ResetAppearanceStream (a, interface) |
| Reset appearance stream. More... | |
| def | SetBorderColor (color) |
| Set border color. More... | |
| def | SetBorderInfo (border) |
| Set border information. More... | |
| def | SetContent (content) |
| Set content. More... | |
| def | SetFlags (flags) |
| Set annotation flags. More... | |
| def | SetModifiedDateTime (date_time) |
| Set last modified date time. More... | |
| def | SetUniqueID (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 fsdk.AdditionalAction object with annotation object. Only a few types of annotations may have additional action. For more details, please refer to class fsdk.AdditionalAction .
To search text in annotation, please construct a fsdk.TextSearch object with annotation object. The searching can only support some types of annotations. For more details, please refer to class fsdk.TextSearch .
All the "set" functions in class Annot .
Functions fsdk.Annot.Move , fsdk.Annot.ResetAppearanceStream , fsdk.Annot.RemoveProperty .
| def 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.AnnotE_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. |
| def fsdk.Annot.GetBorderColor | ( | ) |
Get border color.
This property has effect on annotation's appearance.
| def 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.BorderInfoE_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.
| def fsdk.Annot.GetContent | ( | ) |
Get content.
| def 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. |
| def fsdk.Annot.GetDict | ( | ) |
Get annotation's dictionary object.
| def 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 . |
| def fsdk.Annot.GetFlags | ( | ) |
Get annotation flags.
| def fsdk.Annot.GetIndex | ( | ) |
Get the index of current annotation in the page which current annotation belongs to.
| def fsdk.Annot.GetModifiedDateTime | ( | ) |
Get last modified date time.
| def fsdk.Annot.GetOptionalContent | ( | ) |
Get the PDF dictionary of annotation's optional content.
| def fsdk.Annot.GetPage | ( | ) |
Get the related PDF page.
| def fsdk.Annot.GetRect | ( | ) |
Get rectangle, in [PDF coordinate system] ().
| def fsdk.Annot.GetType | ( | ) |
Get actual annotation type of current annotation.
| def fsdk.Annot.GetUniqueID | ( | ) |
Get unique ID.
| def fsdk.Annot.HasProperty | ( | property | ) |
Whether current annotation has the specified annotation's property.
| [in] | property | Property name. Please refer to values starting from fsdk.AnnotE_PropertyModifiedDate and this should be one of these values. |
| def fsdk.Annot.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
| def fsdk.Annot.IsMarkup | ( | ) |
Check if current annotation is a markup annotation.
| def 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] (). |
| def 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. |
| def 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.AnnotE_PropertyBorderColor and fsdk.AnnotE_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.AnnotE_PropertyModifiedDate and this should be one of these values. |
| def fsdk.Annot.ResetAppearanceStream | ( | a, | |
| interface | |||
| ) |
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 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.
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 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. |
| def 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. |
| def 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 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. |
| def 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. |
| def 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.AnnotE_FlagInvisible . |
| def 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. |
| def fsdk.Annot.SetUniqueID | ( | unique_id | ) |
Set unique ID.
| [in] | unique_id | New unique ID string to be set. |