# LaunchAction Class

> A launch action launches an application or opens or prints a document.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/LaunchAction
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class LaunchAction : Action
```

**Namespace:** `com::datalogics::PDFL`

**Inherits from:** [`Action`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Action.md)

## Description

A launch action launches an application or opens or prints a document.

**Uses types:** [`Action`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Action.md), [`FileSpecification`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/FileSpecification.md), [`PDFDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFDict.md)

## Constructors

### LaunchAction

```java
com.datalogics.PDFL.LaunchAction.LaunchAction(FileSpecification fileSpec)
```

*constructor*

**Parameters**

- `fileSpec` ([`FileSpecification`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/FileSpecification.md)): A FileSpecification representing the application to be launched or the document to be opened or printed by this action.

General constructor.

The action's target will be the path referenced in the FileSpecification parameter. If the path is absolute, the target path will also be absolute. If the path is relative, the target path will also be relative.

Generally, the FileSpecification should be associated with the same Document that contains the LaunchAction. (Both FileSpecification and LaunchAction objects are associated with a Document at creation time, and the association cannot be changed.) The LaunchAction will be associated with the same Document that the FileSpecification parameter is associated with.

If the action's FileSpecification is changed during program execution such that the FileSpecification is associated with a different Document than the LaunchAction, saving the Document that contains the action will create a copy of the FileSpecification in the Document that contains the action.

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.LaunchAction.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.LaunchAction.delete()
```

**Returns:** `synchronized void`

### equals

```java
boolean com.datalogics.PDFL.Action.equals(Object rhs)
```

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

```java
void com.datalogics.PDFL.LaunchAction.finalize()
```

*protected*

**Returns:** `void`

### getFileSpecification

```java
FileSpecification com.datalogics.PDFL.LaunchAction.getFileSpecification()
```

**Returns:** [`FileSpecification`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/FileSpecification.md)

The FileSpecification associated with the LaunchAction.

The FileSpecification for this action. Generally, the FileSpecification should be associated with the same Document that contains the LaunchAction. (Both FileSpecification and LaunchAction are associated with a Document at creation time.)

### getNewWindow

```java
boolean com.datalogics.PDFL.LaunchAction.getNewWindow()
```

**Returns:** `boolean`

true if the destination document is set to open in a new window, false otherwise.

Whether the destination document should be opened in a new window. By default, this flag is not present.

If the action's FileSpecification is not a PDF, this flag is ignored.

### getPDFDict

```java
PDFDict com.datalogics.PDFL.Action.getPDFDict()
```

**Returns:** [`PDFDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFDict.md)

The underlying PDF dictionary for this Action.

Retrieve the PDFObject representation of this object.

### getSubtype

```java
String com.datalogics.PDFL.Action.getSubtype()
```

**Returns:** `String`

The subtype string for this action, such as "GoTo", "URI", "Launch", or "GoToR".

The action's subtype.

### setFileSpecification

```java
void com.datalogics.PDFL.LaunchAction.setFileSpecification(FileSpecification fileSpec)
```

**Parameters**

- `fileSpec` ([`FileSpecification`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/FileSpecification.md)): The FileSpecification to associate with the LaunchAction.

**Returns:** `void`

Set the FileSpecification for this action. Generally, the FileSpecification should be associated with the same Document that contains the LaunchAction. (Both FileSpecification and LaunchAction are associated with a Document at creation time.)

If the FileSpecification is associated with a different Document than the LaunchAction, saving the Document that contains the action will create a copy of the FileSpecification in that Document.

### setNewWindow

```java
void com.datalogics.PDFL.LaunchAction.setNewWindow(boolean newValue)
```

**Parameters**

- `newValue` (`boolean`): true to open the destination document in a new window, false otherwise.

**Returns:** `void`

Set whether the destination document should be opened in a new window. By default, this flag is not present.

If the action's FileSpecification is not a PDF, this flag is ignored.

### toString

```java
String com.datalogics.PDFL.Action.toString()
```

**Returns:** `String`

A string describing this Action.

Returns a string representation of this Action. The string includes the action's subtype.
