Foxit PDF SDK
fsdk.PolyLine Class Reference

Public Member Functions

def GetLineEndStyle ()
 Get line ending style of the end point.
More...
 
def GetLineStartStyle ()
 Get line ending style of the start point.
More...
 
def GetMeasureConversionFactor (measure_type)
 Get the conversion factor for measuring.
More...
 
def GetMeasureRatio ()
 Get the scale ratio string for measuring.
More...
 
def GetMeasureRatioW ()
 Get the scale ratio string for measuring.
More...
 
def GetMeasureUnit (measure_type)
 Get the label for displaying the units for measuring.
More...
 
def GetMeasureUnitW (measure_type)
 Get the label for displaying the units for measuring.
More...
 
def GetStyleFillColor ()
 Get fill color for some line ending styles.
More...
 
def GetVertexes ()
 Get vertexes.
More...
 
def SetLineEndStyle (ending_style)
 Set line ending style of the end point.
More...
 
def SetLineStartStyle (starting_style)
 Set line ending style of the start point.
More...
 
def SetMeasureConversionFactor (measure_type, factor)
 Set the conversion factor for measuring.
More...
 
def SetMeasureRatio (ratio)
 Set the scale ratio string for measuring.
More...
 
def SetMeasureUnit (measure_type, unit)
 Set the label for displaying the units for measuring.
More...
 
def SetStyleFillColor (fill_color)
 Set fill color for some line ending styles.
More...
 
def SetVertexes (vertexes)
 Set vertexes.
More...
 

Detailed Description

A polyline annotation (PDF 1.5) is similar to a polygon, except that the first and last vertex are not implicitly connected.
Polyline annotation is a kind of markup annotation, so class PolyLine is derived from class Markup , and also offers functions to get/set polyline annotation's properties and reset appearance stream of a polyline annotation.
For a polyline annotation, vertexes property is required. So please ensure that a polyline annotation has valid vertexes property before resetting its appearance stream; otherwise the polyline annotation cannot be reset appearance stream.

Note
For a newly created polyline annotation, if user calls function fsdk.Annot.ResetAppearanceStream directly after setting required vertexes property and not setting any other properties, the default appearance will be used:
border width = 2.0, border style = fsdk.BorderInfoE_Solid , border color = 0xFFFF0000 (red), opacity = 1.0.
See also
Markup

Member Function Documentation

◆ GetLineEndStyle()

def fsdk.PolyLine.GetLineEndStyle ( )

Get line ending style of the end point.

This property has effect on polyline annotation's appearance.

Returns
The line ending style of the end point. Please refer to values starting from fsdk.MarkupE_EndingStyleNone and this would be one of these values.

◆ GetLineStartStyle()

def fsdk.PolyLine.GetLineStartStyle ( )

Get line ending style of the start point.

This property has effect on polyline annotation's appearance.

Returns
The line ending style of the start point. Please refer to values starting from fsdk.MarkupE_EndingStyleNone and this would be one of these values.

◆ GetMeasureConversionFactor()

def fsdk.PolyLine.GetMeasureConversionFactor (   measure_type)

Get the conversion factor for measuring.

A polyline 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_typeMeasure type. Please refer to values starting from fsdk.MarkupE_MeasureTypeX and this should be one of these values.
Returns
The conversion factor.

◆ GetMeasureRatio()

def fsdk.PolyLine.GetMeasureRatio ( )

Get the scale ratio string for measuring.

A polyline 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 UTF-8 byte string that expresses the scale ratio.

◆ GetMeasureRatioW()

def fsdk.PolyLine.GetMeasureRatioW ( )

Get the scale ratio string for measuring.

A polyline 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()

def fsdk.PolyLine.GetMeasureUnit (   measure_type)

Get the label for displaying the units for measuring.

A polyline 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_typeMeasure type. Please refer to values starting from fsdk.MarkupE_MeasureTypeX and this would be one of these values.
Returns
A UTF-8 text string that represents a label for displaying the units.

◆ GetMeasureUnitW()

def fsdk.PolyLine.GetMeasureUnitW (   measure_type)

Get the label for displaying the units for measuring.

A polyline 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_typeMeasure type. Please refer to values starting from fsdk.MarkupE_MeasureTypeX and this would be one of these values.
Returns
A Unicode string that represents a label for displaying the units.

◆ GetStyleFillColor()

def fsdk.PolyLine.GetStyleFillColor ( )

Get fill color for some line ending styles.

This property has effect on polyline annotation's appearance when the line ending style is one of following styles:
"Square", "Circle", "Diamond", "ClosedArrow", "RClosedArrow".

Returns
The fill color. Format: 0xRRGGBB. If no fill color can be found, 0x000000 will be returned.

◆ GetVertexes()

def fsdk.PolyLine.GetVertexes ( )

Get vertexes.

Vertexes property is required for a polyline annotation and this property has effect on polyline annotation's appearance.

Returns
A point array that represents the vertexes.

◆ SetLineEndStyle()

def fsdk.PolyLine.SetLineEndStyle (   ending_style)

Set line ending style of the end point.

This property has effect on polyline annotation's appearance. If user wants the new line ending style of end point has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new line ending style of end point.

Parameters
[in]ending_styleThe line ending style for the end point to be set. Please refer to values starting from fsdk.MarkupE_EndingStyleNone and this should be one of these values.
Returns
None.

◆ SetLineStartStyle()

def fsdk.PolyLine.SetLineStartStyle (   starting_style)

Set line ending style of the start point.

This property has effect on polyline annotation's appearance. If user wants the new line ending style of start point has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new line ending style of start point.

Parameters
[in]starting_styleThe line ending style for the start point to be set.Please refer to values starting from fsdk.MarkupE_EndingStyleNone and this should be one of these values.
Returns
None.

◆ SetMeasureConversionFactor()

def fsdk.PolyLine.SetMeasureConversionFactor (   measure_type,
  factor 
)

Set the conversion factor for measuring.

A polyline 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_typeMeasure type. Please refer to values starting from fsdk.MarkupE_MeasureTypeX and this should be one of these values.
[in]factorThe conversion factor.
Returns
None.

◆ SetMeasureRatio()

def fsdk.PolyLine.SetMeasureRatio (   ratio)

Set the scale ratio string for measuring.

A polyline 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.

Parameters
[in]ratioA UTF-8 byte string expressing the scale ratio. The string should be like: "1/4 in = 1 ft", indicating that 1/4 inches in default user space is equivalent to 1 foot in real-world measurements.
Returns
None.

◆ SetMeasureUnit()

def fsdk.PolyLine.SetMeasureUnit (   measure_type,
  unit 
)

Set the label for displaying the units for measuring.

A polyline 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_typeMeasure type. Please refer to values starting from fsdk.MarkupE_MeasureTypeX and this would be one of these values.
[in]unitA UTF-8 text string that specifies a label for displaying the units.
Returns
None.

◆ SetStyleFillColor()

def fsdk.PolyLine.SetStyleFillColor (   fill_color)

Set fill color for some line ending styles.

This property has effect on polyline annotation's appearance when the line ending style of start point or end point is one of following styles:
"Square", "Circle", "Diamond", "ClosedArrow", "RClosedArrow".

Parameters
[in]fill_colorNew fill color to be set. Format: 0xRRGGBB.
Returns
None.

◆ SetVertexes()

def fsdk.PolyLine.SetVertexes (   vertexes)

Set vertexes.

Vertexes property is required for a polyline annotation and this property has effect on polyline annotation's appearance. If user wants the new vertexes have effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new vertexes.

Parameters
[in]vertexesA valid point array of vertexes. It should contains at least 2 points as vertexes.
Returns
None.