Ink

更新时间:
复制 MD 格式

This topic describes the API operations that are related to the Ink object of presentation documents.

Ink

ActivePresentation.SlideShowSettings.Ink

Creates a brush object.

Important

This feature is only supported in the SDK for JavaScript 1.1.14 or later.

  • Syntax

    expression.ActivePresentation.SlideShowSettings.Ink

    Expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Brush object.
      await app.ActivePresentation.SlideShowSettings.Ink;
        
    }

Methods

ActivePresentation.SlideShowSettings.Ink.Delete

Deletes a brush object (eraser).

Important

This feature is only supported in the SDK for JavaScript 1.1.14 or later.

  • Syntax

    expression.ActivePresentation.SlideShowSettings.Ink.Delete

    Expression: the application object of the document type.

  • Parameters

Parameter

Data type

Default value

Required

Description

Type

number

1

Not required

The erasure mode. Valid values:

  • 0: Erase a specific ink stroke.

  • 1: Erase all ink on the current page.

  • 2: Erase all ink in the entire document.

Position

object

None

Not required

The erasure coordinates (effective when Type is 0, relative to the viewport position) Format: {clientX: number, clientY: number}

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Delete the brush (eraser).
      await app.ActivePresentation.SlideShowSettings.Ink.Delete;
        
    }

Properties

ActivePresentation.SlideShowSettings.Ink.Color

Sets the brush color.

Important

This feature is only supported in the SDK for JavaScript 1.1.14 or later.

  • Syntax

    expression.ActivePresentation.SlideShowSettings.Ink.Color

    Expression: the application object of the document type.

  • Parameters

    Parameter

    Data type

    Default value

    Required

    Description

    Color

    string

    None

    Yes

    The hexadecimal color value. Example: #FFFFFF.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Set the color of the brush.
      await app.ActivePresentation.SlideShowSettings.Ink.Color = '#8bc34a';
    }

ActivePresentation.SlideShowSettings.Ink.Width

Sets the brush width.

Important

This feature is only supported in the SDK for JavaScript 1.1.14 or later.

  • Syntax

    expression.ActivePresentation.SlideShowSettings.Ink.Width

    Expression: the application object of the document type.

  • Parameters

    Parameter

    Data type

    Default value

    Required

    Description

    Width

    number

    None

    Yes

    The brush width.

    Valid values for PCs: 1 to 16.

    Valid values for mobile devices: 1 to 30.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Set the brush width to 10.
      await app.ActivePresentation.SlideShowSettings.Ink.Width = 10;
    }

ActivePresentation.SlideShowSettings.Ink.Type

Sets the brush type.

Important

This feature is only supported in the SDK for JavaScript 1.1.14 or later.

  • Syntax

    expression.ActivePresentation.SlideShowSettings.Ink.Type

    Expression: the application object of the document type.

  • Parameters

    Parameter

    Data type

    Default value

    Required

    Description

    Type

    Number

    None

    Yes

    The brush type. Valid values:

    • 0: Watercolor brush.

    • 1: Highlighter.

    • 2: Smart pen.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Set the brush type to 1 (highlighter).
      await app.ActivePresentation.SlideShowSettings.Ink.Type = 1;
    }