This is the priint:cometserver extension of the InDesign® Server Scripting DOM.
It is intended for use with priint:cometserver, so usually you wont address this interface directly. Anyway, if for any reason you cannot use priint:cometserver or intend to build scripting based applications, this information will be useful.
The InDesign® Server Scripting DOM is exposed in JavaScript, VBScript, AppleScript and (via a generated CORBA client) Java. The priint:comet extensions can also be addresses via a SOAP WebService interface.
Some notes concerning the parameters
./InDesignServer -configuration testconfig -previews \ -cometlog ~/Desktop/comet.log -cometapilog ~/Desktop/api.log - cometcache ~/Desktop/cometcache \ -cometdrawidle on -cometparanoidredraw on -cometxmlparser fast
var documentName = "test.indd"; var documentPath = "/Volumes/Users/me/Desktop/jsxtest/"; var connectId = app.comet.ping() + ";-1;"; // open the test document app.comet.documentOpen(documentPath + documentName, true, connectId); // get preview of the first SPREAD app.comet.getPreview ( documentPath + documentName, Scope.SPREAD, 0, // first Spread 200, // resolution documentPath + "preview.png", // output file connectId + "layers:+*;format:png;"); // include all layers, create a PNG // close the document app.comet.documentClose(documentPath + documentName, connectId);
// ******************************************* // // Connection data // Fill in YOUR DATA here // var gEnvironment = "_xmldata_"; // valid XML folder containing connections.xml var gConnectionName = "xxx"; // Entry in connections.xml var gInstanceID = 2; // InDesign® instance ID // ******************************************* // // Document and script // Fill in YOUR DATA here // var gDocument = "test.indd"; var gScriptID = 2006; var gScript = "\ \ #include \"internal/types.h\"\ #include \"internal/text.h\"\ #include \"internal/products.h\"\ \ int main() \ {\ // Do what ever you want.\ return 0;\ }\ "; // ******************************************* // // Connect // var gOptions = app.comet.ping () + ";-1;"; app.comet.setEnvironment (gEnvironment, gInstanceID, ""); // XML folder containing connections.xml app.comet.use (gConnectionName, "", "", false, ""); // name of entry in connections.xml // // Work // // Open a document app.comet.documentOpen (gDocument, true, gOptions); // Some examples app.comet.eval (gScript, '', ''); // exec script given by text app.comet.exec (gScriptID, "", gOptions); // exec script defined in data pool app.comet.placeTemplate ( // place product gDocument, // document path Scope.SPREAD, 0, // spread 0 1, // templlate id "1, 0, 0, \"109007\"", // product id 10.0, 10.0, // position ReorganizeLevel.NONE, gOptions); app.comet.placeholderLoad ( gDocument, Scope.DOCUMENT, 0, new Array (0), // placeholder IDs, empty array = all "0,0,0,\"\"", // RecordIDs, empty (0,0, ...) = all gOptions); // Save and close document app.comet.documentSave (gDocument, gOptions); app.comet.documentClose (gDocument, gOptions)
In comet_pdf of course there is no JavaScript interpreter available. To support Comet API calls here, please use option -j (--comet-api) instead. The option needs the path (absolut or relative to the renderer itself) to a XML file containing the definition of the Comet API calls. Files must follow this rules:
<?xml version="1.0" encoding="utf-8"?> <js> <j method="methodName" ignoreError="1" activated="1"> <paramter1>value1</paramter1> <paramter2>value2</paramter2> <!-- ... --> </j> <!-- next method call --> </js>
where:
<?xml version="1.0" encoding="utf-8"?> <js> <j method="elementTransform" ignoreError="1"> <path></path> <elementID>222</elementID> <options>width:123.0;height:456.0;x:46.0;y:46.0;rotate:30.0</options> </j> </js>
Attention I: Methods are working on the current document given by option -i always. The parameter path is ignored (but must be given!).
Attention II: Only a selected list of API calls are implemtented. See below for more informations, implemented methods are marked as available for comet_pdf.
Attention III: Only a sub set of API calls are implemented for now. Implemented functions are marked by a ★ at the left side bar. More functions will follow.
Please contact support@priint.com for more information, though only limited support for this API can be provided.
Here's a simple example on how to use the priint:comet Scripting DOM with AppleScripts (which in turn executes cScript):
tell application "Adobe InDesign CC 2019" set visible of panel "Product Pool" to 1 set CT to comet 1 -- The 1 is important!! tell CT set sc to "" set sc to sc & "int main () {" set sc to sc & " datapool::login (1, \"demo\", \"demo\", \"werk2demo\", \"comet_config_comic\", \"\", 1);" set sc to sc & " list::reload (3, 1);" set sc to sc & "return 0;}" eval cscript sc argument "" options "" end tell end tell
Return | Synopsis |
String |
about() About priint.comet PlugIn |
short |
adapt(double width, double height) resize pages of current front document to a given size and apply all nails and magnets |
boolean |
addSpreadOrPage(String path, int scope, int behind, int count, String masterPageName, String options) add spreads or a pages behind a spread / page |
boolean |
applicationShutdown(String options) shut down indesign |
boolean |
applyMasterpage(String path, int scope, int parent, String masterPageName, String options) apply a masterpage or spread |
int |
build(String path, int scope, int parent, String itemsXML, double x, double y, String options) build products |
int |
buildDynamic(String path, int scope, int parent, String itemsXML, String templatesXML, String options) build products |
boolean |
cometGroupDeleteGroup(String path, int groupUID, int reorganize, String options) delete a comet group |
String[] |
cometGroupGetPreviews(String path, int groupUID, double resolution, String tmpFile, String options) get comet group previews |
int |
cometGroupInsertAfter(String path, int groupUID, int templateID, String recordID, int reorganize, String options) insert a template after ... |
int |
cometGroupInsertBefore(String path, int groupUID, int templateID, String recordID, int reorganize, String options) insert a template before ... |
boolean |
cometGroupMoveBy(String path, int groupUID, double offsetX, double offsetY, String options) relatively move a comet group |
boolean |
cometGroupMoveTo(String path, int scope, int parent, int groupUID, double left, double top, String options) move a comet group to ... |
int |
cometGroupReplaceGroup(String path, int groupUID, int templateID, String recordID, int reorganize, String options) comet group replace group |
boolean |
deleteSpreadOrPage(String path, int scope, int first, int count, String options) delete n spreads or a pages starting at spread / page |
boolean |
documentClose(String path, String options) close a document |
boolean |
documentCreate(String path, String options) create a document |
boolean |
documentDuplicate(String path, String newPath, String options) duplicate a document |
boolean |
documentGeneratePDF(String path, String pdfProfile, String tmpFile, String options) generate document PDF |
String[] |
documentGetLayers(String path, String options) get all document layer names |
int |
documentGetPageCount(String path, String options) get document page count |
int[] |
documentGetPageIDs(String path, String options) get document page IDs |
int |
documentGetSpreadCount(String path, String options) get document spread count |
int[] |
documentGetSpreadIDs(String path, String options) get document spread IDs |
boolean |
documentOpen(String path, boolean openOriginal, String options) open a document |
boolean |
documentOpenCached(String path, boolean openOriginal, String[] cacheOptions, String options) open a document with preview cache support |
boolean |
documentReorganize(String path, int pageindex, int reorganize, String options) document reorganize |
boolean |
documentSave(String path, String options) save a document |
boolean |
documentSaveAs(String path, String newPath, String options) save a document as ... |
boolean |
documentSetup(String path, boolean applyAdaption, String options) setup a document |
boolean |
elementDelete(String path, int elementID, String options) delete an element |
boolean |
elementDeletePara(String path, int elementID, String elementFragment, String options) delete a paragraph |
boolean |
elementInsertPara(String path, int elementID, String elementFragment, boolean beforePara, String value, String options) insert a paragraph |
boolean |
elementMove(String path, int scope, int parent, int elementID, double left, double top, String options) move an element relative or absolute |
boolean |
elementSetImage(String path, int elementID, String imagePath, String options) set an element image |
boolean |
elementSetValue(String path, int elementID, String elementFragment, String value, String options) set an element value |
boolean |
elementTransform(String path, int elementID, String options) transform an element |
String |
eval(String cscript, String argument, String options) Evaluate cscript statement |
String |
exec(int actionID, String argument, String options) Execute action (refered by action ID) |
boolean |
execTemplate(int templateID, String recordID, String outPath, String options) execute template |
boolean |
generatePDF(String path, int scope, String pagesOrSpreads, String pdfProfile, String tmpFile, String options) generate PDF |
boolean |
generateSWF(String path, int scope, String pagesOrSpreads, String tmpFile, String options) generate SWF |
String |
getCometGroups(String path, int scope, int parent, String tmpFile, String options) get comet groups |
int |
getDocumentCount() count openened documents |
String[] |
getDocumentList() openened documents |
String |
getDocumentStyles(String path, int scope, int parent, String tmpFile, String options) get document styles |
String |
getElementsXML(String path, int scope, int parent, String tmpFile, String options) get elements |
int[] |
getGroupUIDs(String path, int scope, int parent, String options) get group uids |
String |
getIDML(String path, int scope, int parent, String idmlPart, String tmpFile, String options) get IDML |
String |
getItems(String path, int scope, int parent, String tmpFile, String options) get items / products of document |
double[] |
getNextGridPosition(String path, int scope, int parent, int groupUID, double directionX, double directionY, String options) get the next suitable grid position for a comet group on a spread / page |
String |
getNotes(String path, int scope, int parent, String tmpFile, String options) get notes |
String[] |
getPdfProfiles(String options) get pdf profiles available for this InDesign® Server instance |
String |
getPlaceholders(String path, int scope, int parent, boolean evalSyncStatus, boolean markChanges, String tmpFile, String options) get placeholders |
boolean |
getPreview(String path, int scope, int parent, double resolution, String tmpFile, String options) get a page or spread preview |
boolean |
getPreviewOfClipping(String path, int scope, int parent, double resolution, double x, double y, double width, double height, String tmpFile, String options) get a JPEG preview of clipping |
String |
getScriptIO() Get ScriptIO |
String |
getSpreads(String path, int scope, int parent, String tmpFile, String options) get spread and pages info |
String |
getTemplate(int parent, String tmpFile, String options) get template |
int |
getTemplateID(String path, int scope, int parent, String options) get template ID |
int |
importGroup(String path, String source, int scope, int parent, int groupUID, double left, double top, String options) import a comet group to ... |
String |
license() license order |
String |
matchItems(String path, int scope, int parent, String items, String tmpFile, String options) compare a list of items to the items currently placed in the document |
boolean |
modifyCometGroup(String path, int scope, int parent, int[] targetElements, String command, String options) modify comet groups |
boolean |
moveSpreadsOrPages(String path, int scope, int behind, int start, int count, String options) move spreads or pages within a document |
boolean |
pageApplyGrid(String path, int scope, int parent, int gridid, int reorganize, String options) page apply grid |
int |
ping() ping |
boolean |
placeholderLoad(String path, int scope, int parent, int[] placeholderIDs, String recordID, String options) load a placeholder |
boolean |
placeholderSetImage(String path, int scope, int parent, int placeholderID, String recordID, String imagePath, boolean execSaveMethod, String options) set a placeholder image |
boolean |
placeholderSetValue(String path, int scope, int parent, int placeholderID, String recordID, String value, boolean execSaveMethod, String options) set a placeholder value |
boolean |
placeholderSync(String path, int scope, int parent, int[] placeholderIDs, String recordID, String options) sync placeholders |
boolean |
placeholderUpdate(String path, int scope, int parent, String options) update placeholders |
int |
placeTemplate(String path, int scope, int parent, int templateID, String recordID, double x, double y, int reorganize, String options) place template |
boolean |
registerResource(String path, int tmpPath) register resource file |
boolean |
reloadConfig(String service, String config, String options) reload config |
int |
runPanelAction(String path, int scope, int parent, int actionID, String selection, String tmpFile, String options) run a panel action |
boolean |
setEnvironment(String initRoot, int instanceID, String pathResolvePattern) set the application environment |
boolean |
setItems(String path, int scope, int parent, String items, String tmpFile, String options) set items / products of document, spread or page |
boolean |
setNotes(String path, int scope, int parent, String notes, String tmpFile, String options) set notes |
void |
setScriptIO(String property) Set ScriptIO |
boolean |
setTemplateID(String path, int scope, int parent, int theTemplate, String options) set template ID |
boolean |
spreadGetCometGroupsPreview(String path, int scope, int parent, double resolution, int[] groups, String tmpFile, String options) get a preview of a list of comet groups |
boolean |
spreadGetCometGroupsSnippet(String path, int scope, int parent, int[] groups, String tmpFile, String options) get a snippet of a list of comet groups |
boolean |
spreadGetElementsPreview(String path, int scope, int parent, double resolution, int[] elements, String tmpFile, String options) get a preview of a list of elements |
boolean |
spreadGetElementsSnippet(String path, int scope, int parent, int[] elements, String tmpFile, String options) get a snippet of a list of elements |
int[] |
spreadGetPageIDs(String path, int spreadUID, String options) get spread pages ids |
int[] |
spreadGetPages(String path, int spreadUID, String options) get spread pages indexes |
int |
spreadPlaceDocument(String path, int scope, int parent, double x, double y, boolean createGroup, String tmpFile, String options) place a document on a spread |
boolean |
use(String service, String user, String password, boolean forceReconnect, String options) use a predefined connection |
String getScriptIO() throws IdsException
IdsException
void setScriptIO(String property) throws IdsException
property
- script IO (String)
IdsException
String about() throws IdsException
IdsException
<j method="about" ignoreError="1"> </j>
String license() throws IdsException
IdsException
String eval(String cscript, String argument, String resultPath, /* comet_pdf only */ String options) throws IdsException
cscript
- cScript code to be evaluated (must be a valid cScript or Python script) (String)argument
- Content of char* gArgument in script (String), Attention: gArgument is of type char* in cScript, not String.
resultPath
- (String) comet_pdf only! Write results into this file. Existings files are overridden!
options
- setup options (String)
Option | Description |
destination-path | Content of global script variable gDestinationPath of type char* |
publicationId | Content of global script variable gPublicationId of type char* |
publication-list | XML formated publication llist. This list is provided by the script in the global variable gPublications of type PublicationList |
suppress-log [false] |
false, 0 : Do not suppress final message in log true, 1 : Suppress final message in log. This is helpful if the script should only adjust the progress bar, for example. |
IdsException
<j method="documentGetLayers" ignoreError="1"> <path></path> <cscript> int main () { printf ("argument : '%s'\n", gArgument); strcpy (gOutput, gArgument); strcat (gOutput, "\n"); strcat (gOutput, gDocumentPath); strcat (gOutput, "\n"); strcat (gOutput, gDocumentID); return 0; } </cscript> <argument>Hello world!</argument> <options></options> <resultPath>$DESKTOP/aaa/aaa.h</resultPath> </j>
String exec(int actionID, String argument, String resultPath, /* comet_pdf only */ String options) throws IdsException
actionID
- ID of action in actions(.xml) to be executed (Long Integer)
argument
- Content of char* gArgument in script (String), Attention: gArgument is of type char* in cScript, not String.
resultPath
- (String) comet_pdf only! Write results into this file. Existings files are overridden!
options
- setup options (String)
Option | Description |
destination-path | Content of global script variable gDestinationPath of type char* |
publicationId | Content of global script variable gPublicationId of type char* |
publication-list | XML formated publication llist. This list is provided by the script in the global variable gPublications of type PublicationList |
suppress-log [false] |
false, 0 : Do not suppress final message in log true, 1 : Suppress final message in log. This is helpful if the script should only adjust the progress bar, for example. |
IdsException
<j method="documentGetLayers" ignoreError="1"> <path></path> <actionID>1011173</actionID> <argument>Hello world!</argument> <options></options> <resultPath>$DESKTOP/aaa/aaa.h</resultPath> </j>
int getDocumentCount() throws IdsException
IdsException
String[] getDocumentList() throws IdsException
IdsException
boolean documentOpen(String path, boolean openOriginal, String options) throws IdsException
path
- path (String)
openOriginal
- open original (true) or copy (false) (Boolean)
options
- session options (String)
Option | Description |
require-native:true | false |
true : Can only open files of current InDesign® version false : Can open files of current and prior InDesign® versions |
auto-convert:true | false |
true : Save older documents in the current InDesign® version false : Leave older documents untouched. WARNING : This will most probably cause problems when trying to save the document later. |
IdsException
boolean documentClose(String path, String options) throws IdsException
[Since v4.3 R35200] Panel and Front Row scripts can be undone in one single step. Because saving or closing the current script document would end the 'recording' of this sequence, InDesign sometimes refuses to save or close the current document (Error 3590). However, once a document has been saved or closed, undo is no longer possible anyway. In these cases, you can also do without 'Recording'. To do this, add the note -- Disable Undo -- (in exactly this spelling!) in a comment anywhere in your script:
path
- path (String)
options
- session options (String)
Option | Description |
immediate:true | false |
true : Close document immediatelly. WARNING : In some cases this may crash InDesign®! You need to test it in your environment. false : Close document at next idle time |
IdsException
String getSpreads(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
boolean documentGeneratePDF(String path, String pdfProfile, String pdfPath, String options) throws IdsException
path
- path (String)
pdfProfile
- PDF Profile (String)
pdfPath
- Complete path to PDF. Existing files will be overridden!. Must not be empty! (String)
options
- session options (String)
Option | Description |
layers | See here |
IdsException
boolean documentCreate(String path, String options) throws IdsException
path
- path (String)
options
- setup options (String)
Option | Description |
pages : int | Number of pages in document |
pages-per-spread : int | Pages per spread |
IdsException
boolean documentSetup(String path, boolean applyAdaption, String options) throws IdsException
path
- path (String)
applyAdaption
- apply adaption (Boolean)
options
- setup options (String)
Option | Description |
margin-top, margin-bottom, margin-left, margin-right, margin-outer, margin-inner, margin-insideleft, margin-outsideright | Set the appropriate margin of every page of the document to the given value in points |
bleed-top, bleed-bottom, bleed-left, bleed-right, bleed-outer, bleed-inner, bleed-insideleft, bleed-outsideright | Set the document bleed or slug. Different setting for single pages are left untouched! Attention : Currently all bleed/slug offsets must be supplied! |
slug-top, slug-bottom, slug-left, slug-right, slug-outer, slug-inner, slug-insideleft, slug-outsideright | |
size, width : float | Width of document pages in points |
height : float | Height of document pages in points |
IdsException
<j method="documentSetup" ignoreError="1"> <path></path> <applyAdaption>0</applyAdaption> <options>width:1000.0;height:1000.0;</options> </j>
boolean documentDuplicate(String path, String newPath, String options) throws IdsException
path
- path (String)
newPath
- new path (String)
options
- setup options (String)
IdsException
boolean documentSave(String path, String options) throws IdsException
[Since v4.3 R35200] Panel and Front Row scripts can be undone in one single step. Because saving or closing the current script document would end the 'recording' of this sequence, InDesign sometimes refuses to save or close the current document (Error 3590). However, once a document has been saved or closed, undo is no longer possible anyway. In these cases, you can also do without 'Recording'. To do this, add the note -- Disable Undo -- (in exactly this spelling!) in a comment anywhere in your script:
path
- path (String)
options
- setup options (String)
IdsException
boolean documentSaveAs(String path, String newPath, String options) throws IdsException
path
- path (String)
newPath
- new path (String)
options
- setup options (String)
IdsException
String[] documentGetLayers(String path, String resultPath, /* comet_pdf only */ String options) throws IdsException
path
- template path (String)
resultPath
- (String) comet_pdf only! Write results into this file. Existings files are overridden!
options
- session options (String)
Option | Description |
visible:true | false | true : Export visible layers only false : Export all layers |
IdsException
<j method="documentGetLayers" ignoreError="1"> <path></path> <options>visible:false;</options> <resultPath>$DESKTOP/aaa/aaa.h</resultPath> </j>
int documentGetSpreadCount(String path, String options) throws IdsException
path
- path (String)
options
- session options (String)
IdsException
<j method="documentGetSpreadCount" ignoreError="1"> <path></path> <options></options> <resultPath>$DESKTOP/aaa.txt</resultPath> </j>
int documentGetPageCount(String path, String options) throws IdsException
path
- path (String)
options
- session options (String)
IdsException
<j method="documentGetPageCount" ignoreError="1"> <path></path> <resultPath>$DESKTOP/aaa.txt</resultPath> </j>
DEPRECATED
int[] documentGetSpreadIDs(String path, String options) throws IdsException
path
- path (String)
options
- session options (String)
IdsException
DEPRECATED
int[] documentGetPageIDs(String path, String options) throws IdsException
path
- path (String)
options
- session options (String)
IdsException
DEPRECATED
int[] spreadGetPages(String path, int spreadUID, String options) throws IdsException
path
- path (String)
spreadUID
- spread UID (Long Integer)
options
- session options (String)
IdsException
DEPRECATED
int[] spreadGetPageIDs(String path, int spreadUID, String options) throws IdsException
path
- path (String)
spreadUID
- spread UID (Long Integer)
options
- session options (String)
IdsException
DEPRECATED
int[] getGroupUIDs(String path, int scope, int parent, String options) throws IdsException
path
- template path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
options
- session options (String)
IdsException
String getPlaceholders(String path, int scope, int parent, boolean evalSyncStatus, boolean markChanges, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
evalSyncStatus
- evaluate sync status (Boolean)
markChanges
- mark changes (Boolean)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
String getCometGroups(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
String getElementsXML(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String), Use content:tagged,properties; to export as comet_pdf's W2ML.
Option | Description |
content | |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
String getNotes(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
boolean setNotes(String path, int scope, int parent, String notes, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
notes
- notes (String)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
String getTemplate(int parent, String tmpFile, String options) throws IdsException
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
int getTemplateID(String path, int scope, int parent, String resultPath, /* comet_pdf only */ String options) throws IdsException
path
- path (String) // ignored by comet_pdf
scope
- scope (Scope enumerator), one of PAGE or SPREAD
parent
- 0-based index of spread or page (Long Integer)
resultPath
- (String) comet_pdf only! Write result into this file. Existings files are overridden!
options
- session options (String) // ignored
IdsException
<j method="getTemplateID" ignoreError="1"> <path></path> <scope>PAGE</scope> <parent>3</parent> <resultPath>$DESKTOP/aaa/aaa.txt</resultPath> <options></options> </j>
boolean setTemplateID(String path, int scope, int parent, int templateID, String options) throws IdsException
path
- path (String), ignored from comet_pdf
scope
- scope (Scope enumerator, one of PAGE or SPREAD
parent
- 0-based index of page or spread (Long Integer)
theTemplate
- Page template ID
options
- session options (String)
Option | Description |
apply-master:true | false | Apply the (first available) master page defined in the given page template to the page too? |
apply-following: false | true | empty | Apply the given page template (and possible master pages) to all following pages too? Use "empty" to left pages with page template != 0 untouched. |
IdsException
<j method="setTemplateID" ignoreError="1"> <path></path> <scope>PAGE</scope> <parent>3g</parent> <templateID>24</templateID> <options>apply-master:true;apply-following:empty;</options> </j>
DEPRECATED
double[] getNextGridPosition(String path, int scope, int parent, int groupUID, double directionX, double directionY, String options) throws IdsException
path
- template path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
groupUID
- group UID (Long Integer)
directionX
- direction x (Real)
directionY
- direction y (Real)
options
- session options (String)
IdsException
boolean getPreview(String path, int scope, int parent, double resolution, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
resolution
- resolution (Real)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
scalex: float | |
scaley: float | |
greek-below: float | Gray text smaller than then the given limit |
bleed: float | |
transparency |
maximum high medium low otherwise : Turn off transparency |
format |
jpeg gif tiff png |
encoding |
baseline progressive |
quality |
low good great excellent |
color-space |
rgb cmyk lab gray |
antialiasing :true | false | |
fullres :true | false | |
interlaced :true | false | |
add-alpha :true | false | For tif and png the default is true, otherwise false |
compression : int | 0-10 |
palette |
exact/adaptive mac win web no, none |
IdsException
boolean getPreviewOfClipping(String path, int scope, int parent, double resolution, double x, double y, double width, double height, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
resolution
- resolution (Real)
x
- x (Real)
y
- y (Real)
width
- width (Real)
height
- height (Real)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
int placeTemplate(String path, int scope, int parent, int templateID, String recordID, double x, double y, int reorganize, String resultPath, /* comet_pdf only */ String options) throws IdsException
path
- path (String), ignored from comet_pdf
scope
- scope (Scope enumerator), SPREAD or PAGE
parent
- 0-based index of page or spread (Long Integer)
templateID
- template ID (Long Integer)
recordID
- record ID (String), in the format 1, 0, 0, ""
x
- x (Real), Initial x-position, reorganization may change the position. In scope SPREAD the value is used to find the page in the spread.
y
- y (Real), Initial y-position, reorganization may change the position.
reorganize
- reorganize level (FULL, NONE, PAGE, SPREAD, SUBSEQUENT) (ReorganizeLevel enumerator)
resultPath
- (String) comet_pdf only! Write result into this file. Existings files are overridden!
options
- session options (String)
Option | Description | |
snap-to-template:true | Place and load the template and reorganize page(s). The destination page must have a page template defined already! |
|
page template settings | Set the current page template to the following pages too? For more informations see here. | |
build settings | Options for building the product, see here. | |
build-prescript:int | ID of pre-script, see parameter preScript of productlist::establish for more informations. | |
build-pageitem:int | ID default template, see parameter pageItem of productlist::establish for more informations. The value is used only if parameter templateID is <= 0. | |
snap-to-template:false | Place and load the template and possible reorganize page(s). In case of reorganizations, all effected pages must have a page template defined already! Use this option and set parameter reorganize to NONE if you wish to place and load the product to a given xy-position only. In this case no "continuation templates" are created. |
|
check-pagetype:true | false | true (recommended!) : If available, use page type versions of templates false : Do not check for page types. |
|
auto-load:true | false | See parameter autoLoad of dopcument::insert_macro for more informations. | |
layer:string | Name of layer to place the product on. | |
prefer-existing-pages:true | false | Only used if parameter reorganize = SUBSEQUENT. See flag kPreferExistingPages of productlist::reorganize for more informations. |
IdsException
<j method="placeTemplate" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>2</parent> <templateID>5</templateID> <recordID>2, 0, 0, ""</recordID> <x>36.0</x> <y>36.0</y> <reorganize>NONE</reorganize> <resultPath>$DESKTOP/abc.txt</resultPath> <options>snap-to-template:false;layer:Ebene 6;build-prescript:0;build-pageitem:0;</options> </j>
int build(String path, int scope, int parent, String itemsXML, double x, double y, String resultPath, /* comet_pdf only */ String options) throws IdsException
path
- path (String) // IGNORED by comet_pdf
scope
- scope, SPREAD or PAGE (Scope enumerator)
parent
- 0-based index of spread or page in document (Long Integer)
itemsXML
- (String : path to file or string starting with "<" with items, see here for xml format.)
x
- x (Real), only used for scope SPREAD to determine the page in spread, use -1000.0 or 0.0 for first page
y
- y (Real), for backward compatibility only, set value to 0.0 always
resultPath
- (String) comet_pdf only! Write results into this file. Existings files are overridden!
options
- session options (String)
Option | Description |
layer:string; | Name of layer to place the products on. |
build-prescript:int; | ID of pre-script, see parameter preScript of productlist::establish for more informations. |
build-pageitem:int; | ID default template, see parameter pageItem of productlist::establish for more informations. |
build-snippet-matches:string; | Use existing snippets for products? String can consists of any number of the words never document template product fallback-allowed strict tolerant See parameter snippet_matches of productlist::establish for more informations. |
prefer-existing-pages:true | false | See kPreferExistingPages of productlist::establish |
prefer-default-pageitem:true | false | See kPreferDefaultPageItem of productlist::establish |
skip-empty-templates:true | false | See kSkipEmptyTemplates of productlist::establish |
auto-detect-type:true | false | See kAutoDetectType of productlist::establish |
localize-masteritems:true | false | See kLoadMasterItems of productlist::establish |
IdsException
<j method="documentGetLayers" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>1</parent> <itemsXML>%DESKTOP/items.xml</itemsXML> <x>700.0</x> <y>0.0</y> <options></options> <resultPath>$DESKTOP/aaa/aaa.h</resultPath> </j>
boolean cometGroupDeleteGroup(String path, int groupUID, int reorganize, String options) throws IdsException
path
- path (String)
groupUID
- group UID (Long Integer)
reorganize
- reorganize level (one of FULL, NONE, PAGE, SUBSEQUENT, SPREAD) (ReorganizeLevel enumerator)
options
- session options (String)
IdsException
<j method="cometGroupDeleteGroup" ignoreError="1"> <path></path> <groupUID>237</groupUID> <reorganize>NONE</reorganize> <options></options> </j>
String[] cometGroupGetPreviews(String path,
int groupUID,
double resolution,
String tmpFile,
String resultPath, /* comet_pdf only */
String options)
throws IdsException
path
- path (String)
groupUID
- group UID (Long Integer)
resolution
- resolution (Real)
tmpFile
- tmp file path (String)
resultPath
- (String) comet_pdf only! Write results into this file. Existings files are overridden!
options
- session options (String)
IdsException
<j method="cometGroupGetPreviews" ignoreError="1"> <path></path> <groupUID>237</groupUID> <resolution>360</resolution> <tmpFile>/Users/paul/Desktop/myPreviews/aaa.jpg</tmpFile> <options></options> </j>
int cometGroupInsertAfter(String path,
int groupUID,
int templateID,
String recordID,
int reorganize,
String resultPath, /* comet_pdf only */
String options)
throws IdsException
path
- path (String)
groupUID
- group UID (Long Integer)
templateID
- template ID (Long Integer)
recordID
- record ID (String) in format "1, 0, 0, \"116007\""
reorganize
- reorganize level (FULL, NONE, SPREAD, PAGE or SUBSEQUENT) (ReorganizeLevel enumerator)
resultPath
- (String) comet_pdf only! Write result into this file. Existings files are overridden!
options
- session options (String)
Option | Description |
check-pagetype:true | false | true (recommended!) : If available, use page type versions of templates false : Do not check for page types. |
auto-load:true | false | See parameter autoLoad of dopcument::insert_macro for more informations. |
layer:string | Name of layer to place the product on. |
prefer-existing-pages:true | false | Only used if parameter reorganize = SUBSEQUENT. See flag kPreferExistingPages of productlist::reorganize for more informations. |
IdsException
<j method="cometGroupInsertAfter" ignoreError="1"> <path></path> <groupUID>574</groupUID> <templateID>1</templateID> <recordID>1, 0, 0, "116007"</recordID> <reorganize>FULL</reorganize> <resultPath>$DESKTOP/abcd.txt</resultPath> <options>layer:de;</options> </j>
var gOptions = app.comet.ping() + ";-1;";
app.comet.setEnvironment ("/Users/paul/Desktop/fifo/priint 5.5/xmldata", 1401, ""); app.comet.use ("demo", "", "", false, "");
app.comet.documentOpen ("/Users/paul/Desktop/bbb.indd", true, gOptions);
app.comet.cometGroupInsertAfter ( "/Users/paul/Desktop/bbb.indd", 574, 1, "1, 0, 0, \"116007\"", ReorganizeLevel.FULL, gOptions+"layer:Ebene 1;");
int cometGroupInsertBefore(String path,
int groupUID,
int templateID,
String recordID,
int reorganize,
String resultPath, /* comet_pdf only */
String options)
throws IdsException
path
- path (String)
groupUID
- group UID (Long Integer)
templateID
- template ID (Long Integer)
recordID
- record ID (String) in format "1, 0, 0, \"116007\""
reorganize
- reorganize level (FULL, NONE, SPREAD, PAGE or SUBSEQUENT) (ReorganizeLevel enumerator)
resultPath
- (String) comet_pdf only! Write result into this file. Existings files are overridden!
options
- session options (String)
Option | Description |
check-pagetype:true | false | true (recommended!) : If available, use page type versions of templates false : Do not check for page types. |
auto-load:true | false | See parameter autoLoad of dopcument::insert_macro for more informations. |
layer:string | Name of layer to place the product on. |
prefer-existing-pages:true | false | Only used if parameter reorganize = SUBSEQUENT. See flag kPreferExistingPages of productlist::reorganize for more informations. |
IdsException
<j method="cometGroupInsertBefore" ignoreError="1"> <path></path> <groupUID>574</groupUID> <templateID>1</templateID> <recordID>1, 0, 0, "116007"</recordID> <reorganize>FULL</reorganize> <resultPath>$DESKTOP/abcd.txt</resultPath> <options>layer:de;</options> </j>
var gOptions = app.comet.ping() + ";-1;";
app.comet.setEnvironment ("/Users/paul/Desktop/fifo/priint 5.5/xmldata", 1401, ""); app.comet.use ("demo", "", "", false, "");
app.comet.documentOpen ("/Users/paul/Desktop/bbb.indd", true, gOptions);
app.comet.cometGroupInsertBefore ( "/Users/paul/Desktop/bbb.indd", 574, 1, "1, 0, 0, \"116007\"", ReorganizeLevel.FULL, gOptions+"layer:Ebene 1;");
int cometGroupReplaceGroup(String path,
int groupUID,
int templateID,
String recordID,
int reorganize,
String resultPath, /* comet_pdf only */
String options)
throws IdsException
path
- path (String)
groupUID
- group UID (Long Integer)
templateID
- template ID (Long Integer), use -1 for product changes only
recordID
- record ID (String) in format "1, 0, 0, \"116007\"", use "0, 0, 0, \"\"" for template changes only
reorganize
- reorganize level (FULL, NONE, SPREAD, PAGE or SUBSEQUENT) (ReorganizeLevel enumerator)
resultPath
- (String) comet_pdf only! Write result into this file. Existings files are overridden!
options
- session options (String)
Option | Description |
check-pagetype:true | false | true (recommended!) : If available, use page type versions of templates false : Do not check for page types. |
auto-load:true | false | See parameter autoLoad of dopcument::insert_macro for more informations. |
layer:string | Name of layer to place the product on. |
prefer-existing-pages:true | false | Only used if parameter reorganize = SUBSEQUENT. See flag kPreferExistingPages of productlist::reorganize for more informations. |
IdsException
<j method="cometGroupReplaceGroup" ignoreError="1"> <path></path> <groupUID>574</groupUID> <templateID>188</templateID> <recordID>0, 0, 0, ""</recordID> <reorganize>FULL</reorganize> <resultPath>$DESKTOP/abcd.txt</resultPath> <options>layer:de;</options> </j>
boolean cometGroupMoveBy(String path, int groupUID, double offsetX, double offsetY, String options) throws IdsException
path
- template path (String)
groupUID
- group UID (Long Integer)
offsetX
- x offset (Real)
offsetY
- y offset (Real)
options
- session options (String) - ignored by this function
IdsException
<?xml version="1.0" encoding="utf-8"?> <js> <j method="cometGroupMoveBy" ignoreError="1"> <path></path> <groupUID>237</groupUID> <offsetX>20</offsetX> <offsetY>20.0</offsetY> <options></options> </j> </js>
boolean cometGroupMoveTo(String path, int scope, int parent, int groupUID, double left, double top, String options) throws IdsException
path
- template path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
groupUID
- group UID (Long Integer)
left
- left (Real)
top
- top (Real)
options
- session options (String) - ignored by this function
IdsException
<?xml version="1.0" encoding="utf-8"?> <js> <j method="cometGroupMoveBy" ignoreError="1"> <path></path> <scope>PAGE</scope> <groupUID>237</groupUID> <left>20</left> <top>20.0</top> <options></options> </j> </js>
int importGroup(String path, String source, int scope, int parent, int groupUID, double left, double top, String options) throws IdsException
path
- template path (String)
source
- source document (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
groupUID
- group UID (Long Integer)
left
- left (Real)
top
- top (Real)
options
- session options (String)
IdsException
boolean execTemplate(int templateID, String recordID, String outPath, String options) throws IdsException
templateID
- template ID (Long Integer)
recordID
- record ID (String)
outPath
- out path (String)
options
- session options (String)
Option | Description |
width : float | Width of template in points |
margin-left, margin-right : float | If no width is specified: crop to width of generated frames + margins |
height : float | Height of template in points |
margin-top, margin-bottom : float | If no height is specified: crop to height of generated frames + margins |
offset-x : floatoffset-y : float |
Offset of frames in points |
IdsException
boolean documentReorganize(String path, int pageIndex, int reorganize, String options) throws IdsException
path
- path (String)
pageindex
- page index (Long Integer)
reorganize
- reorganize level (FULL, NONE, PAGE, SUBSEQUENT, SPREAD) (ReorganizeLevel enumerator)
options
- session options (String)
Option | Description |
prefer-existing-pages:0 | 1 | Like kPreferExistingPages in productlist::reorganize |
localize-masteritems:0 | 1 | Like kLoadMasterItems in productlist::reorganize |
IdsException
<j method="documentReorganize" ignoreError="1"> <path></path> <pageIndex>0</pageIndex> <reorganize>FULL</reorganize> <options></options> </j>
boolean pageApplyGrid(String path, int scope, int parent, int gridid, int reorganize, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
gridid
- grid ID (Long Integer)
reorganize
- reorganize level (full, none, current page or subsequent pages) (ReorganizeLevel enumerator)
options
- session options (String)
IdsException
boolean applyMasterpage(String path, int scope, int parent, String masterPageName, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator : SPREAD, PAGE)
parent
- Index of parent in hierarchy (Long Integer)
masterPageName
- maste page name (String)
options
- session options (String)
IdsException
<j method="applyMasterpage" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>1</parent> <masterPageName>B-KUGEL</masterPageName> <options></options> </j>
short adapt(double width, double height) throws IdsException
width
- width (Real)
height
- height (Real)
IdsException
IdsException
<j method="adapt" ignoreError="1"> <width>1000.0</width> <height>1000.0</height> </j>
boolean modifyCometGroup(String path, // ignored by comet_pdf
int scope,
int parent,
int[] targetElements,
String command,
String options)
throws IdsException
path
- path (String) // ignored by comet_pdf
scope
- scope (Scope enumerator), DOCUMENT or ELEMENT
parent
- UID of frame (Long Integer)
targetElements
- target elements (Array of Long Integers)
command
- command
Value | Description |
add | Add the frames given in targetElements to the Comet group of parent scope must have the value ELEMENT parent must have the UID of a frame of Comet group |
join | Similar to "add", but the frames are added to the first entry of targetElements, and, if one of this frames has its own Comet group, the whole list is added as sub group to group of the first frame. scope must have the value DOCUMENT parent is ignored. Set it to 0. |
remove | Remove the frames given in targetElements from the Comet group of parent scope must have the value ELEMENT parent must have the UID of a frame of Comet group |
resolve | Get the Comet group given in parameter parents and resolve this group. scope must have the value ELEMENT parent must have the UID of a frame of Comet group |
show | Make the frames given in targetElement visible. scope must have the value DOCUMENT parent is ignored. Set it to 0. |
hide | Hide the frames given in targetElement. scope must have the value DOCUMENT parent is ignored. Set it to 0. |
options
- session options (String)
Option | Description |
subgroups:true | false; | Take care on sub Comet groups (or not) Available only for the commands resolve and add. |
IdsException
IdsException
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>ELEMENT</scope> <parent>261</parent> <targetElements> <i>284</i> <i>289</i> </targetElements> <command>add</command> <options></options> </j>
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>DOCUMENT</scope> <parent></parent> <targetElements> <i>284</i> </targetElements> <command>show</command> <options></options> </j>
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>DOCUMENT</scope> <parent></parent> <targetElements> <i>284</i> </targetElements> <command>hide</command> <options></options> </j>
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>ELEMENT</scope> <parent>231</parent> <targetElements></targetElements> <command>resolve</command> <options>subgroups:true;</options> </j>
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>ELEMENT</scope> <parent>231</parent> <targetElements> <i>284</i> <i>254</i> </targetElements> <command>remove</command> <options></options> </j>
<j method="modifyCometGroup" ignoreError="1"> <path></path> <scope>DOCUMENT</scope> <parent></parent> <targetElements> <i>372</i> <i>308</i> <i>343</i> </targetElements> <command>join</command> <options></options> </j>
boolean placeholderLoad(String path, int scope, int parent, int[] placeholderID, String recordID, String options) throws IdsException
path
- path (String), ignored by comet_pdf
scope
- scope (Scope enumerator), use one of DOCUMENT, SPREAD, PAGE.
parent
- 0-based index of spread or page. Ignored for scope DOCUMENT (Long Integer)
placeholderID
- placeholder ID (Array of Long Integers), For all place holder use 0.
For comet_pdf add any number of sub-elements
to the XML element placeholderID.
The sub-elements may have any name you want
but must contain integers as direct values.
recordID
- record ID (String), format 1, 0, 0, "". For all products use 0, 0, 0, "".
options
- session options (String)
IdsException
<j method="cometGroupDeleteGroup" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>2</parent> <placeholderID> <i>10</i> <i>40</i> </placeholderID> <recordID>0,0,0,""</recordID> <options></options> </j>
boolean placeholderSync(String path, int scope, int parent, int[] placeholderIDs, String recordID, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
placeholderIDs
- placeholder ID (Array of Long Integers)
recordID
- record ID (String)
options
- session options (String)
IdsException
boolean placeholderSetValue(String path,
int scope,
int parent,
int placeholderID,
String recordID,
String value,
boolean execSaveMethod, // ignored by comet_pdf
String options)
throws IdsException
path
- path (String), ignored by comet_pdf
scope
- scope (Scope enumerator), one of DOCUMENT, SPREAD, PAGE
parent
- 0-based index of spread or page, ignored for scope DOCUMENT (Long Integer)
placeholderID
- placeholder ID (Long Integer)
recordID
- record ID (String), format 1, 0, 0, "".
value
- new value (String)
execSaveMethod
- execute save method (Boolean), ignored by comet_pdf
options
- session options (String)
IdsException
<j method="placeholderSetValue" ignoreError="1"> <path></path> <scope>PAGE</scope> <parent>0</parent> <placeholderID>3</placeholderID> <recordID>1,0,0,"1010097"</recordID> <value>%!TT<cColor:Red>Hallöchen<cColor:> and Hi!</value> <execSaveMethod>0</execSaveMethod> <options></options> </j>
boolean placeholderSetImage(String path,
int scope,
int parent,
int placeholderID,
String recordID,
String imagePath,
boolean execSaveMethod, // ignored by comet_pdf
String options)
throws IdsException
path
- path (String), ignored by comet_pdf
scope
- scope (Scope enumerator), one of DOCUMENT, SPREAD, PAGE
parent
- 0-based index of spread or page, ignored for scope DOCUMENT (Long Integer)
placeholderID
- placeholder ID > 0 (Long Integer)
recordID
- record ID (String), format 1, 0, 0, "", For all products use 0, 0, 0, "".
imagePath
- image path (String)
execSaveMethod
- execute save method (Boolean), ignored by comet_pdf
options
- session options (String)
IdsException
<j method="placeholderSetImage" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>2</parent> <placeholderID>70</placeholderID> <recordID>2,0,0,""</recordID> <imagePath>$DESKTOP/Bilder/here_we_are.png</imagePath> <execSaveMethod>0</execSaveMethod> <options></options> </j>
boolean placeholderUpdate(String path, int scope, int parent, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
options
- session options (String)
IdsException
boolean elementSetValue(String path, int elementID, String elementFragment, String value, String options) throws IdsException
path
- path (String)
elementID
- element ID (Long Integer)
elementFragment
- element fragment (String)
value
- new value (String)
options
- session options (String)
IdsException
boolean elementSetImage(String path, int elementID, String imagePath, String options) throws IdsException
path
- path (String, ignored on comet_pdf
elementID
- element ID (Long Integer), uid of frame
imagePath
- image path (String)
options
- session options (String)
Option | Description |
image-pos | Image position. One of the following: top-left, topleft top-center[ed], topcenter[ed] top-right, topright middle-left, middleleft middel, center[ed] middle-right, middleright bottom-left, bottomleft bottom-center[ed], bottomcenter[ed] bottom-right Default : topleft |
image-scale | Image position. One of the following: none (This means : Place like existing.) fit-Frame, fitFrame (Take care on the upper case F!) fit-Content, fitContent (Take care on the upper case C!) fit-content-width, fitcontentwidth fit-content-height, fitcontentheight fit-frame-width, fitframewidth fit-frame-height, fitframeheight best best-centered, bestcentered Default : none |
IdsException
IdsException
<j method="elementSetImage" ignoreError="1"> <path></path> <elementID>937</elementID> <imagePath>$DESKTOP/Bilder/here_we_are.png</imagePath> <options>image-pos:bottomright;image-scale:fitFrame;</options> </j>
boolean use(String service, String user, String password, boolean forceReconnect, String options) throws IdsException
service
- service name (as defined in connections.xml) (String)
user
- username (if empty: as supplied in connections.xml) (String)
password
- password (if empty: as supplied in connections.xml) (String)
forceReconnect
- force reconnection (Boolean)
options
- setup options (String)
Option | Description |
playback | Playback mode for connection, see here for more informations. Use one of the following:
inherited |
playback-path | Path to playback folder, see here for more informations. If empty or missing, the default path in $CACHE/DATA is used. |
userdata | Complete path to an XML file of type userproperties.xml containing some additional user data. |
IdsException
The predefined method is done in two steps:
First an environment is set by using the first parameter of app.comet:setEnvironment .
Then a connection defined in this environment is used to login by the first parameter app.comet.use.
The environment must be an valid Comet XML folder. For performance reasons, the XML folder should be as empty as possible.
CometEnvironment.zip is a complete and usable example of an Comet XML folder.
Here's a valid connection.xml with a defined connection to a mySQL database:
<connection>
<id>1</id>
<name>demo</name>
<type>odbc_utf8</type>
<server>demo</server>
<password>***</password>
<db>comet_config</db>
<lang></lang>
<client></client>
<passcredentials></passcredentials>
</connection>
Example of predefined method to login:
var gOptions = app.comet.ping() + ";-1;";
app.comet.setEnvironment ("/Users/paul/priint_test/xmldata", 1401, "");
app.comet.use ("demo", "", "", false, gOptions);
Endpoint connections are defined only for SOAP/Publishing Server connetions. The endpoint connection is done in two steps:
First the endpoint is defined by using the third app.comet:setEnvironment .
The following call to app.comet:.use will then connect to the endpoint using the given user name and password. Please note, endpoint connections cannot set a specific language!
Example of endpoint connection to login:
var gOptions = app.comet.ping() + ";-1;";
app.comet.setEnvironment ("", 1401, "http://localhost_40080_CometBridge_Comet3Service");
app.comet.use ("", "user", "password", false, gOptions);
Direct login can be done by a single call to app.comet.use. After a trailing ##, the connection is described in the first parameter of the function by a semicolon delimited key-values list. The following keywords are supported:
Example of direct login:
app.comet.use (
"##server:demo;type:odbc_utf8;db:comet_config",
"demo",
"***",
false,
gOptions);
boolean setEnvironment(String initRoot, int instanceID, String pathResolvePattern) throws IdsException
initRoot
- root path of the initialization project (String)
instanceID
- ID of the server instance,must be unique (Long Integer)
pathResolvePattern
- pattern to resolve paths provided by comet server (String)
IdsException
DEPRECATED
boolean registerResource(String path, int tmpPath) throws IdsException
path
- virtual path of the resource (String)
tmpPath
- path where the resource file is currently stored (Long Integer)
IdsException
int ping() throws IdsException
IdsException
DEPRECATED
boolean applicationShutdown(String options) throws IdsException
options
- session options (String)
IdsException
DEPRECATED
boolean reloadConfig(String service, String config, String options) throws IdsException
service
- service name (as defined in connection.xml) (String)
config
- config (String)
options
- setup options (String)
IdsException
boolean elementMove(String path, // ignored by comet_pdf
int scope,
int parent,
int elementID,
double left,
double top,
String options)
throws IdsException
path
- template path (String), ignored by comet_pdf
scope
- scope (Scope enumerator : PAGE, SPREAD)
parent
- Spread ot page index for destination (Long Integer), 0-based, used only if move-relative:1;
elementID
- element ID (Long Integer)
left
- left (Real)
top
- top (Real)
options
- session options (String)
Option | Description |
move-relative:0 | 1; | Move frame relative or absolut? |
IdsException
<j method="elementMove" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>2</parent> <elementID>222</elementID> <left>46.0</left> <top>46.0</top> <options>move-relative:0;</options> </j>
boolean elementDelete(String path, // ignored by comet_pdf
int elementID,
String options)
throws IdsException
path
- template path (String) ignored by comet_pdf
elementID
- element UID (Long Integer)
options
- session options (String)
IdsException
IdsException
<j method="elementDelete" ignoreError="1"> <path></path> <elementID>905</elementID> <options></options> </j>
boolean elementTransform(String path, int elementID, String options) throws IdsException
path
- template path (String), ignored from comet_pdf
elementID
- UID of requested frame
options
- session options (String) :
Option | Description |
width:float; height:float; |
Resize frame to the given size. Default fix point is lefttop. |
scale-x:float; scale-y:float; |
Scale frame by the given percentages. Values must be greater 0.0. 1.0 means 100%. Default fix point is the left top corner of the bounding box. |
rotate:float; | Rotate frame by the given degrees (0.0-360.0) clock wise. Default fix point is center. |
x:float; y:float; [page-num:int;] |
Move frame to the given position, and (if given and >= 0) to the given page. Page numbers are 0-based. |
reference-point:fixpoint - optional |
Resizes, scales and roations can be done at one of the nine referenz points of the frame. Supported values are:
|
IdsException
<j method="elementTransform" ignoreError="1">
<path></path>
<elementID>222</elementID>
<options>width:100.0;height:100.0;reference-point:rb</options>
</j>
var gOptions = app.comet.ping() + ";-1;"; var myPath = "/Users/paul/Desktop/resize_frame.indd"; app.comet.setEnvironment ("/Users/paul/Desktop/fifo/5. print.day/xmldata", 1401, ""); app.comet.use ("printday5.5", "", "", false, ""); app.comet.documentOpen (myPath, true, gOptions); app.comet.elementTransform (myPath, 225, gOptions+";width:100.0;height:100.0;reference-point:rb");
boolean elementInsertPara(String path, int elementID, String elementFragment, boolean beforePara, String value, String options) throws IdsException
path
- path (String)
elementID
- element ID (Long Integer)
elementFragment
- element fragment (String)
beforePara
- before paragraph (true) or after (false) (Boolean)
value
- new value (String)
options
- session options (String)
IdsException
boolean generatePDF(String path, int scope, String pagesOrSpreads, String pdfProfile, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
pagesOrSpreads
- Comma seperated list of pages resp spreads (String)
pdfProfile
- PDF Profile (String)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
DEPRECATED
boolean generateSWF(String path, int scope, String pagesOrSpreads, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
pagesOrSpreads
- Comma seperated list of pages resp spreads (String)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
package-format |
swf : Create a SWF formated package package : Create a InDesign® package |
package-images:true | false |
valid only for package-format:package true : Add images to package false : Do not add images to package |
package-color-profiles:true | false |
valid only for package-format:package true : Add color profiles to package false : Do not add color profiles to package |
package-hidden-layers:true | false |
valid only for package-format:package true : Add hidden layers to package false : Do not add hidden layers to package |
package-ignore-errors:true | false |
valid only for package-format:package true : Stopp packiging on any errors false : Ingore missing fonts, images, profiles, ... |
package-report:true | false |
valid only for package-format:package true : Write a package report false : Do not write a package report. |
package-include-idml:true | false |
valid only for package-format:package true : Include an IDML verison of the document into the package false : Do not include an IDML verison of the document into the packag |
package-include-pdf:true | false |
valid only for package-format:package true : Include a PDF verison of the document into the package false : Do not include a PDF verison of the document into the packag |
package-pdf-profile |
valid only for package-format:package and package-include-pdf:true Name of PDF profile used to create the PDF |
package-folder-name |
valid only for package-format:package Destination folder for the package. If the folder does not exist, it is created. |
package-document-name |
valid only for package-format:package Name of package result folder |
IdsException
DEPRECATED
int buildDynamic(String path, int scope, int parent, String itemsXML, String templatesXML, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
itemsXML
- xml with list of items (String)
templatesXML
- xml with list of items (String)
options
- session options (String)
IdsException
boolean elementDeletePara(String path, int elementID, String elementFragment, String options) throws IdsException
path
- path (String)
elementID
- element ID (Long Integer)
elementFragment
- element fragment (String)
options
- session options (String)
IdsException
boolean spreadGetElementsPreview(String path, int scope, int parent, double resolution, int[] elements, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
resolution
- resolution (Real)
elements
- element IDs (Array of Long Integers)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
boolean spreadGetCometGroupsPreview(String path, int scope, int parent, double resolution, int[] groups, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
resolution
- resolution (Real)
groups
- group IDs (Array of Long Integers)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
boolean spreadGetElementsSnippet(String path, int scope, int parent, int[] elements, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
elements
- element IDs (Array of Long Integers)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
boolean spreadGetCometGroupsSnippet(String path, int scope, int parent, int[] groups, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
groups
- group IDs (Array of Long Integers)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
int spreadPlaceDocument(String path, int scope, int parent, double x, double y, boolean createGroup, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
x
- x (Real)
y
- y (Real)
createGroup
- create comet group (Boolean)
tmpFile
- path of document (String)
options
- session options (String)
Option | Description |
layer | Target layer |
IdsException
boolean setItems(String path, int scope, // IGNORED int parent,// IGNORED String items, String tmpFile, String options) throws IdsException
path
- path (String) // IGNORED by comet_pdf
scope
- scope (Scope enumerator) // IGNORED
parent
- UID or index of parent in hierarchy (Long Integer) // IGNORED
items
- new item list (String : path to file or string starting with "<" with items, see here for xml format.)
options
- session options (String)
Option | Description |
prefer-existing-pages:true | false | See kPreferExistingPages of productlist::establish |
prefer-default-pageitem:true | false | See kPreferDefaultPageItem of productlist::establish |
skip-empty-templates:true | false | See kSkipEmptyTemplates of productlist::establish |
auto-detect-type:true | false | See kAutoDetectType of productlist::establish |
localize-masteritems:true | false | See kLoadMasterItems of productlist::establish |
allow-doubles:true | false |
true : Allow double products
false : Only use the first product in case of multiple products with the same id |
preserve-manual-groups:true | false |
true : Remove products with empty id
false : Import products with empty id too |
IdsException
IdsException
<j method="setitems" ignoreError="1"> <path></path> <scope>PAGE</scope> <parent>0</parent> <items>$DESKTOP/pp.xml</items> <options>localize-masteritems:true;</options> </j>
String getItems(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
hide-manual-groups:true | false |
true : Don't add manually inserted Comet groups into the result false : Add manually inserted Comet groups into the result |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
boolean documentOpenCached(String path, boolean openOriginal, String[] cacheOptions, String options) throws IdsException
path
- path (String)
openOriginal
- open original (true) or copy (false) (Boolean)
cacheOptions
- cache options (Array of Strings)
options
- session options (String)
IdsException
boolean addSpreadOrPage(String path, // IGNORED by comet_pdf
int scope,
int behind,
int count,
String masterPageName,
String options)
throws IdsException
path
- path (String) // IGNORED by comet_pdf
scope
- scope (Scope enumerator: SPREAD or PAGE)
behind
- 0-based index of spread or page (Long Integer)
count
- how many spreads / pages to create (Long Integer)
masterPageName
- master page name (String)
options
- session options (String)
Option | Description |
pages-per-spread : int | Number of pages or spreads to create. Valid only for scope SPREAD. |
reshuffle : true | false |
true : Reshuffle pages if needed false : Suppress reshuffling pages |
IdsException
<j method="addSpreadOrPage" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>1</parent> <masterPageName>B-Masterpage</masterPageName> <options>pages-per-spread:2;</options> </j>
boolean deleteSpreadOrPage(String path, // IGNORED by comet_pdf
int scope,
int first,
int count,
String options)
throws IdsException
path
- path (String) // IGNORED by comet_pdf
scope
- scope (Scope enumerator)
first
- 0-based index of spread or page (Long Integer)
count
- how many spreads / pages to delete (Long Integer), use -1 to remove all
options
- session options (String)
Option | Description |
reshuffle: true | false |
true : Reshuffle pages if needed false : Suppress reshuffling pages |
IdsException
<j method="deleteSpreadOrPage" ignoreError="1"> <path></path> <scope>SPREAD</scope> <parent>2</parent> <count>-1</count> <options></options> </j>
String matchItems(String path, int scope, int parent, String items, String tmpFile, String options) throws IdsException
path
- template path (String)
scope
- scope (Scope enumerator), one of SPREAD or PAGE
parent
- 0-based index of spread or page (Long Integer)
items
- new item list (String : path to file or string starting with "<" with items, see here for xml format. )
tmpFile
- tmp file path (String)
Value | Description |
treshold=int | Due to a bug in the older CORBA interface of InDesign® Server, InDesign® Server may crash, if functions called through this interface returning values longer than 512 kB. Therefor we limit the return values of functions that may call through this interface to 512 kB. Using the treshold, you can try to increase this limit by your own risk. Values longer than the treshold are not returned and the functions return string is empty in this case. Use -1 to disable range checkings here. Ignored by comet_pdf! |
full_path | A better way to set your own treshold is the command line option -cometthreshold your_global_threshold_in_bytes (-1 for "any") In this case results longer then the treshold are written to the given file and you have to check the function result in your JavaScript : If the result is undefined, use this file to read the result from. Ignored by comet_pdf! |
!full_path | Write the result to the file given by the path. Take care for the trailing exclamation mark! |
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false; | Indent the result XML or not. |
hide-manual-groups:true | false; | Include manually created Comet groups in the result or not? |
IdsException
<j method="matchItems" ignoreError="1">
<path></path>
<scope>PAGE</scope>
<parent>0</parent>
<items>$DESKTOP/ccc.xml</items>
<tmpFile>!$DESKTOP/ccc_new.xml</tmpFile>
<options>xmlindent:true;</options>
</j>
boolean moveSpreadsOrPages(String path, int scope, int behind, int start, int count, String options) throws IdsException
path
- template path (String)
scope
- scope, SREAD or PAGE (Scope enumerator)
behind
- 0-based index of parent in hierarchy (Long Integer)
start
- 0-based index of first parent in hierarchy to be moved (Long Integer)
count
- how many spreads / pages to move (Long Integer)
options
- session options (String)
IdsException
<j method="matchItems" ignoreError="1"> <path></path> <scope>PAGE</scope> <start>3</start> <count>4</count> <parent>8</tmpFile> <options></options> </j>
String[] getPdfProfiles(String options) throws IdsException
options
- session options (String)
IdsException
DEPRECATED
String getDocumentStyles(String path, int scope, int parent, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
tmpFile
- tmp file path (String)
options
- session options (String)
Option | Description |
xmlschema:true | false |
true : Add default schema xmlns:psc="http://comet.werk-ii.com/psc_~" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://comet.werk-ii.com/psc_~ psc_~.xsd" false : Omit schema |
xmlindent:true | false |
true : Normal indention in XML false : Compact XML |
IdsException
int runPanelAction(String path, int scope, int parent, int actionID, String selection, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (Scope enumerator)
parent
- UID or index of parent in hierarchy (Long Integer)
actionID
- action to be executed (Long Integer)
selection
- xml defining the current selection (String)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
String getIDML(String path, int scope, int parent, String idmlPart, String tmpFile, String options) throws IdsException
path
- path (String)
scope
- scope (currently unused) (Scope enumerator)
parent
- UID or index of parent in hierarchy (currently unused) (Long Integer)
idmlPart
- idml part (such as "styles", "graphics" etc.) (String)
tmpFile
- tmp file path (String)
options
- session options (String)
IdsException
String doc.frameSetOrigin(int frameUID, int originUID) throws IdsException
Set the origin UID in master of a given frame. The function is required only for synchronizations. It defines the corresponding frame in the master of a frame of a variant.
Please note: This function is not handled in the comet suite but directly by a document!
frameUID
- UID of an existing frame in the document (Long Integer)
originUID
- UID of the origin frame in master or 0 (Long Integer)
IdsException
int doc.frameSetOrigin(int frameUID)
Get the origin frame UID in master of a given frame. The function is required only for synchronizations. It returns the corresponding frame in the master of a frame of a variant.
Please note: This function is not handled in the comet suite but directly by a document!
frameUID
- UID of an existing frame in the document (Long Integer)
String doc.pageSetOrigin(int pageUID, int originUID) throws IdsException
Set the origin UID in master of a given page. The function is required only for synchronizations. It defines the corresponding page by UID in the master of a page of a variant.
Please note: This function is not handled in the comet suite but directly by a document!
pageUID
- UID of an existing page in the document (Long Integer)
originUID
- UID of the origin page in master or 0 (Long Integer)
IdsException
int doc.pageGetOrigin(int frameUID)
Get the origin page UID in master of a given page. The function is required only for synchronizations. It returns the corresponding page UID in the master of a page of a variant.
Please note: This function is not handled in the comet suite but directly by a document!
pageUID
- UID of an existing frame in the document (Long Integer)
int doc.getTemplateID()
[Since v4.1.6 R26580] The function determines whether the document is a priint:comet template or not.
Return Values
Please note: This function is not handled in the comet suite but directly by a document!
int doc.getPageTemplateID()
[Since v4.1.6 R26580] The function determines whether the document is a priint:comet page template or not.
Return Values
Please note: This function is not handled in the comet suite but directly by a document!