2012 Adobe Systems Incorporated. All rights reserved.
Introduction to Adobe® InDesign® CS6 Server Development
If this guide is distributed with software that includes an end user agreement, this guide, as well as the software
described in it, is furnished under license and may be used or copied only in accordance with the terms of such license.
Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written
permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law
even if it is not distributed with software that includes an end user license agreement.
The content of this guide is furnished for informational use only, is subject to change without notice, and should not be
construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or
liability for any errors or inaccuracies that may appear in the informational content contained in this guide.
Please remember that existing artwork or images that you may want to include in your project may be protected under
copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of
the copyright owner. Please be sure to obtain any permission required from the copyright owner.
Any references to company names in sample templates are for demonstration purposes only and are not intended to
refer to any actual organization.
Adobe, the Adobe logo, InCopy, and InDesign are either registered trademarks or trademarks of Adobe Systems
Incorporated in the United States and/or other countries. Windows s either a registered trademark or a trademark of
Microsoft Corporation in the United States and/or other countries. Mac OS is a trademark of Apple Computer,
Incorporated, registered in the United States and other countries. All other trademarks are the property of their
respective owners.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to U.S. Government End Users.
The Software and Documentation are “Commercial Items,” as that term is defined at 48 C.F.R. §2.101, consisting of
“Commercial Computer Software” and “Commercial Computer Software Documentation,” as such terms are used in 48
C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §§227.7202-1 through
227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are
being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted
to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright
laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S.
Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the
provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act
of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR
Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in the preceding
sentence shall be incorporated by reference.
This document includes an overview of Adobe® InDesign® Server. It describes how to install and run
InDesign Server in a simple environment and describes how to communicate with InDesign Server from
external components.
About Adobe InDesign Server
InDesign Server is used by systems integrators and solution developers to build server-based publishing
solutions. You can think of InDesign Server as a version of InDesign with no user interface. It is built on the
same code base as the desktop version of InDesign, but it is adapted for server use. The adaptations
include support for multiple instances, error capturing and logging, and communication through SOAP.
Like its desktop counterpart, InDesign Server offers a rich development environment. It supports open
standards such as XML, and it is highly scriptable and extensible. InDesign Server can be extended by
using the APIs supplied in the InDesign plug-in SDK and the InDesign Server scripting SDK. These APIs can
be used to create C++ plug-ins, JavaScript scripts, AppleScript scripts, and VBScript scripts.
Where to start
Refer to Getting Started with the Adobe InDesign Server SDK for information on where to start, what is
contained in the InDesign Server SDK installation directory, and how to use the samples provided with the
SDK.
Term in ol og y
This section defines terms used throughout this document:
Ant — Another Neat Tool, a Java-based build tool.
Client—A requester of services from a server in a distributed computing system.
COM—Component Object Model, a technology facilitating interoperability between applications and
components.
IDS—InDesign Server.
<IDS>—The directory where you installed InDesign Server.
<IDS SDK> — The directory where you installed the InDesign Server SDK.
InDesign Server SDK —Includes various technologies for working with InDesign Server, such as SOAP.
All InDesign Server documentation is included in this SDK.
InDesign scripting DOM—Scripting document object model. This refers to the objects within InDesign
and their hierarchy, as accessed through scripting.
InDesign scripting SDK—The API for accessing the scripting DOM.
5
CHAPTER 1: Introduction to Adobe InDesign ServerRoadmap 6
IOR file—Interoperable Object Reference file. This is used by CORBA and its clients to identify an object
in the CORBA object model.
IPv6—Internet Protocol Version 6, the successor to IPv4. IPv6 is supported by InDesign CS4 Server and
later.
Job queueing—A mechanism that queues submitted jobs, executes them asynchronously, and
provides a means to later check a job’s status.
Load balancing—Distributing jobs across multiple instances and servers based on availability.
<locale>—In a path, the language version of InDesign Server; for example, english.
LBQ—An add-on component, Load Balancing and Queuing, that performs job queueing and load
balancing for multiple IDS instances.
Server—The provider of services in a distributed computing system.
Shell window—A command-line window. On Windows®, use Command Prompt (located in the
Accessories folder from the Start menu). On Mac OS®, use the Terminal utility (located in
/Applications/Utilities).
<Scripting SDK>—The directory where you installed the InDesign scripting SDK.
<SDK>—The directory where you installed the InDesign plug-in SDK.
SOAP—Simple Object Access Protocol, an XML-based protocol for exchanging messages between
<version>—In a path, the version number of InDesign Server; for example, for CS6, this is 8.0.
WSDL—Web Service Description Language, an XML-based format for describing how to access a Web
Roadmap
This section provides an overview of various ways to work with and extend InDesign Server and specifies
how to find out more about the topics. The rest of this document provides additional information.
Documentation
The InDesign plug-in SDK and the InDesign Scripting SDK contain documentation and sample code to
teach you how to extend InDesign Server. Both SDKs are available for download from Adobe.com. The
document titles mentioned within this document are located in the SDKs.
Scripting
programs and platforms. InDesign Server supports several versions of SOAP: SOAP industry standard
Versions 1.1 and 1.2 (RPC and doc/lit) and WSDL 1.1.
service and what operations it will perform.
Like InDesign, InDesign Server provides scripting support for JavaScript, AppleScript, and VBScript.
Write a script
To learn how to write InDesign Server scripts, read the following documents:
CHAPTER 1: Introduction to Adobe InDesign ServerRoadmap 7
Adobe InDesign Scripting Tutorial
Adobe InDesign Scripting Guide
Adobe InDesign Server Scripting Guide
Also, you can access the InDesign Object Model Viewer from within the Help menu of Adobe
ExtendScript Toolkit.
Run a script
InDesign Server provides one SOAP method, RunScript, that is used to send a script to InDesign Server.
Your installation of InDesign Server provides a simple SOAP client, SampleClient, that you can use to run a
script. See “Using sampleclient to run an InDesign Server script” on page 20
SampleClient was written using C++, and its source code is provided in the InDesign products SDK. The
InDesign Server SDK contains other sample client projects written in several languages, including C#, PHP,
VB.NET, and Flex.
.
C++
Write a C++ Plug-in
InDesign Server is written in C++ and provides support for C++ plug-ins developed with the InDesign C++
API. For details, refer to “Interfacing with InDesign Server through a plug-in” on page 23
Plug-In Programming Guide, and “InDesign Server Plug-in Techniques” in Getting Started with Adobe
InDesign Plug-In Development.
Access your Plug-in using scripting
To access your plug-in from a script, you must make your plug-in scriptable. For details, refer to the
“Scriptable Plug-in Fundamentals” chapter in the Adobe InDesign Plug-In Programming Guide.
COM
InDesign Server publishes a COM type library that you can use to write COM components that interoperate
with InDesign Server. COM components can be written in several languages. This document briefly
discusses using Visual Basic and C# in “Interfacing with InDesign Server through COM (Windowsonly)” on
page 24.
Windows Service
You can use a Windows Service to manage InDesign Server. To employ the service, first install
InDesignServerService as described in “Installing the InDesign Server Windows Service (Windows only)”
on page 10. Then you can use the InDesign Server Microsoft Management Console snap-in to configure
InDesignServerService.
, Adobe InDesign
CHAPTER 1: Introduction to Adobe InDesign ServerRoadmap 8
launchd Daemon
You can use a launchd daemon to manage InDesign Server on Mac OS. To learn how to configure a
daemon, see “Configuring an InDesign Server launchd daemon for Mac OS” on page 17
.
Performance and scalability
Documentation and tools related to the performance and scalability of InDesign Server are available in the
InDesign Server SDK. Refer to Getting Started with the Adobe InDesign Server SDK.
2
Installing and Running InDesign Server
This chapter explains how to install, run, and configure Adobe InDesign Server.
Installing InDesign Server
Before installing InDesign Server, check your system to make sure it matches the relevant system
requirements. Then run the installer provided by the ESD (Electronic Software Download). After you install,
you can run InDesign Server from the command line, as described in “Running InDesign Server” on
page 11. Please note that serialization for InDesign Server occurs at the command line on first launch by
using the
System requirements
Refer to the detailed system requirements for running InDesign Server, located in the application’s ReadMe
file.
If you want to run the InDesign Server Windows Service, Microsoft .NET Framework Version 2.0 or higher is
required.
-serialnumber argument.
Running the installer
Once you download and expand the InDesign Server ESD (Electronic Software Download), you can run the
installer by double-clicking the installer icon. Follow the instructions displayed on your screen. During
installation, you can specify where to install InDesign Server or use the default location.
On Windows , InDesign Server CS6 is 64 bit only.
On Mac, InDesign Server CS6 is 32 bit only.
CJK feature set
InDesign Server performs composition based on the enabled feature set: Roman (English) or Japanese
(CJK). On Windows, registry settings are used to specify the enabled feature set. On Mac OS, there are two
applications, one with the Roman feature set enabled and one with the CJK feature set enabled.
When installing InDesign Server on an English version of Windows, the feature set defaults to Roman.
When installing on a Chinese version of Windows (for example), the feature set defaults to CJK. During
installation on an English Windows, if you set the installation language to Chinese, the feature set defaults
to CJK.
You can change the default feature set by running regedit and modifying the following keys (change
version number as appropriate):
CHAPTER 2: Installing and Running InDesign ServerInstalling InDesign Server 10
Change the Feature Set Locale Setting key to 400 for Roman or 401 for CJK. The setting takes effect when
InDesign Server is started.
Firewalls
Any firewall that exists between a machine (server) running InDesign Server and clients of the server must
be configured appropriately, so the clients can establish connections with the server. For details, see the
documentation for your firewall or consult with your network system administrator.
Installing the InDesign Server Windows Service (Windows only)
The InDesign Server Windows Service monitors specified instances of InDesign Server and restarts them if
they terminate or if the machine is rebooted. It redirects InDesign Server messages to the Windows event
log, allowing these messages to be viewed locally or remotely, and it allows instances of InDesign Server to
be configured with a user name and password separate from that of the machine’s current user.
The InDesign Server Windows Service can be installed either by using the InDesign Server installer or from
the command line. To use the installer, simply run the InDesign Server installer, and choose the option to
install Service Files for InDesign Server. To install from the command line, set your current directory to the
folder where you installed InDesign Server, and run the following command:
InDesignServerService /install
To uninstall InDesign Server Windows Service using the command line, set your current directory to the
InDesign Server folder, and run the following command:
InDesignServerService /install /u
The second component of the InDesign Server Windows Service is the InDesign Server Service
Management Console snap-in. If you installed the service using the InDesign Server installer, the snap-in
also was installed then. If you used the command line to install the service, you also need to install the
snap-in, as described here.
To install the snap-in on a 64-bit machine, run the following command:
regsvr64 InDesignServerMMC64.dll
Uninstalling the InDesignServerMMC snap-in is the same as installing, with an additional command-line
argument:
regsvr64 InDesignServerMMC64.dll /u
For information on configuring the snap-in, see “Configuring InDesign Server Windows Service” on
page 16.)
Installing the InDesign Server SDK
The InDesign Server SDK contains samples, scripts, and documentation for InDesign Server. The InDesign
Server SDK can be downloaded from Adobe.com. If desired, you can move the SDK folder after setting up
the SDK.
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 11
Running InDesign Server
You can launch InDesign Server from the command line or from another program or script. Each method
allows command-line arguments, which control how InDesign Server runs and is configured.
InDesign Server command-line arguments
The InDesign Server command-line arguments enable you to configure various aspects of InDesign Server.
The command line has the following syntax; the arguments are described in the following table:
InDesignServer [arguments]
ArgumentDescription
-configuration nameOptional. Specifies the configuration name for this instance of InDesign
Server. name must be a valid folder name in the current system, as
InDesign Server uses it to create the configuration folder that stores
private data, cache, and configuration files. By default, the folder name is
“configuration_noport” or “configuration_n” where “n” is the port number
(if the -port argument is specified). The configuration folder is created in:
On Windows:
C:\Documents and Settings\<username>\Application Data\
Adobe\InDesign Server\<version>\<locale>\
-[no]consoleOptional. Windows only. This creates a new console window (a command
shell) and redirects stderr and stdout there. If -noconsole specified, stdout
and stderr are piped to the terminal (or window) that launched InDesign
Server. This argument is useful when using the Microsoft Visual Studio
debugger to debug an InDesign Server plug-in that you are developing,
because by default, the debugger discards data written to stderr and
stdout. This also might be useful when starting InDesign Server from
within another application, like an application server. This argument can
be used only with InDesignServer.exe, not with InDesignServer.com. The
default is -noconsole.
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 12
ArgumentDescription
-[no]errorlistOptional. Controls whether InDesign Server should store the scripting
errors from SOAP invocations in memory. The error list is not cleared
automatically; if more errors are accumulated than allowed for, new errors
are lost. The default is -noerrorlist.
-helpOptional. Displays short descriptions of all arguments.
-iorfile filepathRequired for use with CORBA, which InDesign’s Load Balancing and
Queuing add-in requires; otherwise, optional. Tells InDesign Server where
to write the file containing the application object’s IOR. The IOR in this file
is used by a client to create a reference to the InDesign Server application
object. You can think of this as a cookie that your client code uses to
access InDesign Server’s application object. Each server instance requires
a unique IOR file. Multiple clients access a given server using the IOR file
for that server. You will know that the IOR was written to the specified file
if InDesign Server outputs the following notification: “[server] Writing IOR
to ...”
-LogToApplicationEventLogOptional. On Windows, this routes InDesign Server’s console output to the
Window’s application event log. The output can be viewed in the standard
Application Event Viewer Computer Management Control Panel. On
Macintosh, this argument should be used when InDesign Server is used as
a launchd daemon. To view the output, use the standard Mac OS Console
application.
-maxerrors numberOptional. The number specifies the maximum number of scripting errors
from SOAP invocations that InDesign Server should store in memory. The
default is 10,000.
-pluginpath path[,path]Required for use with CORBA, which InDesign’s Load Balancing and
Queuing add-in requires; otherwise, optional. Directs the server to load all
plug-ins in the specified folder(s) and their subfolders. By specifying the
installed server/corba subdirectory, the InDesign Server Corba Support
plug-in is loaded and enabled. path is a relative path based on the
InDesign Server install folder (for example, passing in “Server/Corba”
specifies the folder “C:\Program Files\Adobe\ Adobe InDesign CS6.0
Server\Server\Corba”). Do not use an absolute path. You will know that
the Corba Support plug-in loaded if InDesign Server outputs the
following notification: “[server] ApplicationIOR: ...”
-port numberRequired for use with SOAP; otherwise, optional. This is the port number
of the socket that InDesign Server will use to service SOAP requests from
client applications. If not specified, no port is used, and SOAP requests
cannot be processed. Each instance of InDesign Server running on the
same system must have a unique port when enabling SOAP. The port
number must be a positive integer value.
-[no]previewsOptional. Specifies whether to generate previews when importing
images. The default is -nopreviews.
-[no]sehOptional. Windows only. Specifies whether structured exception handling
should be used. The default is -seh.
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 13
ArgumentDescription
-[no]sendcrashlogsMac OS only. Automatically sends crash logs to Adobe. The default is
-nosendcrashlogs.
-serialnumber numberEnters the serial number for the application. This argument needs to be
used only once to unlock the application.
Starting InDesign Server from the command line
1.On the system where InDesign Server is installed, open a new shell window. On Windows, use the
command prompt; on Mac OS, use Terminal.
2.Change the current directory to the folder where InDesign Server is installed. On Windows, the folder
contains the InDesignServer.com application. On Mac OS, the folder contains the InDesignServer.app
application package. For example:
64-bit Windows:
cd "C:\Program Files\Adobe\Adobe InDesign CS6 Server x64\"
Mac OS:
cd '/Applications/Adobe InDesign CS6 Server/'
3.Run the following command. (On Windows, InDesignServer.com is run by default. It sets up paths and
executes InDesignServer.exe.)
InDesignServer
4.InDesign Server displays its start-up messages in the shell window. When InDesign Server is ready for
use, it displays “[server] Server Running.” While InDesign Server is running, messages and errors are
displayed in the shell window, so you can use this window to monitor InDesign Server.
Starting InDesign Server for use with SOAP
If your workflow involves using scripts to interact with InDesign Server, that workflow most likely involves
sending the scripts to InDesign Server via SOAP. To communicate with InDesign Server via SOAP, you must
use the -port argument when starting up InDesign Server. In the following sample command line, port
number '12345' can be replaced with your desired port.
InDesignServer -port 12345
As InDesign Server displays its start-up messages, you should see this message:
"[soap] Servicing SOAP requests on port 12345."
This indicates that InDesign Server is ready to accept SOAP requests.
Starting InDesign Server for use with CORBA
If your workflow involves using Load Balancing and Queuing (LBQ) to interact with InDesign Server, you
must start InDesign Server for use with CORBA. The InDesign Server LBQ add-in relies on the Corba
Support plug-in to communicate with InDesign Server. This communication is facilitated through the use
of a text file that contains a string representing an IOR that uniquely identifies an object in CORBA.
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 14
Once the InDesign Server instance is initialized, it writes the IOR representing its application object to the
specified text file. Using the IOR contained in the IOR file, an LBQ client can instantiate a proxy object for
the InDesign Server application object.
To start InDesign Server for use with CORBA, add the -iorfile and -pluginpath arguments to your command
line. The path specified by -pluginpath is relative to the path of the InDesign Server application. At
start-up, InDesign Server creates the specified text file and writes its application’s IOR to the file. You must
have write permission to the file path. In the following sample command line, replace c:\ior.txt (Windows)
or ~/ior.txt (Mac OS) with your desired filepath.
As InDesign Server displays its start-up messages, you should see the following messages:
"[server] ApplicationIOR:..."
"[server] Writing IOR to ..."
These indicate that InDesign Server is ready to accept CORBA commands and you can access the InDesign
Server application IOR from the specified file.
Starting from another program or script
InDesign Server can be launched as a process from another program or script. On Windows, be aware that
InDesign Server typically is run using InDesignServer.com rather than InDesignServer.exe. The .com
version differs from the .exe in that it sets up required paths to the omniorb folder required by the
InDesign Server CORBA implementation. The .exe does not set up these paths, so you may need to add the
omniorb folder to your PATH environment variable before launching InDesignServer.exe.
Running multiple InDesign Server instances
If your site has a high volume of InDesign Server requests, you can increase throughput by running
multiple instances of InDesign Server on the same system. A general rule of thumb for the maximum
number of InDesign Server instances running on one machine is to add one to the number of cores on the
machine. For more information, see “InDesign Server Scalability and Performance” in Adobe InDesign Server Solutions.
To run multiple instances, you must give each instance a unique configuration name. Do this with the
-configuration argument, specifying a unique name for each instance. When running InDesign Server from
the command line, you must run each instance in its own window.
1.From a shell window, start the first instance by executing the following line:
InDesignServer -configuration myIDS1
2.Open a new shell window and execute the following line for the second instance:
InDesignServer -configuration myIDS2
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 15
Multiple instances using SOAP
If you have applications that communicate with InDesign Server using SOAP, you must assign a different
port number to each instance of InDesign Server. In the following examples, you do not need to specify
the -configuration argument, because InDesign Server creates a configuration name based on the
specified port (as described in “InDesign Server command-line arguments” on page 11
). The following
examples create the configuration names “configuration_18383” and “configuration_18555.”
The first instance is run by executing the following command line:
InDesignServer -port 18383
A second instance is run by executing the following command line:
InDesignServer -port 18555
Optionally, you can give each instance a unique configuration name; however a unique port number is still
required for using SOAP. For example:
InDesignServer -configuration myIDS3 -port 18777
Multiple instances using CORBA
If you are using InDesign Server’s Load Balancing and Queuing add-in, you must assign each instance of
InDesign Server a different IOR text file and configuration name. The following examples create unique
IOR text files and configuration names for each instance.
On Windows, the first instance is run by executing the following command line:
Press Control+C in the Command Prompt window (Terminal on Mac OS) where InDesign Server was
started.
Send a script to InDesign Server telling it to shut down using the application’s quit event. For example,
the following JavaScript quits InDesign Server without saving open documents:
app.quit(SaveOptions.no);
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 16
If the InDesign Server instance was launched from the InDesign Server Windows Service, you can stop
the service to terminate all instances of InDesign server started by the service.
Configuring InDesign Server Windows Service
The InDesign Server Windows Service can be started, stopped, and configured through the “Services”
category of the standard Microsoft Management Console. This can be launched either by right-clicking My
Computer > Manage or through the Start menu, Start > Administrative Tools > Computer Management. In
the Computer Management Window, choose Services and Applications, then Services. In the list of
services, double-click InDesignServerService or InDesignServerService x64. This displays a properties
dialog that allows you to start, stop, or pause the service, modify the login, or change how the service
starts.
On the Log On tab, Microsoft recommends using the least privileged setting that allows the service to do
what it needs to do. In this case, that means reading and writing to the Documents and Settings folder and
to the location of the documents on which the server is acting; opening a port; and reading registry
settings. “Local System account” is more privileged than the LocalService, so you should first attempt to
set “this account” to a LocalService (for example, “NT AUTHORITY\LocalService”).
On the Recovery tab, we recommend that you leave the settings as “Take no action.” This provides the
option of restarting the service if it crashes. If the service is doing its job, it has already launched instances
of InDesignServer with specified ports/configurations. If the service then crashes, and the InDesign Server
instances are still running, the new instance of the service will not know about those instances and will try
to start new instances of InDesign Server; those will fail to launch, because the ports/configurations
already are in use. These settings do not affect how the service handles instances of InDesign Server if they
crash; that is configured via the registry settings MaximumFailureCount,
MaximumFailureIntervalInMinutes, and TrackFailures in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InDesignCS55ServerWinService. Entries for
all three registry settings are created for each new instance that is added to the service. The installer does
not add any instances automatically. When you add an instance to the service, you will see these registry
entries.
InDesign Server Console Management snap-in
The second component of the Windows Service is the InDesign Server Console Management snap-in. To
add the snap-in to a management console, double-click the InDesignServerService.msc file found in your
InDesign Server installation. You also can manually add the snap-in to a management console, by running
the Windows application mmc.exe and choosing File > Add/Remove Snap-in... This brings up a list of all
available MMC snap-ins. If no list is visible, click Add. Choose InDesignServerService from the list, to add it
to the current console. Close the Add/Remove Snap-In dialog.
To add an InDesign Server instance to the console, right-click InDesignServerService in the left pane of the
console, and choose New > New InDesign Server instance. The new instance inherits the failure
parameters from the last instance. It is assigned a port number one greater than the highest port number
among existing InDesignServerService instances. The default command line is empty. To modify an
instance’s configuration (port number or command-line), double-click the instance in the right pane. The
command line should be formatted as described in “Starting InDesign Server from the command line” on
page 13, with the exception that no -port argument should be used, as it is defined by the port entry.
For multiple instances of InDesign Server to exist on one machine, each instance must have a unique port
or unique configuration name; these can be specified by editing the port and command-line settings for
the service. Although usually you need to edit only the port and command-line settings for the service,
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 17
there are a few other settings that can be modified by editing the Registry Settings for the service instance;
these settings include:
MaximumFailureCount — The number of times the service tries to restart a failed instance.
MaximumFailureIntervalInMinutes — The timeframe for MaximumFailureCount. InDesign Server must
fail more than MaximumFailureCount times within MaximumFailureIntervalInMinutes, before the
service stops trying to restart it.
TrackFailures — This is a Boolean. If it is 1 (the default), the service tries to restart InDesign Server; if 0,
the service does not.
To edit the settings, run regedit and look at the keys in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InDesignCS55ServerWinService. There
should be one set of keys (for example, 065c361a-0cbe-4917-bf15-5276b1815769) for each instance you
configured using InDesignServerService.msc or the Console Management snap-in.
Configuring an InDesign Server launchd daemon for Mac OS
InDesign Server can be launched as a background task (daemon) on Mac OS, without requiring direct
control by an end user. Running InDesign Server as a daemon allows you to configure InDesign Server to
launch when the operating system starts and offers the ability to configure restart options if the
application crashes.
To configure the daemon, you create a properties list (plist) configuration file containing the desired
settings and install it in the desired LaunchAgents or LaunchDaemons folder.
The launchd Configuration file
To create a launchd configuration file, use your favorite plain text editor, and enter the XML content as
specified below. Save the file using your daemon’s Label as the filename, and .plist as the extension (for
example, com.adobe.ids.launchd.12345.plist). You also can edit a plist file using the XCode utility
application, Property List Editor, located in Developer/Applications/Utilities.
The following table lists the required settings for an InDesign Server launchd daemon. For a complete list
of launchd options, see the man page for launchd.
OptionDescription
LabelThe unique identifier for your daemon; for example,
com.adobe.ids.launchd.12345
OnDemandThis must be set to
crash.
false for InDesign Server to restart following a quit or
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 18
OptionDescription
ProgramArgumentsThis is an array of strings representing the arguments used when launching
the application. The first element of the array is the full path to the
application. The remaining array elements are the same arguments used
when starting InDesign Server from the command line.
To receive console output from InDesign Server, you must use the
-LogToApplicationEventLog argument.
RunAtLoadThis is set to
true. InDesign Server is started when the daemon is loaded at
System Startup or loaded manually using launchctl.
The following example is the XML content of a plist configuration file that will run InDesign Server using
SOAP port 12345:>
To install a launchd configuration file, you simply copy it to the correct folder on the machine where
InDesign Server will be run. You can have multiple daemon configuration files, one for each instance of
InDesign Server you want to run. For a typical InDesign Server installation, you will run Mac OS X Server
with no user accounts. In this case, you copy the configuration file to:
/Library/LauchDaemons
If want to run InDesign Server from a user account, copy the plist file to the LaunchAgents folder in either
the system Library folder or the user’s Library folder (you may need to create the user’s LaunchAgents
folder):
CHAPTER 2: Installing and Running InDesign ServerRunning InDesign Server 19
Load the daemon
After the plist file is copied to the launch folder, restart the system to automatically load the daemon. After
the daemon is loaded, InDesign Server is launched using the settings specified in the plist file. To confirm
that the daemon was loaded, use the following command from a Terminal window:
launchctl list
If you see your daemon’s Label listed, you know it was loaded correctly.
To confirm that InDesign Server is running, you can use Activity Monitor to look at all running processes.
You can manually load the daemon using the launchctl command:
To quit the InDesign Server instance, send a script to InDesign Server telling it to quit, or use Activity
Monitor to quit the process.
3
Interfacing with InDesign Server
This chapter describes various ways of interfacing with InDesign Server:
“Interfacing with InDesign Server through SOAP” on page 20
“Interfacing with InDesign Server through a plug-in” on page 23
“Interfacing with InDesign Server through COM (Windowsonly)” on page 24
“Interfacing with InDesign Server through LBQ” on page 25
This chapter also discusses the following:
“Handling error messages” on page 26
“Frequently asked questions” on page 27
Interfacing with InDesign Server through SOAP
InDesign Server supports one SOAP command, RunScript, which allows you to run an InDesign Server
script. You can write your script using JavaScript, VBScript (Windows only), or AppleScript (Mac OS only).
When you call RunScript, it passes your script file to InDesign Server, and InDesign Server executes the
script internally.
The RunScript command is defined by the InDesign Server WSDL. You can use this WSDL with
industry-standard SOAP tools to generate SOAP message packets automatically. There are two ways to
view the WSDL:
Look at the InDesign Server SDK file, IDSP.wsdl.
Access the WSDL through HTTP after starting InDesign Server using the -port argument (for example,
http://localhost:12345/service?wsdl).
For information on how to write a SOAP client that interacts with InDesign Server, see “Working with
InDesign Server SOAP” in Adobe InDesign Server Solutions or any of the “sampleclient” samples in the SDK.
Using sampleclient to run an InDesign Server script
InDesign Server provides a sample SOAP client application, sampleclient. sampleclient is a command-line
application that sends a script to InDesign Server via the InDesign Server RunScript SOAP command. The
script can be written in JavaScript, AppleScript, or VBScript. SampleClient assumes that the extension for
an AppleScript is .applescript; for a VBScript, .vbs. Any other extension is assumed to be JavaScript.
The InDesign products SDK includes the components necessary to construct sampleclient:
The source code is in <IDS SDK>/samples/sampleclient-cplusplus-soap/.
20
CHAPTER 3: Interfacing with InDesign ServerInterfacing with InDesign Server through SOAP 21
sampleclient command-line arguments
The sampleclient arguments identify the system on which InDesign Server is running, the port configured
to accept SOAP communication, the name of the script file you want to run, and any arguments to be
passed in to the script. sampleclient has the following syntax; the arguments are described in the
following table:
argumentsOptional. This is one or more name-value pairs used to pass arguments to the script. The
format is argname=value, where argname is the name of the argument the script reads,
and value is its value. Separate multiple arguments with spaces. For example:
Scripts can read the argument value by using the get method of the scriptArgs object in
the application object. For example, the following gets the argument named myArg:
myArg = app.scriptArgs.get("myArg");
-hOptional. Displays short descriptions of these arguments.
-host
hostID:port
Optional. The host on which InDesign Server is running. hostID can be one of the
following identifiers for the system on which InDesign Server is running: the IP address of
the system, the host name of the system (for example, ourhost.corp.company.com), or
the keyword “localhost” if InDesign Server is running on the same machine as
sampleclient. Both IPv4 and IPv6 addresses are accepted. port is the host port number
that is configured to accept SOAP messages. For example:
-host 10.0.0.1:18383
-host [fe80::405:2345:fe56:8901]:18383
On a local system:
-host localhost:18300
-repeatOptional. Specifies the number of times to execute the script.
CHAPTER 3: Interfacing with InDesign ServerInterfacing with InDesign Server through SOAP 22
ArgumentDescription
scriptPathRequired. Without the -server argument, scriptPath is the path to the script file on the
local file system. The path can be an absolute path or a relative path based on the current
working directory. If the -server argument is used, scriptPath can take one of two forms.
First, scriptPath can be an absolute path to the script based on the file system of the
targeted InDesign Server instance.
On Windows:
C:\<myScriptsFolder>\myScript.jsx
On Mac OS:
~/<myScriptsFolder>/myScript.jsx
Second, scriptPath can be based on a predefined path constant. InDesign Server defines
two path constants, Scripts:Application and Script:User. Scripts:Application represents
the application’s scripts folder. It is located:
Place your script file in one of the scripts folders on the InDesign Server machine, then
pass the corresponding path to sampleclient. For example (note that you must use a
colon (:) as the path separator on both Windows and Mac OS):
6.sampleclient displays messages and the return value for the script in the command-line window, so
you can use it for monitoring.
Interfacing with InDesign Server through a plug-in
Developing a plug-in for InDesign Server requires the same fundamental C++ and object-oriented
programming and design skills needed to develop plug-ins for InDesign. Because InDesign Server does
not have a user interface like its desktop counterpart, there are many special considerations when creating
a new plug-in or porting an existing InDesign plug-in for use under InDesign Server.
“InDesign Server Plug-in Techniques” in Getting Started with Adobe InDesign Plug-In Development discusses
how to write plug-ins that run safely in the InDesign Server environment. This document also discusses
how to build 64-bit plug-ins.
For your plug-in to load and run under InDesign Server x64, you must convert your plug-in to a 64-bit
version.
To interact with your plug-in through scripting, you need to make your plug-in scriptable. For details, refer
to the “Scriptable Plug-in Fundamentals” chapter in the Adobe InDesign Plug-In Programming Guide; it
explains how to expose your plug-in’s API in the scripting DOM.
CHAPTER 3: Interfacing with InDesign ServerInterfacing with InDesign Server through COM (Windowsonly) 24
Interfacing with InDesign Server through COM
(Windowsonly)
InDesign Server publishes a COM type library that can be used to create COM components that
interoperate with InDesign Server. The type library contains definitions of the classes, methods, and
constants of the InDesign Server scripting DOM.
InDesign Server is plug-in based, so its scripting DOM changes depending upon which plug-ins are
available at start-up. To remain valid, the InDesign Server type library is created or updated on start-up and
stored on the local hard drive. The resulting .tlb file is saved to the Application Data folder:
C:\Documents and Settings\All Users\Application Data\Adobe\InDesign
Server\<version>\<locale>\configuration_12345\Scripting Support\<version>\Resources
for Visual Basic.tlb
(or on Windows Vista and Windows Server 2008):
C:\ProgramData\Adobe\InDesign Server\<version>\<locale>\configuration_12345\Scripting
Support\<version>\Resources for Visual Basic.tlb
In the preceding path, “configuration_12345” is the configuration name for the InDesign Server instance
that created the table file.
Because the InDesign Server COM type library is based on the loosely typed InDesign Server scripting
model, it also is loosely typed. When you choose a language to develop your COM component, keep in
mind that the more loosely typed the language, the more compatible it is with the InDesign Server COM
type library.
Visual Basic
Your best bet for creating an InDesign Server COM component is to use Visual Basic 6. Newer versions of
Visual Basic have introduced strongly typed constructs that make it less compatible with the loosely typed
InDesign Server DOM.
It is possible to use Visual Basic .NET, as long as you set the project’s Compile options “Option explicit” and
“Option strict” to “off.” These settings allow you to reduce the strong typing rules of VB.NET. You also
should avoid declaring variables using Dim, as that forces the type onto the variable. Because code
completion works only if a variable is declared using Dim, you typically can declare your variable at the top
of the method using Dim, then REM the Dim statements out before running your code.
To use the InDesign Server COM type library in your project, you need to have access to the interop DLL for
InDesign Server. Under .NET, you can do this by making a reference to the .tlb file. Right-click on your
project and choose “Add Reference.” Then choose the COM tab and locate “Adobe InDesign CS6 Server
Type Library.” If it does not appear in the dialog, you first need to launch InDesign Server on your machine,
so InDesign Server will create the type library.
To create a reference to an instance of InDesign Server in your code, use the CreateObject method. Note
that CreateObject does not give you control over which InDesign Server instance the script will target.
Set myApp = CreateObject("InDesignServer.Application")
To create a reference to a specific instance of InDesign Server in your code, use the GetObject method,
passing the configuration name of the InDesign Server instance you want to target:
Set myApp = GetObject("configuration_12345")
CHAPTER 3: Interfacing with InDesign ServerInterfacing with InDesign Server through LBQ 25
For more information and samples, examine the <IDS SDK>/samples/ folder, and read Adobe InDesign Scripting Guide.
C#
We do not recommend using C# to build InDesign Server COM components. C# is a strongly typed
language and has many conflicts with the loosely typed InDesign Server scripting DOM. That being said, it
is possible to write simple InDesign Server COM components with careful type-casting and parameter
specification.
One possible solution is to have your C# code call the doScript method of InDesign Server, passing in a
script file or the text of a script. For an example, see the sampleclient-csharp-com sample in the InDesign
Server SDK.
When trying to create a more involved component with C#, you may encounter pitfalls including the
following:
C# is strongly typed, so it always must know a type for an object. This means you must type-cast nearly
every object retrieved from the scripting DOM. This is fine if you are sure what type your object is;
however, many methods in the scripting DOM accept or return variable types, and you may not be
able to predict the returned type.
You must specify all parameters to methods, even though they may be optional in the scripting DOM.
You cannot pass “null”; parameters must be fully formed objects.
Optional parameters may be impossible to deal with. One example is where a method in the scripting
DOM allows you to not pass the first parameter of a method, in which case InDesign Server pays
attention to the second parameter. This is impossible under C#.
To create a reference to an instance of InDesign Server in C#, use the InteropServices method
Marshal.BindToMoniker:
For details and samples, examine the InDesign Server SDK Samples folder.
Interfacing with InDesign Server through LBQ
InDesign Server includes an optional component called LBQ that provides job queueing and load
balancing functionality for InDesign Server. LBQ is strictly optional. It is not required for running InDesign
Server. It is one solution for load balancing and job queueing.
LBQ provides load balancing across multiple instances of InDesign Server running on one or more
machines. It uses CORBA to communicate with the instances of InDesign Server, so each instance must be
started as described in “Starting InDesign Server for use with CORBA” on page 13
.
In addition to load balancing and basic queueing, LBQ supports the following features:
Prioritized queueing
Status visibility
Logging
CHAPTER 3: Interfacing with InDesign ServerHandling error messages 26
Multiple queues
Editing queued jobs
Clients interact with LBQ using a RESTful API. RESTful API calls are made through a URL request. Upon
executing a request, an XML response is returned.
LBQ supports the following operations:
EnqueueJob
ModifyJob
CancelJob
StartQueue
StopQueue
ReinitializeQueue
GetVersion
JobStatus
QueueStatus
IDSStatus
Ping
Kill
Refer to “Working With Load Balancing and Queueing” in Adobe Indesign Server Solutions for detailed
explanations of these operations as well as other helpful information about working with LBQ.
Handling error messages
InDesign Server logs its messages and errors to stderr and stdout. These errors and messages can be
captured or redirected.
Accessing errors and messages
From a plug-in, use the C++ APIs MessageLog and/or IErrorList. This is explained in “InDesign Server
Plug-in Techniques” in Getting Started with Adobe InDesign Plug-In Development.
Redirecting errors and messages
When running InDesign Server from within an application, you can configure stdout and stderr to convey
messages from InDesign Server to your application.
In Windows, InDesign Server messages can be redirected to the Window’s application event log by
launching InDesign Server with the -LogToApplicationEventLog argument. If you are running InDesign
Server from the InDesign Server Windows Service, logged messages are redirected automatically to the
CHAPTER 3: Interfacing with InDesign ServerFrequently asked questions 27
Window’s application event log. The event log can be viewed in the standard Event Viewer, in the
Computer Management Control Panel.
On Mac OS, you can redirect messages to the system console by launching InDesign Server with the
-LogToApplicationEventLog argument. The log can be viewed using the utility application, Console.
Frequently asked questions
Can I specify both a SOAP port and an IOR file when launching the
server?
Yes. InDesign Server can handle SOAP and CORBA commands concurrently; however, you may experience
performance degradation.
Is there an index of all classes and methods in the InDesign Server
scripting DOM?
Yes. An Object Model Reference for InDesign Server can be accessed from the Help menu inside Adobe
ExtendScript Toolkit.
Can I interact with InDesign Server if I launch it without SOAP?
Yes. You can communicate with InDesign Ser ve r t h rough JavaScript, AppleScript, VBScript, or COM,
without using SOAP.
How do I return a value from my script to my SOAP client?
In JavaScript and AppleScript, the script’s return value is the last value encountered in the script. In
VBScript, to define the return value for the script, you set a variable named returnValue. Each of the
following examples returns the name of the document at the first index.
JavaScript:
var documentName = app.documents.item(0).name;
documentName;
AppleScript:
tell application "InDesignServer"
set documentName to name of document 1
end tell
documentName
VBScript:
Set myApp = CreateObject("InDesignServer.Application")
documentName = myApp.Documents.Item(1).Name
returnValue = documentName
4
Next Steps
After learning to run InDesign Server and using SOAP to run a sample provided in the SDK, you may want
to extend the capabilities of InDesign Server. You can do this by writing scripts, plug-ins, or even
applications that integrate InDesign with a publication workflow.
This chapter suggests resources to help you write such scripts, plug-ins, and applications.
InDesign Server scripting and plug-ins
For information on writing InDesign and InDesign Server scripts and plug-ins, install the InDesign
products SDK, then reference the following:
Adobe InDesign Plug-In Programming Guide — Provides information about creating C++ plug-ins for
InDesign Server.
Adobe InDesign Scripting Guide — Provides basic information about, and numerous examples of,
creating scripts for InDesign. There are three versions of this document, for AppleScript, JavaScript,
and VBScript.
Getting Started with Adobe InDesign Plug-In Development, the “InDesign Server Plug-in Techniques”
chapter.
Adobe InDesign Server Solutions, the following chapters:
Adobe Scripting, by McWilliams Chandler. New York: Wiley Publishing Inc., 2003. ISBN 0-7645-2455-0.
JavaScript
For documentation on the JavaScript language and descriptions of how to use it, see the following:
JavaScript: The Definitive Guide, 4th Edition, by Flanagan, David. O’Reilly, 2001. ISBN 0-596-00048-0.
JavaScript Bible. 5th Edition, by Danny Goodman and Michael Morrison. John Wiley and Sons, 1998.
JavaScript Programmer’s Reference, by Cliff Wooton. Wrox, 2001. ISBN 1-861004-59-1.
SOAP
For information on SOAP communication, see the SOAP primer from W3C, located at
http://www.w3.org/TR/soap12-part0/.
“Working with InDesign Server SOAP.”
“InDesign Server Scalability and Performance” — Provides benchmarks and information on how
to configure your system to maximize the performance and scalability of InDesign Server.
ISBN 0-7645-57432.
28
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.