Foxit PDF SDK
fsdk.Stamp Class Reference

Public Member Functions

def GetIconName ()
 Get icon name.
More...
 
def GetRotation ()
 Get current rotation angle (in clockwise).
More...
 
def Rotate (angle)
 Rotate current annotation from current state with specified angle degree in clockwise.
More...
 
def SetBitmap (bitmap)
 Set bitmap to current stamp annotation.
More...
 
def SetIconName (icon_name)
 Set icon name.
More...
 
def SetImage (image, frame_index, compress)
 Set image to current stamp annotation, with a specified frame index.
More...
 
def SetRotation (angle)
 Set rotation angle (in clockwise).
More...
 

Detailed Description

A stamp annotation displays text or graphics intended to look as if they were stamped on the page with a rubber stamp.
A stamp annotation's appearance can be with an icon or a bitmap. Currently, Foxit PDF SDK does not have any default appearance for predefined standard stamp icons, so user should set a customized annotation icon provider to Foxit PDF SDK by function fsdk.LibrarySetAnnotIconProviderCallback if the stamp is represented by icon.
Stamp annotation is a kind of markup annotation, so class Stamp is derived from class Markup , and also offers functions to get/set stamp annotation's properties and reset appearance stream of a stamp annotation.
Before resetting appearance stream of a stamp annotation, please ensure a stamp annotation has been set valid bitmap or image, or it has an icon name with the supported customized annotation icon provider being set to Foxit PDF SDK; otherwise the stamp annotation cannot be reset appearance stream.

Note
For a newly created stamp annotation, some properties will be set with default values:
opacity = 1.0, icon name = "Draft".
Before calling fsdk.Annot.ResetAppearanceStream (inherited from Stamp 's parent class), user should ensure to set a bitmap to the stamp by function fsdk.Stamp.SetBitmap or fsdk.Stamp.SetImage , or set a useful customized annotation icon provider to Foxit PDF SDK by function fsdk.LibrarySetAnnotIconProviderCallback .
See also
Markup
fsdk.Library

Member Function Documentation

◆ GetIconName()

def fsdk.Stamp.GetIconName ( )

Get icon name.

This property may has effect on stamp annotation's appearance when a supported customized annotation icon provider being set to Foxit PDF SDK. Stamp annotation has predefined standard icon names:
"Approved", "AsIs", "Confidential", "Departmental", "Draft", "Experimental", "Expired", "Final", "ForComment", "ForPublicRelease", "NotApproved", "NotForPublicRelease", "Sold", "TopSecret".

Returns
Icon name string.

◆ GetRotation()

def fsdk.Stamp.GetRotation ( )

Get current rotation angle (in clockwise).

Returns
Current rotation angle (in clockwise). Value range: from 0 to 360.

◆ Rotate()

def fsdk.Stamp.Rotate (   angle)

Rotate current annotation from current state with specified angle degree in clockwise.

Parameters
[in]angleAngle degree value, which is used to rotate current annotation from current state in clockwise. Value range: from 0 to 360. Specially, if the input value is 0 or 360 (which means not to rotate current annotation), current function will do nothing.
Returns
None.

◆ SetBitmap()

def fsdk.Stamp.SetBitmap (   bitmap)

Set bitmap to current stamp annotation.

If user wants the new bitmap has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new bitmap.

Parameters
[in]bitmapA bitmap to be set to current stamp.
Returns
None.

◆ SetIconName()

def fsdk.Stamp.SetIconName (   icon_name)

Set icon name.

This property may has effect on stamp annotation's appearance when a supported customized annotation icon provider being set to Foxit PDF SDK. Stamp annotation has predefined standard icon names:
"Approved", "AsIs", "Confidential", "Departmental", "Draft", "Experimental", "Expired", "Final", "ForComment", "ForPublicRelease", "NotApproved", "NotForPublicRelease", "Sold", "TopSecret".
Once user set a new icon name to current stamp annotation, please ensure the customized icon provider has been set to Foxit PDF SDK by function fsdk.LibrarySetAnnotIconProviderCallback before function fsdk.Annot.ResetAppearanceStream (inherited from Stamp's parent class) is called. For a newly created stamp annotation, if current function is not called, icon name will be "Draft" by default.
If user wants the new icon name has effect on annotation's appearance, please ensure a supported customized annotation icon provider has been set to Foxit PDF SDK and then call function fsdk.Annot.ResetAppearanceStream after setting the new icon name.

Parameters
[in]icon_nameNew icon name string to be set. An empty icon name string means icon of current stamp annotation would be treated as "Draft".
Returns
None.

◆ SetImage()

def fsdk.Stamp.SetImage (   image,
  frame_index,
  compress 
)

Set image to current stamp annotation, with a specified frame index.

Input image may contain multiple frames, and only one frame of the image can be set to current stamp annotation.
If user wants the new image has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new image.

Parameters
[in]imageAn image. One of its frames will be set to current stamp. This image contains at least one frame and the image type should not be fsdk.ImageE_Unknown .
[in]frame_indexFrame index. Valid range: from 0 to (count-1). count is returned by function fsdk.Image.GetFrameCount .
[in]compressCompress algorithm type used to compress image data. Currently, it only supports 2 valid value:
  • 0: no compress.
  • 1: do default compress.

Returns
None.

◆ SetRotation()

def fsdk.Stamp.SetRotation (   angle)

Set rotation angle (in clockwise).

This property has effect on stamp annotation's appearance. If user wants the effect to be shown in annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after this function.

Parameters
[in]angleNew rotation angle (in clockwise) to be set to current annotation. Value range: from 0 to 360.
Returns
None.