Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::FillSign Class Reference
Inheritance diagram for foxit::pdf::FillSign:

## Public Types
enum | FillSignObjectType { e_FillSignObjectTypeText = 0, e_FillSignObjectTypeCrossMark = 1, e_FillSignObjectTypeCheckMark = 2, e_FillSignObjectTypeRoundRectangle = 3, e_FillSignObjectTypeLine = 4, e_FillSignObjectTypeDot = 5, e_FillSignObjectTypeSignature = 6, e_FillSignObjectTypeInitialsSignature = 7 }
| Enumeration for fill-sign object type. More...

## Public Member Functions
| FillSign (const FillSign &other)
| Constructor, with another FillSign object. More...
| FillSign (const PDFPage &page)
| Constructor, from a PDF page object. More...
| ~FillSign ()
| Destructor.
FillSignObject | AddObject (FillSignObjectType type, const PointF &point, float width, float height, common::Rotation rotation=common::e_Rotation0)
| Add a new fill-sign object (except text fill-sign object) to related PDF page (which is used in constructor). More...
FillSignObject | AddTextObject (const TextFillSignObjectDataArray &text_data, const PointF &point, float width, float height, common::Rotation rotation=common::e_Rotation0, bool is_comb_field_mode=false)
| Add a new text fill-sign object to related PDF page (which is used in constructor). More...
FillSignObject | GetObjectAtDevicePoint (const PointF &point, const Matrix &matrix)
| Get a fill-sign object by specified point in device coordinate system. More...
FillSignObject | GetObjectAtPoint (const PointF &point)
| Get a fill-sign object by specified point in PDF coordinate system. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const FillSign &other) const
| Not equal operator. More...
FillSign & | operator= (const FillSign &other)
| Assign operator. More...
bool | operator== (const FillSign &other) const
| Equal operator. More...
bool | RemoveObject (const FillSignObject &fillsign_object)
| Remove a specified fill-sign object. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

Fill-sign means to fill some graphics objects to PDF page and sign them. This class is used as a manager for fill-sign objects. User can use this class to add/get/remove fill-sign objects (including cross mark, check mark, dot, line, round rectangle, signature and initials signature) to PDF page.

## Member Enumeration Documentation

## ◆ FillSignObjectType

enum foxit::pdf::FillSign::FillSignObjectType

Enumeration for fill-sign object type.

Values of this enumeration can be used alone.

Enumerator
e_FillSignObjectTypeText | Text fill-sign object.
e_FillSignObjectTypeCrossMark | Cross mark fill-sign object.
e_FillSignObjectTypeCheckMark | Check mark fill-sign object.
e_FillSignObjectTypeRoundRectangle | Round rectangle fill-sign object.
e_FillSignObjectTypeLine | Line fill-sign object.
e_FillSignObjectTypeDot | Dot fill-sign object.
e_FillSignObjectTypeSignature | Signature fill-sign object.
e_FillSignObjectTypeInitialsSignature | Initials signature fill-sign object.

## Constructor & Destructor Documentation

## ◆ FillSign() [1/2]

foxit::pdf::FillSign::FillSign | ( | const PDFPage & | page | ) |
| explicit

Constructor, from a PDF page object.

Please ensure input PDF page has been parsed successfully.

Parameters

  [in] | page | A valid PDF page object.

## ◆ FillSign() [2/2]

foxit::pdf::FillSign::FillSign | ( | const FillSign & | other | ) |

Constructor, with another FillSign object.

Parameters

  [in] | other | Another object.

## Member Function Documentation

## ◆ AddObject()

FillSignObject foxit::pdf::FillSign::AddObject | ( | FillSignObjectType | type,
|  | const PointF & | point,
|  | float | width,
|  | float | height,
|  | common::Rotation | rotation = `common::e_Rotation0`
| ) |  |

Add a new fill-sign object (except text fill-sign object) to related PDF page (which is used in constructor).

This function can be used to add fill-sign object except type FillSign::e_FillSignObjectTypeText. If you want to add a fill-sign object with type FillSign::e_FillSignObjectTypeText, please call function FillSign::AddTextObject instead.

- If to add a fill-sign object with type FillSign::e_FillSignObjectTypeCrossMark, FillSign::e_FillSignObjectTypeCheckMark, FillSign::e_FillSignObjectTypeLine or FillSign::e_FillSignObjectTypeDot, the bigger value of input width and height will be used as both width and height for the new fill-sign object.
- If to add a fill-sign object with type FillSign::e_FillSignObjectTypeLine, input height is useless and will be ignored.

