Class: ScreenAnnot

PDFNet. ScreenAnnot


new ScreenAnnot()

A screen annotation (PDF 1.5) specifies a region of a page upon which media clips may be played. It also serves as an object from which actions can be triggered.

Methods


<static> create(doc, pos)

Creates a new Screen annotation in the specified document.

Parameters:
Name Type Description
doc PDFNet.SDFDoc

A document to which the annotation is added.

pos PDFNet.rect

A rectangle specifying the annotation's bounds in default user space units.

Returns:

A promise that resolves to a newly created blank Screen annotation.

Type
PDFNet.ScreenAnnot

<static> createFromAnnot(ann)

creates a Screen annotation and initializes it using given annotation object.

Parameters:
Name Type Description
ann PDFNet.Annot

Annot object used to initialize the Screen annotation.

Returns:

A promise that resolves to an object of type: "ScreenAnnot"

Type
PDFNet.ScreenAnnot

<static> createFromObj(d)

creates a Screen annotation and initializes it using given Cos/SDF object.

Parameters:
Name Type Description
d PDFNet.Obj

The Cos/SDF object to initialze the annotation with.

Returns:

A promise that resolves to an object of type: "ScreenAnnot"

Type
PDFNet.ScreenAnnot

getAction()

Returns the action of the Screen annotation

Returns:

A promise that resolves to an action object representing the action of the annotation.

Type
PDFNet.Action

getBackgroundColor()

Returns the background color of the annotation.

Returns:

A promise that resolves to a color object that denotes the color of the Screen background.

Type
PDFNet.colorpt

getBackgroundColorCompNum()

Returns the number indicating background color space of the annotation.

Returns:

A promise that resolves to an integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable, 0 means no background color was assigned.

Type
number

getBorderColor()

Returns the border color of the annotation.

Returns:

A promise that resolves to a color object that denotes the color of the Screen border.

Type
PDFNet.colorpt

getBorderColorCompNum()

Returns the number indicating border color space of the annotation.

Returns:

A promise that resolves to an integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk". 0 means this annotation had no color assigned.

Type
number

getFitFull()

Returns the "fit full" flag.

Returns:

A promise that resolves to a boolean value indicating the "fit full" flag value.

Type
boolean

getHIconLeftOver()

Returns the horizontal leftover space of the icon within the annotation.

Returns:

A promise that resolves to a number indicating the horizontal leftover space of the icon within the annotation.

Type
number

getIconCaptionRelation()

Returns the Icon and caption relationship of the annotation.

See:
  • IconCaptionRelation
Returns:

A promise that resolves to a value of the "IconCaptionRelation" enum type. Default value: e_NoIcon.

Type
number
Example
Return value enum:
<pre>
PDFNet.ScreenAnnot.IconCaptionRelation = {
	e_NoIcon : 0
	e_NoCaption : 1
	e_CBelowI : 2
	e_CAboveI : 3
	e_CRightILeft : 4
	e_CLeftIRight : 5
	e_COverlayI : 6
}
</pre>

getMouseDownCaptionText()

Returns the button down caption text of the annotation.

Returns:

A promise that resolves to a string containing the button down text of the annotation.

Type
string

getMouseDownIcon()

Returns the Mouse Down icon associated with the annotation.

Returns:

A promise that resolves to an SDF object that represents the Mouse Down icon associated with the annotation.

Type
PDFNet.Obj

getRolloverCaptionText()

Returns the rollover caption text of the annotation.

Returns:

A promise that resolves to a string containing the rollover caption text of the annotation.

Type
string

getRolloverIcon()

Returns the rollover icon associated with the annotation.

Returns:

A promise that resolves to an SDF object that represents the rollover icon associated with the annotation.

Type
PDFNet.Obj

getScaleCondition()

Returns the condition under which the icon should be scaled.

See:
  • ScaleCondition
Returns:

A promise that resolves to a value of the "ScaleCondition" enum type. Default value: e_Always.

Type
number
Example
Return value enum:
<pre>
PDFNet.ScreenAnnot.ScaleCondition = {
	e_Always : 0
	e_WhenBigger : 1
	e_WhenSmaller : 2
	e_Never : 3
}
</pre>

getScaleType()

Returns the Scale Type of the annotation.

See:
  • ScaleType
Returns:

A promise that resolves to a value of the "ScaleType" enum which represents the Scale Type of the annotation.
Default value: P.

Type
number
Example
Return value enum:
<pre>
PDFNet.ScreenAnnot.ScaleType = {
	e_Anamorphic : 0
	e_Proportional : 1
}
</pre>

