Foxit PDF SDK
foxit::pdf::annots::Screen Class Reference
Inheritance diagram for foxit::pdf::annots::Screen:
foxit::pdf::annots::Annot foxit::Base

Public Member Functions

 Screen ()
 Constructor.
 
 Screen (const Annot &annot)
 Constructor, with parent class object. More...
 
virtual ~Screen ()
 Destructor.
 
actions::Action GetAction ()
 Get action. More...
 
pdf::objects::PDFDictionaryGetMKDict () const
 Get the appearance characteristics dictionary (known as "MK" dictionary as well). More...
 
float GetOpacity () const
 Get opacity value. More...
 
common::Rotation GetRotation ()
 Get the rotation of the image used for the appearance of current screen annotation. More...
 
WString GetTitle () const
 Get title of current screen annotation. More...
 
void RemoveAction ()
 Remove action. More...
 
void SetAction (const actions::Action &action)
 Set action. More...
 
void SetImage (const common::Image &image, int frame_index, int compress)
 Set image to current screen annotation, with a specified frame index. More...
 
void SetMKDict (pdf::objects::PDFDictionary *dict)
 Set the appearance characteristics dictionary (known as "MK" dictionary as well). More...
 
void SetOpacity (float opacity)
 Set opacity value. More...
 
void SetRotation (common::Rotation rotate)
 Set the rotation of the image used for the appearance of current screen annotation. More...
 
void SetTitle (const WString &title)
 Set title of current screen annotation. More...
 
- Public Member Functions inherited from foxit::pdf::annots::Annot
 Annot (const PDFPage &page, objects::PDFDictionary *annot_dict)
 Constructor, with PDF page and annotation's PDF dictionary. More...
 
 Annot (const Annot &annot)
 Constructor, with another annotation object. More...
 
 Annot ()
 Constructor.
 
virtual ~Annot ()
 Destructor.
 
objects::PDFStreamGetAppearanceStream (AppearanceType type, const char *appearance_state="") const
 Get annotation's appearance stream with specified type and state. More...
 
RGB GetBorderColor () const
 Get border color. More...
 
BorderInfo GetBorderInfo () const
 Get border information. More...
 
WString GetContent () const
 Get content. More...
 
RectI GetDeviceRect (const Matrix &matrix)
 Get annotation rectangle in device coordinate system. More...
 
objects::PDFDictionaryGetDict () const
 Get annotation's dictionary object. More...
 
Matrix GetDisplayMatrix (const Matrix &page_display_matrix)
 Get the display matrix, from PDF coordinate system to targeted device coordinate system. More...
 
uint32 GetFlags () const
 Get annotation flags. More...
 
int GetIndex () const
 Get the index of current annotation in the page which current annotation belongs to. More...
 
DateTime GetModifiedDateTime () const
 Get last modified date time. More...
 
objects::PDFDictionaryGetOptionalContent () const
 Get the PDF dictionary of annotation's optional content. More...
 
PDFPage GetPage () const
 Get the related PDF page. More...
 
RectF GetRect () const
 Get rectangle, in PDF coordinate system. More...
 
Type GetType () const
 Get actual annotation type of current annotation. More...
 
WString GetUniqueID () const
 Get unique ID. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool IsMarkup () const
 Check if current annotation is a markup annotation. More...
 
bool Move (const RectF &rect)
 Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
 
bool operator!= (const Annot &other) const
 Not equal operator. More...
 
Annotoperator= (const Annot &annot)
 Assign operator. More...
 
bool operator== (const Annot &other) const
 Equal operator. More...
 
bool RemoveProperty (Property property)
 Remove a specified annotation's property. More...
 
bool ResetAppearanceStream ()
 Reset appearance stream. More...
 
void SetBorderColor (RGB color)
 Set border color. More...
 
void SetBorderInfo (const BorderInfo &border)
 Set border information. More...
 
void SetContent (const WString &content)
 Set content. More...
 
void SetFlags (uint32 flags)
 Set annotation flags. More...
 
