FoxitPDFSDKforWeb v11.0.1
Foxit PDF SDK for Web
Screen Class Reference

Screen annot object. More...

Inheritance diagram for Screen:
Annot Disposable

Public Member Functions

 getAction ()
 Get screen's action. [Support in Server] More...
 
 getAdditionalAction ()
 Retrives the additional action object. More...
 
 getImage (type)
 
 getOpacity ()
 Get opacity value. [Support in Server]
This property has effect on markup annotation's appearance. More...
 
 getRotation ()
 Get the rotation of the image used for the appearance of current screen annotation. More...
 
 removeAction (trigger=-1, action, isObjectNumber=false)
 Remove screen's action. More...
 
 setImage (buffer)
 Set screen's image. More...
 
 setOpacity (opacity)
 Set opacity value. [Support in Server] More...
 
 setRotation (rotation)
 Set the rotation of the image used for the appearance of current screen annotation. More...
 
- Public Member Functions inherited from Annot
 appendAction (actionSpec)
 Appends a action to the annotation. This function cannot be used to append action which is used as additional action. More...
 
 exportToJSON ()
 Export the current annotation to a Json object. [Support in Server] More...
 
 getActionData ()
 Retrieves the action associated with this annotation. This function cannot be used to get action which is used as additional action. More...
 
 getAllActionData ()
 Gets all action data associated with the annotation. This method retrieves all action data including both primary and additional actions of the annotation. The action will be grouped by action trigger type: ActionTriggerEvents.ANNOT_MOUSE_BUTTON_RELEASED. More...
 
 getAnnotId ()
 Retrieves the unique identifier of the annotation. The identifier consists of two components: the page index and the object number, which together ensure the annotation's uniqueness within the document. More...
 
 getBorderColor ()
 Get annotation's border color. [Support in Server] More...
 
 getBorderInfo ()
 Get annotation's border information. [Support in Server] More...
 
 getBorderStyle ()
 Get annotation's border style. More...
 
 getContent ()
 Get annotation's contents. [Support in Server] More...
 
 getDictionaryEntry (key)
 Get the dictionary property of Annot by key. More...
 
 getFlags ()
 Get annotation's flag. [Support in Server] More...
 
 getModifiedDateTime ()
 Get annotation's last modified date time. [Support in Server] More...
 
 getObjectNumber ()
 Get annotation's object number. More...
 
 getPage ()
 Get annotation's page. [Support in Server] More...
 
 getRect ()
 Get annotation's rect. [Support in Server] More...
 
 getTitle ()
 Get annotation's title. [Support in Server] More...
 
 getType ()
 Get annotation's type. [Support in Server] More...
 
 getUniqueID ()
 Get annotation's unique ID. [Support in Server] More...
 
 isEmpty ()
 Check annotation is empty or not. [Support in Server] More...
 
 isMarkup ()
 Check if current annotation is a markup annotation. [Support in Server] More...
 
 removeAction (actionObjNumber)
 Removes a action from the annotation. This function cannot be used to remove action which is used as additional action. More...
 
 setAction (actionSpec)
 Set the action for the annotation. This function cannot be used to set action which is used as additional action. More...
 
 setBorderColor (borderColor)
 Set annotation's border color. [Support in Server] More...
 
 setBorderInfo (borderInfo)
 Set annotation's border information. [Support in Server] More...
 
 setBorderStyle (borderStyle, styleParam)
 Set annotation's border style. More...
 
 setContent (content)
 Set contents for the currently gotten annotation. [Support in Server] More...
 
 setCustomAPStream (appearanceType, appearanceStream)
 
 setDictionaryEntry (key, value)
 Add a new entry or replace the existing entry of the annotation dictionary. Caller could use this method to store their private data to the annotation. Do not use any standard key of the annotation dictionary, such as 'Type', 'Subtype', 'Rect' defined in PDF Reference. If any standard key is used, this behaviour will be undefined. More...
 
 setFlags (flag, notTriggerEvent)
 Set annotation's flag. [Support in Server] More...
 
 setModifiedDateTime (date)
 Set annotation's last modified date time. [Support in Server] More...
 
 setRect (rect)
 Set annotation's rect. More...
 
 supportsAction ()
 This method checks the annotation type and returns true if the type is screen, link or sound annotation, Indicating that are supports actions. For other types of annotation, it returns false. More...
 
 updateAction (actionObjNumber, actionData)
 Updates an existing action in the annotation. This function cannot be used to update action which is used as additional action. More...
 
