Foxit PDF SDK
|
Instance Methods | |
(FSPDFStream *) | - getAppearanceStream:appearance_state: |
Get annotation's appearance stream with specified type and state. More... | |
(FSRectI *) | - getDeviceRect: |
Get annotation rectangle in device coordinate system. More... | |
(FSPDFDictionary *) | - getDict |
Get annotation's dictionary object. More... | |
(FSMatrix2D *) | - getDisplayMatrix: |
Get the display matrix, from PDF coordinate system to targeted device coordinate system. More... | |
(int) | - getIndex |
Get the index of current annotation in the page which current annotation belongs to. More... | |
(FSPDFDictionary *) | - getOptionalContent |
Get the PDF dictionary of annotation's optional content. More... | |
(FSPDFPage *) | - getPage |
Get the related PDF page. More... | |
(FSRectF *) | - getRect |
Get rectangle, in PDF coordinate system. More... | |
(FSAnnotType) | - getType |
Get actual annotation type of current annotation. More... | |
(BOOL) | - hasProperty: |
Whether current annotation has the specified annotation's property. More... | |
(id) | - initWithAnnot: |
Constructor, with another annotation object. More... | |
(id) | - initWithPage:annot_dict: |
Constructor, with PDF page and annotation's PDF dictionary. 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: |
Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More... | |
(BOOL) | - removeProperty: |
Remove a specified annotation's property. More... | |
(BOOL) | - resetAppearanceStream |
Reset appearance stream. More... | |
Properties | |
unsigned int | borderColor |
Get or Set border color. More... | |
FSBorderInfo * | borderInfo |
Get or Set border information. More... | |
NSString * | content |
Get or Set content. | |
unsigned int | flags |
Get or Set annotation flags. | |
FSDateTime * | modifiedDateTime |
Get or Set last modified date time. | |
NSString * | uniqueID |
Get or Set unique ID. | |
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 FSAnnot 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:
- (FSPDFStream *) getAppearanceStream: | (FSAnnotAppearanceType) | type | |
appearance_state: | (NSString *) | 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 FSAnnotAppearanceTypeNormal 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. |
- (FSRectI *) getDeviceRect: | (FSMatrix2D*) | 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 FSPDFPage::getDisplayMatrix:top:width:height:rotate: and also used for rendering. |
- (FSPDFDictionary *) getDict |
Get annotation's dictionary object.
- (FSMatrix2D *) getDisplayMatrix: | (FSMatrix2D*) | 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 FSPDFPage::getDisplayMatrix:top:width:height:rotate:. |
- (int) getIndex |
Get the index of current annotation in the page which current annotation belongs to.
- (FSPDFDictionary *) getOptionalContent |
Get the PDF dictionary of annotation's optional content.
- (FSPDFPage *) getPage |
Get the related PDF page.
- (FSRectF *) getRect |
Get rectangle, in PDF coordinate system.
- (FSAnnotType) getType |
Get actual annotation type of current annotation.
- (BOOL) hasProperty: | (FSAnnotProperty) | property |
Whether current annotation has the specified annotation's property.
[in] | property | Property name. Please refer to values starting from FSAnnotPropertyModifiedDate and this should be one of these values. |
- (id) initWithAnnot: | (FSAnnot*) | annot |
Constructor, with another annotation object.
[in] | annot | Another annotation object. |
Reimplemented in FSRedact, FSSound, FSWidget, FSPopup, FSPSInk, FSFileAttachment, FSCaret, FSPolyLine, FSPolygon, FSScreen, FSStamp, FSInk, FSLine, FSFreeText, FSCircle, FSSquare, FSLink, FSTextMarkup, FSHighlight, FSUnderline, FSStrikeOut, FSSquiggly, FSNote, and FSMarkup.
- (id) initWithPage: | (FSPDFPage*) | page | |
annot_dict: | (FSPDFDictionary*) | 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. |
- (BOOL) isEmpty |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
- (BOOL) isMarkup |
Check if current annotation is a markup annotation.
- (BOOL) move: | (FSRectF*) | 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". |
- (BOOL) removeProperty: | (FSAnnotProperty) | 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 FSAnnotPropertyBorderColor and FSAnnotPropertyFillColor, user should call function FSAnnot::resetAppearanceStream to make effect on annotation's appearance.
[in] | property | Property name. Please refer to values starting from FSAnnotPropertyModifiedDate and this should be one of these values. |
- (BOOL) resetAppearanceStream |
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.
|
readwritenonatomicassign |
Get or Set border color.
This property has effect on annotation's appearance.
|
readwritenonatomicweak |
Get or Set 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 = FSBorderInfoSolid, 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 FSAnnot ), 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.