void SetModifiedDateTime (const DateTime &date_time)
 Set last modified date time. More...
 
void SetUniqueID (const WString &unique_id)
 Set unique ID. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Additional Inherited Members

- Public Types inherited from foxit::pdf::annots::Annot
enum  AppearanceType { e_AppearanceTypeNormal = 0, e_AppearanceTypeRollover = 1, e_AppearanceTypeDown = 2 }
 Enumeration for the type of annotation's appearance. More...
 
enum  Flags {
  e_FlagInvisible = 0x0001, e_FlagHidden = 0x0002, e_FlagPrint = 0x0004, e_FlagNoZoom = 0x0008,
  e_FlagNoRotate = 0x0010, e_FlagNoView = 0x0020, e_FlagReadOnly = 0x0040, e_FlagLocked = 0x0080,
  e_FlagToggleNoView = 0x0100, e_FlagLockedContents = 0x0200
}
 Enumeration for PDF annotation flags. More...
 
enum  HighlightingMode {
  e_HighlightingNone = 0, e_HighlightingInvert = 1, e_HighlightingOutline = 2, e_HighlightingPush = 3,
  e_HighlightingToggle = 4
}
 Enumeration for PDF annotation highlighting mode. More...
 
enum  MKEntry {
  e_MKEntryRotation = 0, e_MKEntryBorderColor = 1, e_MKEntryBackgroundColor = 2, e_MKEntryNormalCaption = 3,
  e_MKEntryRolloverCaption = 4, e_MKEntryDownCaption = 5, e_MKEntryNormalIcon = 6, e_MKEntryRolloverIcon = 7,
  e_MKEntryDownIcon = 8, e_MKEntryIconFit = 9, e_MKEntryIconCaptionRelation = 10
}
 Enumeration for annotation's MK dictionary (an appearance characteristics) entry. More...
 
enum  MKIconCaptionRelation {
  e_MKRelationNoIcon = 0, e_MKRelationNoCaption = 1, e_MKRelationCaptionBelowIcon = 2, e_MKRelationCaptionAboveIcon = 3,
  e_MKRelationCaptionRight = 4, e_MKRelationCaptionLeft = 5, e_MKRelationCaptionOvrlayOnIcon = 6
}
 Enumeration for icon and caption relative position in annotation's MK dictionary. More...
 
enum  Property { e_PropertyModifiedDate = 0, e_PropertyCreationDate = 1, e_PropertyBorderColor = 2, e_PropertyFillColor = 3 }
 Enumeration for some PDF annotation property. More...
 
enum  Type {
  e_UnknownType = 0, e_Note = 1, e_Link = 2, e_FreeText = 3,
  e_Line = 4, e_Square = 5, e_Circle = 6, e_Polygon = 7,
  e_PolyLine = 8, e_Highlight = 9, e_Underline = 10, e_Squiggly = 11,
  e_StrikeOut = 12, e_Stamp = 13, e_Caret = 14, e_Ink = 15,
  e_PSInk = 16, e_FileAttachment = 17, e_Sound = 18, e_Movie = 19,
  e_Widget = 20, e_Screen = 21, e_PrinterMark = 22, e_TrapNet = 23,
  e_Watermark = 24, e_3D = 25, e_Popup = 26, e_Redact = 27
}
 Enumeration for PDF annotation type. More...
 

Detailed Description

A screen annotation 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. Usually, rendition action is set to a screen annotation in order that the screen annotation can be used to play media clip.
Class annots::Screen is derived from Annot, and offers functions to get/set link annotation's properties and reset appearance stream of a screen annotation. Appearance stream of a screen annotation is used for printing (if possible) and when the related media clip is not being played.

Note
For a newly created screen annotation, it has no border information and no border color.
See also
Annot

Constructor & Destructor Documentation

◆ Screen()

foxit::pdf::annots::Screen::Screen ( const Annot annot)
explicit

Constructor, with parent class object.

