Foxit PDF SDK

Instance Methods | Properties | List of all members
FSLine Class Reference
Inheritance diagram for FSLine:

## Instance Methods
(void) | - enableCaption:
| Set the flag which is used to decide whether the content of current line annotation should be replicated as a caption in the appearance or not. More...
(float) | - getMeasureConversionFactor:
| Get the conversion factor for measuring. More...
(NSString *) | - getMeasureRatioW
| Get the scale ratio Unicode string for measuring. More...
(NSString *) | - getMeasureUnit:
| Get the label for displaying the units for measuring. More...
(NSString *) | - getMeasureUnitW:
| Get the label (in Unicode string) for displaying the units for measuring. More...
(BOOL) | - hasCaption
| Check whether the content of current line annotation should be replicated as a caption in the appearance or not. More...
(id) | - init
| Constructor.
(id) | - initWithAnnot:
| Constructor, with parent class object. More...
(void) | - setMeasureConversionFactor:factor:
| Set the conversion factor for measuring. More...
(void) | - setMeasureUnit:unit:
| Set the label for displaying the units for measuring. More...
Instance Methods inherited from FSMarkup
(FSNote *) | - addReply
| Add a new reply to the end of reply list. More...
(void) | - addRichText:style:
| Add a new rich text string to the end. More...
(FSNote *) | - addStateAnnot:model:state:
| Add a new state annotation. More...
(FSMarkupArray *) | - getGroupElements
| Get an element (as markup annotation) from the group that current markup annotation belongs to. More...
(FSMarkup *) | - getGroupHeader
| Get the header annotation (as primary annotation) of the group that current markup annotation belongs to. More...
(FSNote *) | - getReply:
| Get a reply by index. More...
(int) | - getReplyCount
| Count all replies. More...
(NSString *) | - getRichTextContent:
| Get text string of a rich text string specified by index. More...
(int) | - getRichTextCount
| Get the count of rich text strings. More...
(FSRichTextStyle *) | - getRichTextStyle:
| Get style data of a rich text string specified by index. More...
(FSNoteArray *) | - getStateAnnots:
| Get all state annotations in a specified state model. More...
(void) | - insertRichText:content:style:
| Insert a new rich text string to the place which is specified by index. More...
(BOOL) | - isGrouped
| Check whether current markup annotation is in a group or not. More...
(BOOL) | - removeAllReplies
| Remove all the replies. More...
(BOOL) | - removeAllStateAnnots
| Remove all the state annotations. More...
(BOOL) | - removePopup
| Remove related pop-up annotation. More...
(BOOL) | - removeReply:
| Remove a reply by index. More...
(void) | - removeRichText:
| Remove a rich text string specified by index. More...
(void) | - setRichTextContent:content:
| Set text string of a rich text string specified by index. More...
(void) | - setRichTextStyle:style:
| Set style data of a rich text string specified by index. More...
(BOOL) | - ungroup
| Ungroup current markup annotation from the group it belongs to. More...
Instance Methods inherited from FSAnnot
(BOOL) | - FSMoveWithResetAppearance:is_reset_appearance:
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
(BOOL) | - FSResetApStreamWithIsGenerateNewAppearanceObj:
| Reset appearance stream. More...
(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) | - 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
FSPointF * | captionOffset
| Get or Set caption offset values. More...
FSLineCapPos | captionPositionType
| Get or Set the position type of caption. More...
FSPointF * | endPoint
| Get or Set the end point. More...
float | leaderLineExtensionLength
| Get or Set the length of leader line extension. More...
float | leaderLineLength
| Get or Set the length of leader line. More...
float | leaderLineOffset
| Get or Set the length of leader line offset. More...
FSMarkupEndingStyle | lineEndStyle
| Get or Set line ending style of the end point. More...
FSMarkupEndingStyle | lineStartStyle
| Get or Set line ending style of the start point. More...
NSString * | measureRatio
| Get or Set the scale ratio string for measuring. More...
FSPointF * | startPoint
| Get or Set the start point. More...
unsigned int | styleFillColor
| Get or Set fill color for ending styles. More...
Properties inherited from FSMarkup
float | borderOpacity
| Get or Set the border opacity of the annotation.
FSDateTime * | creationDateTime
| Get or Set creation date time.
float | fillOpacity
| Get or Set the fill opacity of the annotation.
NSString * | intent
| Get or Set intent name. More...
float | opacity
| Get or Set opacity value. More...
FSPopup * | popup
| Get or Set related pop-up annotation. More...
NSString * | subject
| Get or Set subject string.
NSString * | title
| Get or Set title string. More...
Properties inherited from FSAnnot
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.

