|
Foxit PDF SDK
|
Public Member Functions | |
| def | AddPoint (point, type, pressure) |
| Add a point. More... | |
| def | ConvertToPDFAnnot (page, annot_rect, rotate) |
| Convert a PSI object to a PSInk annotation and insert the PSInk annotation to a PDF page. More... | |
| def | GetBitmap () |
| Get the canvas bitmap. More... | |
| def | GetContentsRect () |
| Get contents rectangle. More... | |
| def | IsEmpty () |
| Check whether current object is empty or not. More... | |
| def | SetCallback (callback) |
| Set a callback object for refreshing. More... | |
| def | SetColor (color) |
| Set ink color. More... | |
| def | SetDiameter (diameter) |
| Set ink diameter. More... | |
| def | SetOpacity (opacity) |
| Set ink opacity. More... | |
PSI, "pressure sensitive ink", is specially defined for manual signature, and usually works together with a handwriting board or for a touchscreen. PSI contains private coordinates, and a canvas is created in its coordinates. Canvas limits operating area and generates appearance of PSI.
PSI is independent of PDF, and can even be used directly in the device screen. If user wants to save a PSI object to PDF file, please call function fsdk.PSI.ConvertToPDFAnnot . This function will convert PSI data to a PSInk annotation (as a Foxit custom annotation type) and insert the PSInk annotation to the specified position in a PDF page.
| def fsdk.PSI.AddPoint | ( | point, | |
| type, | |||
| pressure | |||
| ) |
Add a point.
| [in] | point | A point in canvas coordinate system. |
| [in] | type | Point type. This should be one of following values: fsdk.PathE_TypeMoveTo , fsdk.PathE_TypeLineTo , fsdk.PathE_TypeLineToCloseFigure , |
| [in] | pressure | Pressure value for this point. Valid range: from 0.0 to 1.0. |
| def fsdk.PSI.ConvertToPDFAnnot | ( | page, | |
| annot_rect, | |||
| rotate | |||
| ) |
Convert a PSI object to a PSInk annotation and insert the PSInk annotation to a PDF page.
Actually, this function is to convert the path data of current PSI to a PSInk annotation, ignoring the canvas bitmap.
Before calling this function, user should ensure that current PSI object has contained a valid path (whose last point's type is fsdk.PathE_TypeLineToCloseFigure . Otherwise, the conversion will be failed and this function will throw exception fsdk.E_ErrInvalidData .
| [in] | page | A valid PDF page object, to which the PSI is expected to inserted. |
| [in] | annot_rect | A rectangle to specify the position in the PDF page, where the new PSInk annotation will be inserted. It should be valid in [PDF coordinate system] (). |
| [in] | rotate | Rotation value. Currently, it can only be fsdk.E_Rotation0 . |
| def fsdk.PSI.GetBitmap | ( | ) |
Get the canvas bitmap.
| def fsdk.PSI.GetContentsRect | ( | ) |
Get contents rectangle.
| def fsdk.PSI.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
| def fsdk.PSI.SetCallback | ( | callback | ) |
Set a callback object for refreshing.
| [in] | callback | A callback object PSICallback which is implemented by user. Please ensure that the callback object keeps valid until the life-cycle of current PSI object ends. |
| def fsdk.PSI.SetColor | ( | color | ) |
Set ink color.
This should be set before adding first point to PSI object. If not set, the default value 0x000000 will be used.
| [in] | color | Ink color. Format: 0xRRGGBB. |
| def fsdk.PSI.SetDiameter | ( | diameter | ) |
Set ink diameter.
This should be set before adding first point to PSI object. If not set, the default value 10 will be used.
| [in] | diameter | Ink diameter. This should be bigger than 1. |
| def fsdk.PSI.SetOpacity | ( | opacity | ) |
Set ink opacity.
This should be set before adding first point to PSI object. If not set, the default value 1.0 will be used.
| [in] | opacity | Ink opacity. Valid range: from 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque. |