Parameters
[in]annotParent class object.

Member Function Documentation

◆ GetAction()

actions::Action foxit::pdf::annots::Screen::GetAction ( )

Get action.

This function cannot be used to get action which is used as additional action. If user wants to get any additional action, please refer to class actions::AdditionalAction for more details.

Returns
An action object that receives the action data. If the return value of function actions::Action::IsEmpty for the returned action object is true, that means no action.

◆ GetMKDict()

pdf::objects::PDFDictionary* foxit::pdf::annots::Screen::GetMKDict ( ) const

Get the appearance characteristics dictionary (known as "MK" dictionary as well).

Returns
A PDF dictionary that represents the "MK" dictionary. If this dictionary is not set to a screen annotation (including current one), please call function objects::PDFObject::Release (inherited from objects::PDFDictionary's parent class) to release it.

◆ GetOpacity()

float foxit::pdf::annots::Screen::GetOpacity ( ) const

Get opacity value.

This property has effect on annotation's appearance.

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

◆ GetRotation()

common::Rotation foxit::pdf::annots::Screen::GetRotation ( )

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

Returns
Rotation value of the image. Please refer to values starting from common::e_Rotation0 and this would be one of these values.

◆ GetTitle()

WString foxit::pdf::annots::Screen::GetTitle ( ) const

Get title of current screen annotation.

Returns
The title string.

◆ RemoveAction()

void foxit::pdf::annots::Screen::RemoveAction ( )

Remove action.

This function cannot be used to remove action which is used as additional action. If user wants to remove any additional action, please refer to class actions::AdditionalAction for more details.

Returns
true means success, while false means failure.

◆ SetAction()

void foxit::pdf::annots::Screen::SetAction ( const actions::Action action)

Set action.

This function cannot be used to set action which is used as additional action. If user wants to set any additional action, please refer to class actions::AdditionalAction for more details.

Parameters
[in]actionNew action to be set. It should be valid. Currently only support following types as the new action:
actions::Action::e_TypeGoto, actions::Action::e_TypeURI, actions::Action::e_TypeJavaScript, actions::Action::e_TypeNamed, actions::Action::e_TypeGoToR, actions::Action::e_TypeGoToE, actions::Action::e_TypeSubmitForm, actions::Action::e_TypeResetForm, actions::Action::e_TypeHide, actions::Action::e_TypeLaunch, actions::Action::e_TypeImportData, actions::Action::e_TypeRendition.
Returns
None.

◆ SetImage()

void foxit::pdf::annots::Screen::SetImage ( const common::Image image,
int  frame_index,
int  compress 
)

Set image to current screen 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 effect to be shown in annotation's appearance, please call function Annot::ResetAppearanceStream after this function.

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 common::Image::e_Unknown.
[in]frame_indexFrame index. Valid range: from 0 to (count-1). count is returned by function common::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.

◆ SetMKDict()

void foxit::pdf::annots::Screen::SetMKDict ( pdf::objects::PDFDictionary dict)

Set the appearance characteristics dictionary (known as "MK" dictionary as well).

Parameters
[in]dictA PDF dictionary that represents the new "MK" dictionary to be set. User should not release this dictionary after setting it to a screen annotation.

◆ SetOpacity()

void foxit::pdf::annots::Screen::SetOpacity ( float  opacity)

Set opacity value.

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

Parameters
[in]opacityThe new opacity value. Valid range: 0.0 to 1.0 . 0.0 means full transparency and 1.0 means full opaque.
Returns
None.

◆ SetRotation()

void foxit::pdf::annots::Screen::SetRotation ( common::Rotation  rotate)

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

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

Parameters
[in]rotateRotation value. Please refer to values starting from common::e_Rotation0 and this should be one of these values except common::e_RotationUnknown.
Returns
None.

◆ SetTitle()

void foxit::pdf::annots::Screen::SetTitle ( const WString title)

Set title of current screen annotation.

Parameters
[in]titleThe title string to be set.
Returns
None.