- Public Member Functions inherited from Disposable
 addDestroyHook (...hooks)
 Add a function to destroyHooks list, which will be called during destroy. More...
 
 destroy ()
 
 ownsTo (owner)
 Establishes an ownership relationship where this instance will be destroyed when the owner is destroyed. Additionally, the owner will be automatically removed from the destroyHooks list when this instance is destroyed. More...
 

Detailed Description

Screen annot object.

Member Function Documentation

◆ getAction()

Screen::getAction ( )
inline

Get screen's action. [Support in Server]

Returns
Action - An action object.

◆ getAdditionalAction()

Screen::getAdditionalAction ( )
inline

Retrives the additional action object.

Returns
AdditionalAction<T> - The additional action object for manipulation additional actions.
Since
11.0.0

◆ getImage()

Screen::getImage (   type)
inline

Get the image data by the specified type.

Parameters
[type='canvas']'canvas'|'image'|'buffer' - The data type, valid value: 'canvas' | 'image' | 'buffer'.
Returns
Promise<ArrayBuffer|HTMLImageElement|HTMLCanvasElement> - The image data by the specified type.
var imageBuf = getImage('buffer');
var blob = new Blob([imageBuf], {type: 'image/png'});
var url = URL.createObjectURL(blob);
Since
8.4.0

◆ getOpacity()

Screen::getOpacity ( )
inline

Get opacity value. [Support in Server]
This property has effect on markup annotation's appearance.

Returns
number - The opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.

◆ getRotation()

Screen::getRotation ( )
inline

Get the rotation of the image used for the appearance of current screen annotation.

Returns
number - Rotation value of the image.
Since
8.2.0

◆ removeAction()

Screen::removeAction (   trigger = -1,
  action,
  isObjectNumber = false 
)
inline

Remove screen's action.

Parameters
[trigger=-1]number - The trigger parameter. If isObjectNumber is true, represents the object number of action to remove. If isObjectNumber is false, represents the trigger event type.
[action]Action - The action to be removed. If first parameter is an object number, this parameter is not required.
[isObjectNumber=false]boolean - Whether the first parameter is an object number. If true, it will call the base class's removeAction method.
Returns
Promise<boolean> - A boolean value indicating whether the action was successfully removed.
Deprecated:
  • For removing additional actions purpose, please use AdditionalAction<T>.removeAction instead
  • For removing action purpose, you must pass the trigger parameter as an object number and set isObjectNumber to true.
    In the future, this method will be simplified to remove actions only, and no additional parameters will be required.
Note
For historical reasons, since version 11.0.0, this method add a new parameter isObjectNumber to determine whether the first parameter is an object number,
if it is, it will call the Annot.removeAction method to remove the action with the object number,
otherwise it will remove an additional action with specified trigger and Action instance.
The isObjectNumber parameter is used for API compatibility, it is not used for removing additional actions.
  • To remove an action, you must pass the trigger parameter as an object number and set isObjectNumber to true.
    The action parameter should be omitted (pass null).
    Example:
    // Remove an action with object number 0
    screenAnnot.removeAction(0, null, true);
  • To remove an additional action, you should use AdditionalAction<T>.removeAction method, this method is only used internally.
See also
AdditionalAction<T>.removeAction
Annot.removeAction
Annot.getActionData

◆ setImage()

Screen::setImage (   buffer)
inline

Set screen's image.

Parameters
bufferArrayBuffer -The raw image buffer, supported types are jpeg/png/bmp..
Returns
Promise<boolean> - true for success, otherwise failure.
async function example(screenAnnot)
{
const resp = await fetch('/xxx/xx.jpeg');
const imageBuffer = await resp.arrayBuffer();
await screenAnnot.setImage(imageBuffer);
}

◆ setOpacity()

Screen::setOpacity (   opacity)
inline

Set opacity value. [Support in Server]

Parameters
opacitynumber - The new opacity value. Valid range: 0.0 to 1.0. 0.0 means full transparency and 1.0 means full opaque.
Returns
Promise<Annot[]> - An array of annotation objects which has been modified. event PDFViewCtrl.constants.ViewerEvents.annotationUpdated Annot[] PDFPage
PDFViewCtrl.constants.ViewerEvents.annotationAppearanceUpdated Annot[] PDFPage

◆ setRotation()

Screen::setRotation (   rotation)
inline

Set the rotation of the image used for the appearance of current screen annotation.

Parameters
rotation0|90|180|270 - Rotation value. this should be one of these values : 0, 90, 180, 270.
Since
8.2.0

Foxit Software Corporation Logo
@2025 Foxit Software Incorporated. All rights reserved.