# org.pdfclown.samples.cli.ActionSample Class Reference

This sample demonstrates how to apply actions to a document. More...

Inheritance diagram for org.pdfclown.samples.cli.ActionSample:

List of all members.

## Public Member Functions
bool | IsQuit ()
| Gets whether the sample was exited before its completion.
override void | Run ()
| Executes the sample.
## Protected Member Functions
string | GetIndentation (int level)
string | GetOutputPath (string fileName)
| Gets the path used to serialize output files.
string | GetResourcePath (string resourceName)
| Gets the path to a sample resource.
void | Prompt (string message)
| Prompts a message to the user.
string | PromptChoice (IDictionary< string, string > options)
| Gets the user's choice from the given options.
string | PromptChoice (string message)
| Gets the user's choice from the given request.
string | PromptFileChoice (string inputDescription)
bool | PromptNextPage (Page page, bool skip)
| Prompts the user for advancing to the next page.
int | PromptPageChoice (string inputDescription, int startIndex, int endIndex)
| Prompts the user for a page index to select.
int | PromptPageChoice (string inputDescription, int pageCount)
| Prompts the user for a page index to select.
void | Quit ()
| Indicates that the sample was exited before its completion.
string | Serialize (files::File file, string fileName, files::SerializationModeEnum?serializationMode, string title, string subject, string keywords)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file, files::SerializationModeEnum?serializationMode, string title, string subject, string keywords)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file, string title, string subject, string keywords)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file, string fileName, files::SerializationModeEnum?serializationMode)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file, string fileName)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file, files::SerializationModeEnum?serializationMode)
| Serializes the given PDF Clown file object.
string | Serialize (files::File file)
| Serializes the given PDF Clown file object.
## Properties
string | OutputPath`[get]`
| Gets the path used to serialize output files.

##

This sample demonstrates how to apply actions to a document.

In this case, on document-opening a go-to-page-2 action is triggered; then on page-2-opening a go-to-URI action is triggered.

## Member Function Documentation

string org.pdfclown.samples.cli.Sample.GetIndentation | ( | int | level | ) | `[protected, inherited]`

string org.pdfclown.samples.cli.Sample.GetOutputPath | ( | string | fileName | ) | `[protected, inherited]`

Gets the path used to serialize output files.

Parameters:

  | fileName | Relative output file path.

string org.pdfclown.samples.cli.Sample.GetResourcePath | ( | string | resourceName | ) | `[protected, inherited]`

Gets the path to a sample resource.

Parameters:

  | resourceName | Relative resource path.

bool org.pdfclown.samples.cli.Sample.IsQuit | ( |  | ) | `[inherited]`

Gets whether the sample was exited before its completion.

void org.pdfclown.samples.cli.Sample.Prompt | ( | string | message | ) | `[protected, inherited]`

Prompts a message to the user.

Parameters:

  | message | Text to show.

string org.pdfclown.samples.cli.Sample.PromptChoice | ( | IDictionary< string, string > | options | ) | `[protected, inherited]`

Gets the user's choice from the given options.

Parameters:

  | options | Available options to show to the user.

Returns:
  Chosen option key.

string org.pdfclown.samples.cli.Sample.PromptChoice | ( | string | message | ) | `[protected, inherited]`

Gets the user's choice from the given request.

Parameters:

  | message | Description of the request to show to the user.

Returns:
  User choice.

string org.pdfclown.samples.cli.Sample.PromptFileChoice | ( | string | inputDescription | ) | `[protected, inherited]`

bool org.pdfclown.samples.cli.Sample.PromptNextPage | ( | Page | page,
|  | bool | skip |
| ) |  |  | `[protected, inherited]`

Prompts the user for advancing to the next page.

Parameters:

  | page | Next page.
  | skip | Whether the prompt has to be skipped.

Returns:
  Whether to advance.

int org.pdfclown.samples.cli.Sample.PromptPageChoice | ( | string | inputDescription,
|  | int | startIndex,
|  | int | endIndex |
| ) |  |  | `[protected, inherited]`

Prompts the user for a page index to select.

Parameters:

  | inputDescription | Message prompted to the user.
  | startIndex | First page index, inclusive.
  | endIndex | Last page index, exclusive.

Returns:
  Selected page index.

int org.pdfclown.samples.cli.Sample.PromptPageChoice | ( | string | inputDescription,
|  | int | pageCount |
| ) |  |  | `[protected, inherited]`

Prompts the user for a page index to select.

Parameters:

  | inputDescription | Message prompted to the user.
  | pageCount | Page count.

Returns:
  Selected page index.

References org.pdfclown.samples.cli.Sample.PromptPageChoice().

Referenced by org.pdfclown.samples.cli.Sample.PromptPageChoice().

void org.pdfclown.samples.cli.Sample.Quit | ( |  | ) | `[protected, inherited]`

Indicates that the sample was exited before its completion.

override void org.pdfclown.samples.cli.ActionSample.Run | ( |  | ) | `[virtual]`

Executes the sample.

Returns:
  Whether the sample has been completed.

Implements org.pdfclown.samples.cli.Sample.

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | string | fileName,
|  | files::SerializationModeEnum? | serializationMode,
|  | string | title,
|  | string | subject,
|  | string | keywords |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | fileName | Output file name.
  | serializationMode | Serialization mode.
  | title | Document title.
  | subject | Document subject.
  | keywords | Document keywords.

Returns:
  Serialization path.

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | files::SerializationModeEnum? | serializationMode,
|  | string | title,
|  | string | subject,
|  | string | keywords |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | serializationMode | Serialization mode.
  | title | Document title.
  | subject | Document subject.
  | keywords | Document keywords.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | string | title,
|  | string | subject,
|  | string | keywords |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | title | Document title.
  | subject | Document subject.
  | keywords | Document keywords.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | string | fileName,
|  | files::SerializationModeEnum? | serializationMode |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | fileName | Output file name.
  | serializationMode | Serialization mode.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | string | fileName |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | fileName | Output file name.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file,
|  | files::SerializationModeEnum? | serializationMode |
| ) |  |  | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.
  | serializationMode | Serialization mode.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

string org.pdfclown.samples.cli.Sample.Serialize | ( | files::File | file | ) | `[protected, inherited]`

Serializes the given PDF Clown file object.

Parameters:

  | file | PDF file to serialize.

Returns:
  Serialization path.

References org.pdfclown.samples.cli.Sample.Serialize().

Referenced by org.pdfclown.samples.cli.Sample.Serialize().

## Property Documentation

string org.pdfclown.samples.cli.Sample.OutputPath`[get, protected, inherited]`

Gets the path used to serialize output files.

Copyright 2006-2013 Stefano Chizzolini. For more information, please visit PDF Clown home page.