## Detailed Description

A line annotation displays a single straight line on the page.
Line annotation is a kind of markup annotation, so class FSLine is derived from class FSMarkup , and also offers functions to get/set line annotation's properties and reset appearance stream of a line annotation.
For a line annotation, start point and end point are required. So please ensure that a line annotation has valid start point and end point before resetting its appearance stream; otherwise the line annotation cannot be reset appearance stream.

Note
  For a newly created line annotation, if user calls function FSAnnot::resetAppearanceStream directly after setting required start point and end point property and not setting any other properties, the default appearance will be used:
  border width = 2.0, border style = FSBorderInfoSolid, border color = 0xFFFF0000 (red), opacity = 1, line starting/ending styles = "None", no caption is enabled.

See also
  FSMarkup

## Method Documentation

## ◆ enableCaption:()

- (void) enableCaption: |  | (BOOL) | cap |

Set the flag which is used to decide whether the content of current line annotation should be replicated as a caption in the appearance or not.

This property has effect on line annotation's appearance. If user wants the effect to be shown in annotation's appearance, please call function FSAnnot::resetAppearanceStream after this function.

Parameters

  [in] | cap | YES means the content should be replicated as a caption in the appearance of current line annotation, while NO means not.

Returns
  None.

## ◆ getMeasureConversionFactor:()

- (float) getMeasureConversionFactor: |  | (FSMarkupMeasureType) | measure_type |

Get the conversion factor for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Please refer to P745 in <PDF Reference 1.7> for more details.

Parameters

  [in] | measure_type | Measure type. Please refer to values starting from FSMarkupMeasureTypeX and this would be one of these values.

Returns
  The conversion factor.

## ◆ getMeasureRatioW()

- (NSString *) getMeasureRatioW |  |  |

Get the scale ratio Unicode string for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Scale ratio string expresses the scale ratio of the drawing in the region. Please refer to P745 in <PDF Reference 1.7> for more details.

Returns
  A Unicode string that expresses the scale ratio.

## ◆ getMeasureUnit:()

- (NSString *) getMeasureUnit: |  | (FSMarkupMeasureType) | measure_type |

Get the label for displaying the units for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Please refer to P745 in <PDF Reference 1.7> for more details.

Parameters

  [in] | measure_type | Measure type. Please refer to values starting from FSMarkupMeasureTypeX and this should be one of these values.

Returns
  A UTF-8 text string that represents a label for displaying the units.

## ◆ getMeasureUnitW:()

- (NSString *) getMeasureUnitW: |  | (FSMarkupMeasureType) | measure_type |

Get the label (in Unicode string) for displaying the units for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Please refer to P745 in <PDF Reference 1.7> for more details.

Parameters

  [in] | measure_type | Measure type. Please refer to values starting from FSMarkupMeasureTypeX and this should be one of these values.

Returns
  A Unicode string that represents a label for displaying the units.

## ◆ hasCaption()

- (BOOL) hasCaption |  |  |

Check whether the content of current line annotation should be replicated as a caption in the appearance or not.

Returns
  YES means the content should be replicated as a caption in the appearance of current line annotation. NO means not to replicate the content as a caption in the appearance of current line annotation.

## ◆ initWithAnnot:()

- (id) initWithAnnot: |  | (FSAnnot*) | annot |

Constructor, with parent class object.

Parameters

  [in] | annot | Parent class object.

Reimplemented from FSMarkup.

## ◆ setMeasureConversionFactor:factor:()

- (void) setMeasureConversionFactor: |  | (FSMarkupMeasureType) | measure_type
factor: |  | (float) | factor

Set the conversion factor for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Please refer to P745 in <PDF Reference 1.7> for more details.