Parameters

  [in] | type | Fill-sign type which is used to specify what kind of fill-sign object is to be added. Please refer to values starting from FillSign::e_FillSignObjectTypeCrossMark and this should be one of these values.
  [in] | point | Left-bottom point for new fill-sign object, in PDF coordinate system.
  [in] | width | Width for new fill-sign object.
  [in] | height | Height for new fill-sign object.
  [in] | rotation | Rotation status information. This rotation value includes the view rotation and page rotation property information. Please refer to values starting from common::e_Rotation0 and this should be one of these values except common::e_RotationUnknown.

Returns
  A new fill-sign object.

## ◆ AddTextObject()

FillSignObject foxit::pdf::FillSign::AddTextObject | ( | const TextFillSignObjectDataArray & | text_data,
|  | const PointF & | point,
|  | float | width,
|  | float | height,
|  | common::Rotation | rotation = `common::e_Rotation0`,
|  | bool | is_comb_field_mode = `false`
| ) |  |

Add a new text fill-sign object to related PDF page (which is used in constructor).

Parameters

  [in] | text_data | A text data array to be set to new text fill-sign object. For each text fill-sign object data, origin_position of member text_state will not be used.
  [in] | point | Left-bottom point for new fill-sign object, in PDF coordinate system.
  [in] | width | Width for new fill-sign object.
  [in] | height | Height for new fill-sign object.
  [in] | rotation | Rotation status information. This rotation value includes the view rotation and page rotation property information. Please refer to values starting from common::e_Rotation0 and this should be one of these values except common::e_RotationUnknown.
  [in] | is_comb_field_mode | A boolean value to decide whether for comb field mode or normal mode: true means to set input text data in comb field mode. For each text fill-sign object data, if charspace of member text_state is 0, default value 6.0f will be used instead. false means to set input text data in normal mode. For each text fill-sign object data, charspace of member text_state will not be used.

Returns
  A new fill-sign object.

## ◆ GetObjectAtDevicePoint()

FillSignObject foxit::pdf::FillSign::GetObjectAtDevicePoint | ( | const PointF & | point,
|  | const Matrix & | matrix
| ) |  |

Get a fill-sign object by specified point in device coordinate system.

After adding the fill-sign object with type FillSign::e_FillSignObjectTypeSignature or FillSign::e_FillSignObjectTypeInitialsSignature,all the existed fill-sign objects which belong to the same PDF document cannot be retrieved.

Parameters

  [in] | point | A specified point in device coordinate system.
  [in] | matrix | A transform matrix from device coordinate system to PDF coordinate system.

Returns
  A fill-sign object.

## ◆ GetObjectAtPoint()

FillSignObject foxit::pdf::FillSign::GetObjectAtPoint | ( | const PointF & | point | ) |

Get a fill-sign object by specified point in PDF coordinate system.

After adding a fill-sign object with type FillSign::e_FillSignObjectTypeSignature or FillSign::e_FillSignObjectTypeInitialsSignature, all the existed fill-sign objects which belong to the same PDF document cannot be retrieved.

Parameters

  [in] | point | A specified point in PDF coordinate system.

Returns
  A fill-sign object.

## ◆ IsEmpty()

bool foxit::pdf::FillSign::IsEmpty | ( |  | ) | const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ operator!=()

bool foxit::pdf::FillSign::operator!= | ( | const FillSign & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another FillSign object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

FillSign& foxit::pdf::FillSign::operator= | ( | const FillSign & | other | ) |

Assign operator.

Parameters

  [in] | other | Another FillSign object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::FillSign::operator== | ( | const FillSign & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another FillSign object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ RemoveObject()

bool foxit::pdf::FillSign::RemoveObject | ( | const FillSignObject & | fillsign_object | ) |

Remove a specified fill-sign object.

After adding a fill-sign object with type FillSign::e_FillSignObjectTypeSignature or FillSign::e_FillSignObjectTypeInitialsSignature, all the existed fill-sign objects which belong to the same PDF document cannot be removed. For this case, this function will return false if any existed fill-sign object is to be removed.

Parameters

  [in] | fillsign_object | A fill-sign object to be removed.

Returns
  true means success, while false means failed.