API Documentation

The Elite and Enterprise plans allow script automation of in5. This reference describes the options available for scripting.

Using the API

It is recommended that you use the Adobe Extendscript Toolkit (ESTK) to work with the in5 API.

When calling the in5api, you will first need to declared the following targetengine at the top of your script.

#targetengine 'in5api'

Working with XML

To pass XML (or an XML string) to the run command, you'll need to pass all of the options as children of a single root node.

The children and the root node can have any name, but the attributes must be id and selected, where id is the key string and selected is the value. See the full list of options below.

#targetengine 'in5api' var settings = <options> <option id="textRender" selected="svg"/> <option id="imageQuality" selected="hq"/> </options>; in5api.run(settings);

Methods

getVersion

Gets the currently installed version of in5 as a string.

none

string containing the in5 version (e.g., "3.0.0")

in5.getVersion(); //returns "3.0.0" or similar

run

Runs in5 with the options provided.

optionsCan be an object, a JSON string, XML, or an XML string. See the full list of options below. If no options are provided any options saved with the document from past exports will be used (if available), or the in5 defaults will be used.

string representing the path of the exported file

var filepath = in5api.run({textRender:'html', outputFormat:'multipageweb'});

runDemo

The same as the run method, but can operated without the required license. Let's you test the API with demo settings.

optionsCan be an object, a JSON string, XML, or an XML string. See the full list of options below. If no options are provided any options saved with the document from past exports will be used (if available), or the in5 defaults will be used. Any options not available with you license will be replaced with the allowed demo options.

string representing the path of the exported file

var filepath = in5api.run({textRender:'html', outputFormat:'multipageweb'});

activate

Let's you activate in5.

userOrSerialEmail address or serial number of user account.

