## PopplerAction

PopplerAction — Action links

## Functions

PopplerAction * | poppler_action_copy ()
void | poppler_action_free ()
PopplerDest * | poppler_dest_copy ()
void | poppler_dest_free ()

## Types and Values

| PopplerAction
| PopplerDest
struct | PopplerActionAny
struct | PopplerActionGotoDest
struct | PopplerActionGotoRemote
struct | PopplerActionLaunch
struct | PopplerActionUri
struct | PopplerActionNamed
struct | PopplerActionMovie
struct | PopplerActionRendition
struct | PopplerActionResetForm
struct | PopplerActionOCGState
struct | PopplerActionJavascript
enum | PopplerActionType
enum | PopplerDestType
enum | PopplerActionMovieOperation
| PopplerActionLayer
enum | PopplerActionLayerAction

## Object Hierarchy

        GBoxed
        ├── PopplerAction
        ╰── PopplerDest
        GEnum
        ├── PopplerActionLayerAction
        ├── PopplerActionMovieOperation
        ├── PopplerActionType
        ╰── PopplerDestType

## Includes

    #include <poppler.h>

## Description

## Functions

### poppler_action_copy ()

    PopplerAction *
    poppler_action_copy (PopplerAction *action);

Copies `action` , creating an identical PopplerAction.

#### Parameters

action | a PopplerAction |

#### Returns

a new action identical to `action`

### poppler_action_free ()

    void
    poppler_action_free (PopplerAction *action);

Frees `action`

#### Parameters

action | a PopplerAction |

### poppler_dest_copy ()

    PopplerDest *
    poppler_dest_copy (PopplerDest *dest);

Copies `dest` , creating an identical PopplerDest.

#### Parameters

dest | a PopplerDest |

#### Returns

a new destination identical to `dest`

### poppler_dest_free ()

    void
    poppler_dest_free (PopplerDest *dest);

Frees `dest`

#### Parameters

dest | a PopplerDest |

## Types and Values

### PopplerAction

A generic wrapper for actions that exposes only PopplerActionType.

### PopplerDest

    typedef struct {
        PopplerDestType type;

        int page_num;
        double left;
        double bottom;
        double right;
        double top;
        double zoom;
        gchar *named_dest;
        guint change_left : 1;
        guint change_top : 1;
        guint change_zoom : 1;
    } PopplerDest;

Data structure for holding a destination

Note that `named_dest` is the string representation of the named destination. This is the right form to pass to poppler functions, e.g. `poppler_document_find_dest()`, but to get the destination as it appears in the PDF itself, you need to convert it to a bytestring with `poppler_named_dest_to_bytestring()` first. Also note that `named_dest` does not have a defined encoding and is not in a form suitable to be displayed to the user.

#### Members

PopplerDestType `type`; | type of destination |
int `page_num`; | page number |
double `left`; | left coordinate |
double `bottom`; | bottom coordinate |
double `right`; | right coordinate |
double `top`; | top coordinate |
double `zoom`; | scale factor |
gchar *`named_dest`; | name of the destination (POPPLER_DEST_NAMED only) |
guint `change_left` : 1; | whether left coordinate should be changed |
guint `change_top` : 1; | whether top coordinate should be changed |
guint `change_zoom` : 1; | whether scale factor should be changed |

### struct PopplerActionAny

    struct PopplerActionAny {
        PopplerActionType type;
        gchar *title;
    };

Fields common to all PopplerActions

#### Members

PopplerActionType `type`; | action type |
gchar *`title`; | action title |

### struct PopplerActionGotoDest

    struct PopplerActionGotoDest {
        PopplerActionType type;
        gchar *title;

        PopplerDest *dest;
    };

Go to destination

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_GOTO_DEST`) |
gchar *`title`; | action title |
PopplerDest *`dest`; | destination |

### struct PopplerActionGotoRemote

    struct PopplerActionGotoRemote {
        PopplerActionType type;
        gchar *title;

        gchar *file_name;
        PopplerDest *dest;
    };

Go to destination in another document

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_GOTO_REMOTE`) |
gchar *`title`; | action title |
gchar *`file_name`; | file name |
PopplerDest *`dest`; | destination |

### struct PopplerActionLaunch

    struct PopplerActionLaunch {
        PopplerActionType type;
        gchar *title;

        gchar *file_name;
        gchar *params;
    };

Launch app (or open document)

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_LAUNCH`) |
gchar *`title`; | action title |
gchar *`file_name`; | file name |
gchar *`params`; | parameters |

### struct PopplerActionUri

    struct PopplerActionUri {
        PopplerActionType type;
        gchar *title;

        char *uri;
    };

URI

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_URI`) |
gchar *`title`; | action title |
char *`uri`; | URI |

### struct PopplerActionNamed

    struct PopplerActionNamed {
        PopplerActionType type;
        gchar *title;

        gchar *named_dest;
    };