getStaticCaptionText()

Returns static caption text of the annotation.

Returns:

A promise that resolves to a string containing the static caption text of the annotation.

Type
string

getStaticIcon()

Returns the static icon associated with the annotation.

Returns:

A promise that resolves to an SDF object that represents the static icon associated with the annotation.

Type
PDFNet.Obj

getTitle()

Returns the title of the annotation.

Returns:

A promise that resolves to a string representing the title of the annotation.

Type
string

getVIconLeftOver()

Returns the vertical leftover space of the icon within the annotation.

Returns:

A promise that resolves to a number indicating the vertical leftover space of the icon within the annotation.

Type
number

setAction(action)

sets the action of the Screen annotation (Optional; PDF 1.1 )

Parameters:
Name Type Description
action PDFNet.Action

An action object representing the action of the annotation.


setBackgroundColor(col, numcomp)

sets the background color of the annotation. (Optional)

Parameters:
Name Type Description
col PDFNet.colorpt

A color point that denotes the color of the screen background.

numcomp number

An integer which value indicates the color space used for the parameter c.


setBorderColor(col, numcomp)

sets the border color of the annotation. (Optional)

Parameters:
Name Type Description
col PDFNet.colorpt

A color object that denotes the color of the screen border.

numcomp number

An integer which value indicates the color space used for the parameter c.


setFitFull(ff)

sets the "fit full" flag. (Optional)

Parameters:
Name Type Description
ff boolean

A boolean value indicating the "fit full" flag value.


setHIconLeftOver(hl)

sets the horizontal leftover space of the icon within the annotation. (Optional)

Parameters:
Name Type Description
hl number

A number indicating the horizontal leftover space of the icon within the annotation.


setIconCaptionRelation(icr)

sets the Icon and caption relationship of the annotation. (Optional; pushbutton fields only)

Parameters:
Name Type Description
icr number/enum
PDFNet.ScreenAnnot.IconCaptionRelation = {
	e_NoIcon : 0
	e_NoCaption : 1
	e_CBelowI : 2
	e_CAboveI : 3
	e_CRightILeft : 4
	e_CLeftIRight : 5
	e_COverlayI : 6
}

A value of the "IconCaptionRelation" enum type. Default value: e_NoIcon.

See:
  • IconCaptionRelation

setMouseDownCaptionText(contents)

sets the button down caption text of the annotation. (Optional; button fields only)

Parameters:
Name Type Description
contents string

A string containing the button down text of the annotation.


setMouseDownIcon(icon)

sets the Mouse Down icon associated with the annotation. (Optional; button fields only)

Parameters:
Name Type Description
icon PDFNet.Obj

An SDF object that represents the Mouse Down icon associated with the annotation.


setRolloverCaptionText(contents)

sets the roll over caption text of the annotation. (Optional; button fields only)

Parameters:
Name Type Description
contents string

A string containing the roll over caption text of the annotation.


setRolloverIcon(icon)

sets the rollover icon associated with the annotation. (Optional; button fields only)

Parameters:
Name Type Description
icon PDFNet.Obj

An SDF object that represents the rollover icon associated with the annotation.


setScaleCondition(sc)

sets the condition under which the icon should be scaled. (Optional)

Parameters:
Name Type Description
sc number/enum
PDFNet.ScreenAnnot.ScaleCondition = {
	e_Always : 0
	e_WhenBigger : 1
	e_WhenSmaller : 2
	e_Never : 3
}

A value of the "ScaleCondition" enum type. Default value: e_Always.


setScaleType(st)

sets the Scale Type of the annotation. (Optional)

Parameters:
Name Type Description
st number/enum
PDFNet.ScreenAnnot.ScaleType = {
	e_Anamorphic : 0
	e_Proportional : 1
}

An entry of the "ScaleType" enum which represents the Scale Type of the annotation.
Default value: P.

See:
  • ScaleType

setStaticCaptionText(contents)

sets static caption text of the annotation. (Optional; button fields only)

Parameters:
Name Type Description
contents string

A string containing the static caption text of the annotation.


setStaticIcon(icon)

sets the static icon associated with the annotation. (Optional; button fields only)

Parameters:
Name Type Description
icon PDFNet.Obj

An SDF object that represents the static icon associated with the annotation.


setTitle(title)

sets the title of the Annotation. (Optional)

Parameters:
Name Type Description
title string

A string representing the title of the annotation.


setVIconLeftOver(vl)

sets the vertical leftover space of the icon within the annotation. (Optional)

Parameters:
Name Type Description
vl number

A number indicating the vertical leftover space of the icon within the annotation.