# Objects exported to scripting

## settings

This object hold application settings and can be used to read or write them.

###

    string settings.read(string key,string default=NULL)

Returns application setting with given key. The parameter default specify default value returned when the setting does not exist. It can be omitted, in that case NULL will be returned.

###

    bool settings.readBool(string key,bool default=false)

Returns application setting with given key - treating it as boolean value. The parameter default specify default value returned when the setting does not exist. It can be omitted, in that case false will be returned.

###

    string settings.readExpand(string key,string default=NULL)

Returns application setting with given key. Environment variable references are expanded (see expand). The parameter default specify default value returned when the setting does not exist. It can be omitted, in that case NULL will be returned.

###

    string settings.expand(string)

Return string with environment variable references (in form $VARIABLE and ${VARIABLE}) Any character preceded with backslash (especially $ character) is not processed in expansion.

Some internal variables (all of them beginning with $PDFEDIT_) can override corresponding environment variables. This function will use the internal variable in expansion if both internal and environment variables exist.

#### List of internal variables

$PDFEDIT_BIN | Full path to directory in which the binary file resides
$PDFEDIT_DATA | Full path to directory with editor data files - usually something like `/usr/share/pdfedit` or `/usr/local/share/pdfedit` unless configured diferently when building editor.

###

    string settings.write(string key,string value)

Write application setting with given key and value

###

    string settings.remove(string key)

Remove key from user settings, effectively restoring the setting to its default value

###

    void settings.flush()

Write all unsaved settings to disk. Unsaved settings are automatically writen to disk on application exit, but this can flush them to disk explicitly.

## Document-related objects in scripting

These objects are set to reflect currently edited document

### document

This object represents currently edited PDF document. Type of this object is Pdf