Predefined action

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_NAMED`) |
gchar *`title`; | action title |
gchar *`named_dest`; | named destination |

### struct PopplerActionMovie

    struct PopplerActionMovie {
        PopplerActionType type;
        gchar *title;

        PopplerActionMovieOperation operation;
        PopplerMovie *movie;
    };

Play movies.

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_MOVIE`) |
gchar *`title`; | action title |
PopplerActionMovieOperation `operation`; | operation |
PopplerMovie *`movie`; | movie |

Since: 0.14

### struct PopplerActionRendition

    struct PopplerActionRendition {
        PopplerActionType type;
        gchar *title;

        gint op;
        PopplerMedia *media;
    };

Play multimedia content.

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_RENDITION`) |
gchar *`title`; | action title |
gint `op`; | operation |
PopplerMedia *`media`; | media |

Since: 0.14

### struct PopplerActionResetForm

    struct PopplerActionResetForm {
        PopplerActionType type;
        gchar *title;

        GList *fields;
        gboolean exclude;
    };

Resets some or all fields within a PDF form.

The default behavior resets only the list of `fields` , but setting `exclude` to `TRUE` will cause the action to reset all fields but those listed. Providing an empty list of fields resets the entire form.

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_RESET_FORM`) |
gchar *`title`; | action title |
GList *`fields`; | list of field names to reset / retain. | [element-type utf8][nullable]
gboolean `exclude`; | whether to reset all but the listed fields |

Since: 0.90

### struct PopplerActionOCGState

    struct PopplerActionOCGState {
        PopplerActionType type;
        gchar *title;

        GList *state_list;
    };

State of layer.

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_OCG_STATE`) |
gchar *`title`; | action title |
GList *`state_list`; | list of PopplerActionLayers. | [element-type PopplerActionLayer]

Since: 0.14

### struct PopplerActionJavascript

    struct PopplerActionJavascript {
        PopplerActionType type;
        gchar *title;

        gchar *script;
    };

Javascript.

#### Members

PopplerActionType `type`; | action type (`POPPLER_ACTION_JAVASCRIPT`) |
gchar *`title`; | action title |
gchar *`script`; | javascript |

Since: 0.18

### enum PopplerActionType

Action types

#### Members

POPPLER_ACTION_UNKNOWN | unknown action |
POPPLER_ACTION_NONE | no action specified |
POPPLER_ACTION_GOTO_DEST | go to destination |
POPPLER_ACTION_GOTO_REMOTE | go to destination in another document |
POPPLER_ACTION_LAUNCH | launch app (or open document) |
POPPLER_ACTION_URI | URI |
POPPLER_ACTION_NAMED | predefined action |
POPPLER_ACTION_MOVIE | play movies. Since 0.14 |
POPPLER_ACTION_RENDITION | play multimedia content. Since 0.14 |
POPPLER_ACTION_OCG_STATE | state of layer. Since 0.14 |
POPPLER_ACTION_JAVASCRIPT | Javascript. Since 0.18 |
POPPLER_ACTION_RESET_FORM | resets form. Since 0.90 |

### enum PopplerDestType

Destination types

#### Members

POPPLER_DEST_UNKNOWN | unknown destination |
POPPLER_DEST_XYZ | go to page with coordinates (left, top) positioned at the upper-left corner of the window and the contents of the page magnified by the factor zoom |
POPPLER_DEST_FIT | go to page with its contents magnified just enough to fit the entire page within the window both horizontally and vertically |
POPPLER_DEST_FITH | go to page with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window |
POPPLER_DEST_FITV | go to page with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window |
POPPLER_DEST_FITR | go to page with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically |
POPPLER_DEST_FITB | go to page with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically |
POPPLER_DEST_FITBH | go to page with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window |
POPPLER_DEST_FITBV | go to page with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window |
POPPLER_DEST_NAMED | got to page specified by a name. See `poppler_document_find_dest()` |

### enum PopplerActionMovieOperation

Movie operations

#### Members

POPPLER_ACTION_MOVIE_PLAY | play movie |
POPPLER_ACTION_MOVIE_PAUSE | pause playing movie |
POPPLER_ACTION_MOVIE_RESUME | resume paused movie |
POPPLER_ACTION_MOVIE_STOP | stop playing movie |

Since: 0.14

### PopplerActionLayer

    typedef struct {
        PopplerActionLayerAction action;
        GList *layers;
    } PopplerActionLayer;

Action to perform over a list of layers

#### Members

PopplerActionLayerAction `action`; | a PopplerActionLayerAction |
GList *`layers`; | list of PopplerLayers. | [element-type PopplerLayer]

### enum PopplerActionLayerAction

Layer actions

#### Members

POPPLER_ACTION_LAYER_ON | set layer visibility on |
POPPLER_ACTION_LAYER_OFF | set layer visibility off |
POPPLER_ACTION_LAYER_TOGGLE | reverse the layer visibility state |

Since: 0.14