Foxit PDF SDK
fsdk.Square Class Reference

Public Member Functions

def GetFillColor ()
 Get fill color.
More...
 
def GetInnerRect ()
 Get the inner rectangle.
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 Unicode 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 SetFillColor (fill_color)
 Set fill color.
More...
 
def SetInnerRect (inner_rect)
 Set the inner rectangle.
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...
 

Detailed Description

Square annotation is a rectangle on the page. Despite the name "square", a square annotation can represent either a square or a rectangle, which means the width and height of the annotation rectangle need not be equal.
Square annotation is a kind of markup annotation, so class Square is derived from class Markup , and also offers functions to get/set square annotation's properties and reset appearance stream of a square annotation.

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

Member Function Documentation

◆ GetFillColor()

def fsdk.Square.GetFillColor ( )

Get fill color.

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

◆ GetInnerRect()

def fsdk.Square.GetInnerRect ( )

Get the inner rectangle.

For a square annotation, inner rectangle means the actual boundaries of underlying circle. The inner rectangle could be just the same as or less than the annotation's rectangle, and should never be larger than annotation's rectangle.

Returns
The inner rectangle.

◆ GetMeasureConversionFactor()

def fsdk.Square.GetMeasureConversionFactor (   measure_type)

Get the conversion factor for measuring.

A square 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
The conversion factor.

◆ GetMeasureRatio()

def fsdk.Square.GetMeasureRatio ( )

Get the scale ratio string for measuring.

A square 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.Square.GetMeasureRatioW ( )

Get the scale ratio Unicode string for measuring.

A square 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.Square.GetMeasureUnit (   measure_type)

Get the label for displaying the units for measuring.

A square 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
A UTF-8 text string that represents a label for displaying the units.

◆ GetMeasureUnitW()

def fsdk.Square.GetMeasureUnitW (   measure_type)

Get the label for displaying the units for measuring.

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

◆ SetFillColor()

def fsdk.Square.SetFillColor (   fill_color)

Set fill color.

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

◆ SetInnerRect()

def fsdk.Square.SetInnerRect (   inner_rect)

Set the inner rectangle.

For a square annotation, inner rectangle means the actual boundaries of underlying circle. The inner rectangle could be just the same as or less than the annotation's rectangle, and should never be larger than annotation's rectangle.

Parameters
[in]inner_rectNew inner rectangle to be set. It should be same as or less than annotation's rectangle.
Returns
None.

◆ SetMeasureConversionFactor()

def fsdk.Square.SetMeasureConversionFactor (   measure_type,
  factor 
)

Set the conversion factor for measuring.

A square 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]factorThe conversion factor.
Returns
None.

◆ SetMeasureRatio()

def fsdk.Square.SetMeasureRatio (   ratio)

Set the scale ratio string for measuring.

A square 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.Square.SetMeasureUnit (   measure_type,
  unit 
)

Set the label for displaying the units for measuring.

A square 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]unitA UTF-8 text string that specifies a label for displaying the units.
Returns
None.