Parameters

  [in] | measure_type | Measure type. Please refer to values starting from FSMarkupMeasureTypeX and this would be one of these values.
  [in] | factor | The conversion factor.

Returns
  None.

## ◆ setMeasureUnit:unit:()

- (void) setMeasureUnit: |  | (FSMarkupMeasureType) | measure_type
unit: |  | (NSString *) | unit

Set the label for displaying the units for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Please refer to P745 in <PDF Reference 1.7> for more details.

Parameters

  [in] | measure_type | Measure type. Please refer to values starting from FSMarkupMeasureTypeX and this should be one of these values.
  [in] | unit | A UTF-8 text string that specifies a label for displaying the units.

Returns
  None.

## Property Documentation

## ◆ captionOffset

- (FSPointF *) captionOffset
| read write nonatomic weak

Get or Set caption offset values.

Caption offset is the offset of caption from its normal position.
Only when current line annotation have a caption, this property is meaningful and has effect on line's annotation's appearance. Function FSLine::hasCaption can be used to check if current line annotation should have a caption, and function FSLine::enableCaption: can be used to change the status.

## ◆ captionPositionType

- (FSLineCapPos) captionPositionType
| read write nonatomic assign

Get or Set the position type of caption.

Only when current line annotation have a caption, this property is meaningful and has effect on line's annotation's appearance. Function FSLine::hasCaption can be used to check if current line annotation should have a caption, and function FSLine::enableCaption: can be used to change the status.

## ◆ endPoint

- (FSPointF *) endPoint
| read write nonatomic weak

Get or Set the end point.

Start point and end point are required for a line annotation. They have effect on line annotation's appearance.

## ◆ leaderLineExtensionLength

- (float) leaderLineExtensionLength
| read write nonatomic assign

Get or Set the length of leader line extension.

Leader line extensions extend from the line proper 180 degrees from the leader lines.
For more details, please refer to "Line Annotations" in Section 8.4.5 "Annotation Types" of <PDF reference 1.7> .

## ◆ leaderLineLength

- (float) leaderLineLength
| read write nonatomic assign

Get or Set the length of leader line.

Leader lines extend from each endpoint of a line perpendicular to the line itself. A positive value means that the leader lines appear in the direction that is clockwise when traversing the line from its start point to its end point; a negative value indicates the opposite direction. Specially, even the length of leader line is 0, the line annotation can still have leader line extension and leader line offset. For this case, the direction of leader line is same as positive length value in order that the direction or position of leader line extension and offset can still be judged.
For more details, please refer to "Line Annotations" in Section 8.4.5 "Annotation Types" of <PDF reference 1.7> .

## ◆ leaderLineOffset

- (float) leaderLineOffset
| read write nonatomic assign

Get or Set the length of leader line offset.

Leader line offset is the amount of empty space between the endpoints of the line annotation and the beginning of the leader lines.
For more details, please refer to "Line Annotations" in Section 8.4.5 "Annotation Types" of <PDF reference 1.7> .

## ◆ lineEndStyle

- (FSMarkupEndingStyle) lineEndStyle
| read write nonatomic assign

Get or Set line ending style of the end point.

This property has effect on line annotation's appearance.

## ◆ lineStartStyle

- (FSMarkupEndingStyle) lineStartStyle
| read write nonatomic assign

Get or Set line ending style of the start point.

This property has effect on line annotation's appearance.

## ◆ measureRatio

- (NSString *) measureRatio
| read write nonatomic weak

Get or Set the scale ratio string for measuring.

A line annotation may have a measure dictionary that specifies an alternate coordinate system for a region of a page. Scale ratio string expresses the scale ratio of the drawing in the region. Please refer to P745 in <PDF Reference 1.7> for more details.

## ◆ startPoint

- (FSPointF *) startPoint
| read write nonatomic weak

Get or Set the start point.

Start point and end point are required for a line annotation. They have effect on line annotation's appearance.

## ◆ styleFillColor

- (unsigned int) styleFillColor
| read write nonatomic assign

Get or Set fill color for ending styles.

This property has effect on line annotation's appearance. Fill color is used for some line ending styles:
"Square", "Circle", "Diamond", "ClosedArrow", "RClosedArrow".