passcode (optional)Passcode associated with account (only used if activating with an email address and not a serial number.

boolean of true if successful, false otherwise. Logs any errors in the JavaScript Console.

var success = in5api.activate("me@example.com", "myuserpasscode123");

deactivate

Deactivates in5 user license.

none

boolean of true if successful, false otherwise. Logs any errors in the JavaScript Console.

var success = in5api.deactivate();

getExportPreset

Gets a saved export preset. Options from the preset can then be passed to the run method.

presetNameThe name of an existing export preset

object with keys and values of the preset's options or boolean false if the preset does not exist. See a full list of options below.

var options = in5api.getExportPreset("Baker with HQ images");

Export Options

For convenience, the options below are described in the order displayed within the user interface of the in5 export dialog.

Boolean values are represented with a string of '1' for true and '0' for false.

Basic

title -> default value:

Destination Folder

targFolder -> default value:

Export Range

pageRangeOpt -> default value: all

Available options

all (ui display: All Pages)

custom (ui display: Custom)

pageRangeStr -> default value:

Page Format

pageFormat -> default value: csv

Available options

csv (ui display: Continous Scroll (Vertical))

csh (ui display: Continous Scroll (Horizontal))

liquid (ui display: Liquid)

h (ui display: Slider (Horizontal))

v (ui display: Slider (Vertical))

fade (ui display: Slider (Fade In))

Navigation

bSwipe -> default value: 1

bArrows -> default value: 1

lightboxLinks -> default value: 0

lightboxThumbs -> default value: 0

Text Rendering

textRender -> default value: img

Available options

img (ui display: Images (preserves exact appearance))

html (ui display: HTML with Web-Safe Fallback Fonts)

embedLocal (ui display: HTML with Local Font Embedding (when possible)*)

svg (ui display: SVG (preserves appearance + scalable))

fontWarn -> default value:

Output

outputFormat -> default value: web

Available options

web (ui display: Web)

multipageweb (ui display: Multi-page web)

baker (ui display: Baker Framework (HPUB))

ls (ui display: Liquid State Publishing System)

multiwebapp (ui display: Multi-device Web App (iPad, iPhone, Android))

ipad (ui display: iPad Web App)

iphone (ui display: iPhone Web App)

android (ui display: Android Web App)

clearOld -> default value: 0

footerLink -> default value: 1

Backgrounds

Background Color

bgColor -> default value:

Background Image

bgImage -> default value:

Background Image Position

bgImagePosition -> default value: left top

Available options

left top (ui display: left top)

left center (ui display: left center)

left bottom (ui display: left bottom)

center top (ui display: center top)

center center (ui display: center center)

center bottom (ui display: center bottom)

right top (ui display: right top)

right center (ui display: right center)

right bottom (ui display: right bottom)

Background Image Size

bgImageScale -> default value: auto

Available options

auto (ui display: auto)

cover (ui display: cover)

contain (ui display: contain)

Repeat Background Image

repeatBGX -> default value: 0

repeatBGY -> default value: 0

Page Color

pageColor -> default value:

Page Image

pageImage -> default value:

Page Image Position

pageImagePosition -> default value: left top

Available options

left top (ui display: left top)

left center (ui display: left center)

left bottom (ui display: left bottom)

center top (ui display: center top)

center center (ui display: center center)

center bottom (ui display: center bottom)

right top (ui display: right top)

right center (ui display: right center)

right bottom (ui display: right bottom)

Page Image Size

pageImageScale -> default value: auto

Available options

auto (ui display: auto)

cover (ui display: cover)

contain (ui display: contain)

Repeat Page Image

repeatPageX -> default value: 0

repeatPageY -> default value: 0

SEO & Meta

Description

description -> default value:

Keywords

keywords -> default value:

Author

author -> default value:

Book URL (used with Baker Framework)

bookURL -> default value:

Amazon Web App Verification Key

amazonKey -> default value:

Version

appVersion -> default value:

Analytics & Sharing

Analytics

Google Analytics Tracking ID

gaAccountID -> default value:

App ID (optional)

appID -> default value:

Track:

trackPageViews -> default value: 1

trackButtons -> default value: 0

trackMediaPlays -> default value: 0

trackSocial -> default value: 0

Sharing

share_twitter -> default value: 0

share_facebook -> default value: 0

share_linkedin -> default value: 0

share_gplus -> default value: 0

Sharing Widget Position

sharePosition -> default value: left

Available options

left (ui display: left)

right (ui display: right)

top (ui display: top)

bottom (ui display: bottom)

Custom URL (optional - for apps & offline content)

customShareURL -> default value:

Resources

CSS

cssFiles -> default value:

appendCSS -> default value: 0

JavaScript

jsFiles -> default value:

appendJS -> default value: 0

Folder

resourceFolder -> default value:

HTML to Append

htmlAppend -> default value:

Advanced

Icon

icon -> default value:

Image Quality

imageExport -> default value:

Available options

standard (ui display: Standard)

passthrough (ui display: Use Source Image (when available))

exportOption (ui display: Use Image Export Settings)

hq (ui display: High Definition)

hqtext (ui display: High Definition - Text Frames Only)

Device Viewport Zoom

viewport -> default value: auto

Available options

auto (ui display: Let in5 Choose)

(ui display: Let Device Choose)

zoomToDevice (ui display: Zoom to Device Width)

zoomToLayout (ui display: Zoom to Page Width)

force100 (ui display: Force 100% Scale)

Audio

audioControls -> default value: 1

Application Cache (Offline Viewing)

cache -> default value: none

Available options

none (ui display: None)

all (ui display: Cache All)

nonmedia (ui display: Cache Non-Media Files Only)

Advanced Rendering

scrollOverset -> default value: 0

rectAsCSS -> default value: 1

groupAsImage -> default value: 0

lazyLoad -> default value: 1

dupSpread -> default value: 1

usePts -> default value: 0

unhideLayers -> default value: 0

serverOnly

altFontFolder -> default value:


Notes on JS and CSS Resources

JS and CSS resources have to be specially encoded.

To include multiple files, you can to separate them with a ` character (found with the ~ on the keyboard).

Each file referenced must include a 3-character prefix. A carat character (^), then one of three alpha characters (a,r,w), then a colon character (:).

a is for absolute file paths, r for relative, and w for web-based URLS.

e.g.,"^r:/includes/custom.js"