Functions to import and export user profiles.

static int export_pdfstyles(char* destPath, StringList onlyThose = 0)

Export PDF profiles to an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You may use the export to create your own profiles based on these definitions. Don't forget to remove the braces in this case.

Name Type Default Description
Return int   Error code or 0
destPath String or char* - Destination path of the XML. File will be overwritten if it exists.
onlyThose StringList 0 Profiles to export?

0 or empty : All profiles
otherwise : only profiles given in the list

Export of all PDF profiles.

int main ()
{
    prefs::import_pdfstyles ("$DESKTOP/pfd_profiles_all.xml");
return 0; }

Export of some PDF profiles.

int main ()
{
    StringList		profiles = stringlist::alloc ();
stringlist::append (profiles, "Pauls PDF Profile"); stringlist::append (profiles, "Christophs PDF Profile");
prefs::import_pdfstyles ("$DESKTOP/pfd_profiles1.xml", profiles);
return 0; }

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

import_pdfstyles, list_pdfstyles

static int import_pdfstyles(
  char* destPath,
  StringList onlyThose = 0,
  int mode = 0)

Import PDF profiles from an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You may use the export to create your own profiles based on these definitions. Don't forget to remove the braces in this case.

Name Type Default Description
Return int   Error code or 0
srcPath String or char* - Full path of an XML file in the format written by export_pdfstyles
onlyThose StringList 0 Profiles to import?

0 or empty : All profiles
otherwise : only profiles give in the list
mode int 0 What to do if a profile already exists?

0 : override
1 : skip
2 : abort

Import all pdf profiles defined in a given xml file. Take care to release the list profiles before a next call to list_pdf_styles.

int main ()
{
    StringList		profiles;
    char		*	str;
wlog ("", "# Before import\n"); profiles = prefs::list_pdfstyles (""); for (str = stringlist::first (profiles); str; str = stringlist::next (profiles)) { wlog ("", "#\t'%s'\n", str); }
prefs::import_pdfstyles ("$DESKTOP/pfd_profiles1.xml", 0);
wlog ("", "# After import\n"); stringlist::release (profiles); // Delete list before! profiles = prefs::list_pdfstyles (""); for (str = stringlist::first (profiles); str; str = stringlist::next (profiles)) { wlog ("", "#\t'%s'\n", str); }
return 0; }

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_pdfstyles

static StringList list_pdfstyles(char* source = 0, StringList listToFill = 0)

List all available PDF profiles

Name Type Default Description
Return StringList   List of available profiles

If listToFill empyt, a new StringList is created. In this case you should free the list using stringlist::release after you dont need it anymore.
source String or char* 0 Where to search for profiles

0 or "" : InDesign®-Preferences
otherwise : path to an XML file in the export_pdfstyles format
listToFill StringList 0 List of results. If empty, a new StringList is created (In this case you should free the list using stringlist::release after you dont need it anymore.) Otherwise the given list is filled with the resulting profile names.

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_pdfstyles, import_pdfstyles

static int export_printstyles(char* destPath, StringList onlyThose = 0)

Export printer profiles to an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You cannot - like for PDF profiles - duplicate and rename entries of the XML. The included binary data in CDATA contains the name of the preset too.

Name Type Default Description
Return int   Error code or 0
destPath String oder char* - Destination path of the XML. File will overridden if exists.
onlyThose StringList 0 Profiles to export?

0 or empty : All profiles
otherwise : only profiles give in the list

Export aller Drucker-Presets.

int main ()
{
    prefs::export_printstyles ("$DESKTOP/pfd_profiles_all.xml");
return 0; }

Export einiger Drucker-Presets.

int main ()
{
    StringList		profiles = stringlist::alloc ();
stringlist::append (profiles, "Pauls PDF Profile"); stringlist::append (profiles, "Christophs PDF Profile");
prefs::export_printstyles ("$DESKTOP/pfd_profiles1.xml", profiles); return 0; }

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

import_printstyles, list_printstyles

static int import_printstyles(
  char* srcPath,
  StringList onlyThose = 0,
  int mode = 0)

Import printer profiles from an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You cannot - like for PDF profiles - duplicate and rename entries of the XML. The included binary data in CDATA contains the name of the preset too.

First time after program start this command may take a while. InDesign® needs a little bit time to scan all current print devices.

Name Type Default Description
Return int   Error code or 0
srcPath String or char* - Full path of an XML file in the format written by export_printstyles
onlyThose StringList 0 Profiles to import?

0 or empty : All profiles
otherwise : only profiles give in the list
mode int 0 What to do, if a profile already exists?

0 : override
1 : skip
2 : abort

Import all printer presets of a given XML file.

int main ()
{
    StringList		profiles;
    char		*	str;
    int			res;
    wlog ("", "# Before import\n");
    profiles = prefs::list_printstyles ("");
    for (str = stringlist::first (profiles); str; str = stringlist::next (profiles))
    {
        wlog ("", "#\t'%s'\n", str);
    }
    res = prefs::import_printstyles ("$DESKTOP/print_profiles1.xml", 0);
    wlog ("", "# Import result %d\n", res);
    wlog ("", "# After import\n");
    stringlist::release (profiles);	// Delete list before!
    profiles = prefs::list_printstyles ("");
    for (str = stringlist::first (profiles); str; str = stringlist::next (profiles))
    {
        wlog ("", "#\t'%s'\n", str);
    }
    return 0;
}

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_printstyles

static StringList list_printstyles(char* source = 0, StringList listToFill = 0)

List all available printer profiles

Name Type Default Description
Return StringList   List of available profiles

If listToFill is empty, a new StringList is created. In this case you should free the list using stringlist::release after you don't need it anymore.
source String or char* 0 Where to search for profiles

0 or "" : InDesign®-Preferences
otherwise : path to an XML file in the export_printstyles format
listToFill StringList 0 List of results. If empty, a new StringList is created (In this case you should free the list using stringlist::release after you dont need it anymore.) Otherwise the given list is filled with the resulting profile names.

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_printstyles, import_printstyles

static int export_flattenerstyles(char* destPath, StringList onlyThose = 0)

Export transparency flattener profiles to an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You may use the export to create your own profiles based on these definitions. Don't forget to remove the braces in this case.

Name Type Default Description
Return int   Error code or 0
destPath String or char* - Destination path of the XML. File will overwritten if it exists.
onlyThose StringList 0 Profiles to export?

0 or empty : All profiles
otherwise : only profiles give in the list

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

import_flattenerstyles, list_flattenerstyles

static int import_flattenerstyles(
  char* destPath,
  StringList onlyThose = 0,
  int mode = 0)

Import transparency flattener profiles from an XML file.

The brace-surrounded [InDesign® default profiles] can be exported, but not imported. You may use the export to create your own profiles based on these definitions. Don't forget to remove the braces in this case.

Name Type Default Description
Return int   Error code or 0
srcPath String or char* - Full path of an XML file in the format written by export_flattenerstyles
onlyThose StringList 0 Profiles to import?

0 or empty : All profiles
otherwise : only profiles give in the list
mode int 0 What to do, if a profile already exists?

0 : override
1 : skip
2 : abort

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_flattenerstyles

static StringList list_flattenerstyles(char* source = 0, StringList listToFill = 0)

List all available transparency flattener profiles

Name Type Default Description
Return StringList   List of available profiles

If listToFill empyt, a new StringList is created. In this case you should free the list using stringlist::release after you dont need it anymore.
source String or char* 0 Where to search for profiles

0 or "" : InDesign®-Preferences
otherwise : path to an XML file in the export_flattenerstyles format
listToFill StringList 0 List of results. If empty, a new StringList is created (In this case you should free the list using stringlist::release after you dont need it anymore.) Otherwise the given list is filled with the resulting profile names.

Version 3.1 R1760, 25. Feb. 2010

priint:comet InDesign® Plug-Ins

export_flattenerstyles, import_flattenerstyles

static int get_script_buffer()

Current script buffer size.

Name Type Default Description
Return int   Size of script buffer in kB

Version 3.1 R2021, 20. Juli 2010

priint:comet InDesign® Plug-Ins, comet_pdf

set_script_buffer

static int set_script_buffer(int newSize)

Set the size of the script buffer. Values are given in kB and automatically ranged to 1024 - 16384 (1-16 MB). The changes will take effect from the next scripts.

The script buffer is used for all identifiers (stack) and their values (heap). Every script use its own buffer. A small buffer can lead to memory overflow (Symbol table full, Out of heap memory). A large buffer may increase the execution time or can bring InDesign® to a memory overflow. You may save script memory by using

    char * str = alloc (5000);

instead of

    char str [5000];

In the second case you need 5000 bytes of your script heap, in the first case only 4! (The 5000 bytes of the string are allocated in the big InDesign® memory).

To ensure that your scripts have enough memory space, call this function in the login script of your data connection.

Default size is 128 kB.

Name Type Default Description
Return int   New script buffer size in kB
newSize int - New script buffer size in kB

Values are given in kB and automatically ranged to 1024 - 16384 (1-16 MB). The changes will take effect from the next scripts.

Version 3.1 R2021, 20. Juli 2010

v4.1.8 R27460, 9. Sep. 2020, range changed from 128 kB - 8 MB to 1 - 16 MB

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_preserve_color_profiles(int state)

Color profile save insertion of Comet templates.

Due to an InDesign® bug, templates may change the color profile of InDesing documents : If the color profiles of the document and the template differs, the profile of the template is set to the document. Using a very old method of duplicating frames described in InDesign® 2.0 (the last version prior Creative Suite - it was in 2003!) can fix this problem.

Because inserting templates is a central feature of Comet plugins, we did not change the standard behavior. If you want to use color profile save insertions, you have to activate this by calling set_preserve_color_profiles.

Setting state to 1 will activate the feature until the datapool connection changes or by calling the function with state 0.

To ensure the feature is activated for a database connection, you may invoke it inside the login script.

Name Type Default Description
Return int   error code oder 0
state int - 0 : Use standard behavior

1 : color profile save template insertions. The activation is turned off by changing the datapool connection automatically.

After more than eight years of transition, we are now deprecating the function and the color profile-preserving procedure for duplicating frames becomes the default.
Version 3.1 R2050, 5. Aug. 2010

priint:comet InDesign® Plug-Ins

static int get_preserve_color_profiles()

Current method for inserting templates.

Name Type Default Description
Return int   0 : standard
1 : color profile save insertion of templates

After more than eight years of transition, we are now deprecating the function and the color profile-preserving procedure for duplicating frames becomes the default.
Version 3.1 R2050, 5. Aug. 2010

priint:comet InDesign® Plug-Ins

set_preserve_color_profiles

static int add_idml_to_templates(int v = -1)

DEPRECATED! Save an IDML version of every template after creating or changing the templates data file. Using XML or SOAP, simply an IDML version of the template is generated in the same folder like the template (pageitems/data/NNN.idml in most cases). SQL connections using the panelstatement 121 to save the idml data. If this statement is empty or missing, update pageitems set dataIDML = LATIN1 ? where id = ? is used automatically whereby LATIN1 is replaced by its current value defined in table keywords.

The option is turned off automatically at logout time.

Normally you use your login script (panelstatement 92) to turn on the option.

Name Type Default Description
Return int   Current value

0 : Off
1 : On
v int - Get/set the state

-1 : get state
0 : set to 'off'
1 : set to 'on'

Since v4.1 R21213, 8. Dec 2017 IDML versions of the templates are never used by the priint:priint:comet InDesign® Plug-Ins. The statement has no effect on the saving of templates anymore.
Version 3.2 R2155, 29.09.2010

priint:comet InDesign® Plug-Ins, comet_pdf

static int add_w2ml_to_templates(int v = -1)

Save a W2ML version of every template after creating or changing the templates data file. Using XML or SOAP, simply an W2ML version of the template is generated in the same folder like the template (pageitems/data/NNN.w2ml in most cases). SQL connections using the panelstatement 137 to save the w2ml data. If this statement is empty or missing, update pageitems set dataW2ML = where id = ? is used automatically.

The option is turned off automatically at logout time.

Normally you use your login script (panelstatement 92) to turn on the option.

Name Type Default Description
Return int   Current value

0 : Off
1 : On
v int - Get/set the state

-1 : get state
0 : set to 'off'
1 : set to 'on'
2 : set to 'on' and also set add_metadata_to_templates to on

3.3.1 R3445, 21. Feb. 2013

priint:comet InDesign® Plug-Ins, comet_pdf

static int add_metadata_to_templates(int v = -1)

Save Metadata of every template after creating or changing the templates data file. Using XML or SOAP, a zipped folder of the template metadata with file extension meta.zip is generated in the same folder like the template (pageitems/data/NNN.w2ml in most cases). SQL connections using the panelstatement 146 to save the metadata. If this statement is empty or missing, update pageitems set metadata = where id = ? is used automatically. For page templates, the statement update pagetemplates set metadata = where id = ? is used

The option is turned off automatically at logout time.

Normally you use your login script (panelstatement 92) to turn on the option.

Name Type Default Description
Return int   Current value

0 : Off
1 : On
v int - Get/set the state

-1 : get state
0 : set to 'off'
1 : set to 'on'

4.1.6, R26027

priint:comet InDesign® Plug-Ins, comet_pdf

static int add_w2ml_to_snippets(int v = -1)

Save a W2ML version of every snippet after creating or changing the snippets.

The option is turned off automatically at logout time.

Normally you use your login script (panelstatement 92) to turn on the option.

Name Type Default Description
Return int   Current value

0 : Off
1 : On
v int - Get/set the state

-1 : get state
0 : set to 'off'
1 : set to 'on'

4.1.7 R26615

priint:comet InDesign® Plug-Ins, comet_pdf

static int snippet_match(int v = -1)

Set standard snippet match criteria

The value is reset automatically at logout time.

Normally you set this value in a login script (panelstatement 92)

Name Type Default Description
Return int   Current value

v int - Get/set the value

-1 : get value
0 : turn snippet usage off
> 0 : arbitrary combination of snippet match criteria (see productlist::establish), e.g. kSnippetMatchesTemplate + kSnippetMatchesProduct

4.1.7 R26615

priint:comet InDesign® Plug-Ins, comet_pdf

static char* snippet_filter(int fptr)

Standard filter function for snippet creation

When creating snippets, a callback function can be defined to decide, whether snippets should be created for certain products or not. This function will also be called, when snippets are created via user interface, e.g. using the product build dialog or the '+' button in the preview panel.

Name Type Default Description
Return char *   name of the active filter function
fptr int - function pointer 0 : deactivate

Snippet filter functions must follow this pattern

int myFilterFunction(Product p) 
{
    if (certainConditions) 
    {
        return 1; // => create snippets
    }
    return 0; // => don't create snippets
}

The following example illustrates, how to prevent from creating snippets based on page-specific templates:

#include "internal/types.h"
int disallowTypedTemplates(Product p)
{
    int templatePageType = product::get_pageitem_type(p);
    if (templatePageType != kUndefPage)
    {
        // optionally prompt user
        return 0;
    }
    return 1;
}	

Usually you define this function in a Loginscript (Panelstatement 92) or include it via a script #include and activate it this way:

prefs::snippet_filter(disallowTypedTemplates);

4.1.7 R26615

priint:comet InDesign® Plug-Ins, comet_pdf

static int show_url_progress(int state = -1)

Show progress bar when downloading Web Images? For manually creating and updating Web Images using Web Images panel or the context menu Web Images the setting has no meaning.

The setting returns to the default setting No Progress Bar when the current data connection is terminated.

Name Type Default Description
Return int   Current value of setting

0 : Suppress progress
1 : Show progress
state int -1 0 : Suppress progress
1 : Show progress -1 : Ask for current state only

v4.1 R21112, 1. Dec 2017

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

frame::link_url, frame::embed_url

static int get_tags_writeable()

Write Comet place holders to tagged text or not? See also Export/Import of Comet place holders.

Name Type Default Description
Return int   0 : Do not write Comet place holders

1 : Write Comet place holders to tagged text

v3.3 R2580, 2. Aug. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_tags_writeable()

Write Comet place holders to tagged text or not? Change state here. See also Export/Import of Comet place holders.

Ignored by priint:comet InDesign® Plug-Ins while generating kExportTT (contains no place holders) and kExportW2 (contains place holders).

Name Type Default Description
Return int   old state
newState int 1 new state

0 : Do not write Comet place holders
1 : insert Comet place holders in TaggedText

#include "internal/text.h"

v3.3 R2580, 2. Aug. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

static int get_tags_readable()

Ignore Comet place holders while importing tagged text or not? See also Export/Import of Comet place holders.

Name Type Default Description
Return int   0 : Ignore Comet place holders

1 : Create Comet place holder in tagged text while importing

v3.3 R2580, 2. Aug. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_tags_readable(int newState)

Automatically create Comet place holders while importing tagged text or not? See also Export/Import of Comet place holders.

The state is ignored by priint:comet InDesign® Plug-Ins while importing %!TT texts.

Name Type Default Description
Return int   old state
newState int 1 new state

0 : ignore Comet place holders
1 : apply Comet place holders

v3.3 R2580, 2. Aug. 2011

priint:comet InDesign® Plug-Ins, comet_pdf

static int install_image(
  int rsrcID,
  char* path,
  char* destination = 0,
  int results [12] = 0)

Install an image in the executing InDesign®. The image can be used by its ID as an icon in the Front Row panel or in the Product Pool.

The statement changes the priint:comet plugins of the executing InDesign®. The changes are only made locally. If you reinstall the priint:comet plugins, the changes will be lost.

For InDesigns® Server and comet_pdf the call has no effect and returns the general error 1.

Images are defined as PNG files with alpha channel. For the installation of an icon at least two images are required: One image for the dark background (UI) of InDesign® and one for the light background.

For rollovers or selected icons, separate icons can be defined. Additionally, each of these four icons can be displayed in three resolutions : standard (72 dpi), 150% resolution and High Resolution. So, one icon can thus consist of up to 12 images. If a rollover is missing, the normal image is used. If an image for the current resolution is missing, the standard resolution is used.

The following table shows the naming convention for the image files of the icon variants. The red marked cells indicate required files, all other files are optional (but desirable for a better appearance).

No special icons are used by InDesign® for the grey intermediate levels of its UI. Light grey uses the icons of the light UI, dark grey uses the icons of the dark UI. Unfortunately, this restriction also means that you can only use a very limited number of colors for your icons. Orange or green you will be able to see well on both black and white, but not on grey, etc. The sample image in the upper left corner of the table contains the colors we preferably used in our icons and which are sufficiently clearly visible on all background colours.

Name suffix Image size in Pixel
UI Resolution Normal Rollover Front Row Products
Dark Standard _D _DR 36 x 36 12 x 13
150% _hires150_D _hires150_DR 54 x 54 18 x 20
High _hires_D _hires_DR 72 x 72 24 x 26
Light Standard _L _LR 36 x 36 12 x 13
150% _hires150_L _hires150_LR 54 x 54 18 x 20
High _hires_L _hires_LR 72 x 72 24 x 26

Name Type Default Description
Return int   Fehlercode or 0

An error not equal to 0 means that the installation of at least one sub-icon failed. Specific error specifications for the variants are made in the parameter results.
rsrcID int - ID of the resource by which the image can be accessed. The ID must be >= 18000.
path String oder char* - Image path and base name of the images. The base name is given without any of the extensions declared in the table above. Using

   "$DESKTOP/aaa.png"

will look for the images

   "$DESKTOP/aaa_D.png"
   "$DESKTOP/aaa_DR.png"
   "$DESKTOP/aaa_hires150_D.png"
   ...

The images ~_D~.~ and ~_L.~ must be present. All other images are optional (but desirable). Please also note:
  • The images must be in PNG format and may contain alpha channels with grayscale.
  • Images are not scaled when inserted. You should therefore use the values in the above table for the images sizes.
  • When choosing colors, make sure that the images on both light and dark UIs are clearly visible.
  • Do not use icons that are too filigree. Use as simple and speaking pictures as possible!
destination String oder char* "frontrow" Aim of the installation

"frontrow" : Front Row
"products" : Produktrecherche
results int[12] 0 The int array must be 0 or at least 12 numbers big and contains the return codes for the individual icon variants in the order of the table above after return of the function.

prefs::install_image (18000, "$DESKTOP/Images/rocket.png");

v3.3 R2580, 2. Aug. 2011
Parameter destination and results seit v4.1.6 R26630, 10. Feb 2020

priint:comet InDesign® Plug-Ins

static int eps_import_options(
  int createPreview = -1,
  int createFrame = -1,
  float resolution = -1.0,
  int readOPI = -1)

Preference for reading EPS images. The priint:comet InDesign® Plug-Ins changing the InDesign® defaults to the following settings:

Name Type Default Description
Return int   Error code or 0
createPreview int -1 Create preview?

-1 : Leave untouched
0 : no
1 : if needed
2 : always
createFrame int -1 Create frame from clipping path, if EPS contains Photoshop clipping path?

-1 : Leave untouched
0 : no
1 : yes
resolution float -1.0 Preview resolution

<= 0.0 : Leave untouched
otherwise : dpi
readOPI int -1 Read embedded OPI comments - required to be on to perform OPI.

-1 : Leave untouched
0 : no
1 : yes

v3.3 R2718, 18. Nov. 2011

priint:comet InDesign® Plug-Ins

static int set_fitframe_precision(float prec)

Set the precision for frame::fit. frame::fit has an additional parameter for the precision of the resulting frame height since v3.3 R3728. If this value is smaller 0.00005, a global value is used for the precision. If this value is smaller 0.00005 too, the InDesign® standard method is used for fitting text frames.

On logout the value is resetted to 0.0 automatically.

Name Type Default Description
Return 0    
prev float 0.0 new global precision for frame::fit. The vakue is used only if frame::fit is called without a precision or a precision smaller 0.00005

<0.00005 use InDesign® standard method

v3.3 R3860, 11. Jun 2013

priint:comet InDesign® Plug-Ins, comet_pdf

frame::fit, get_fitframe_precision

static float get_fitframe_precision()

Currently used default precision for frame::fit.

Name Type Default Description
Return float   currently used default precision for frame::fit if frame::fit is called without a precision or a precision smaller 0.00005

v3.3 R3860, 11. Jun 2013

priint:comet InDesign® Plug-Ins, comet_pdf

frame::fit, set_fitframe_precision

static int enable_magnets(
  int state,
  int action,
  int cometGroupID = 0)

Dis/Enable the appliance of magnets.

Magnest are refreshed in the following situations:

Situation Description
kMagnetsPlaceholder After loading place holders
kMagnetsCScript Function call to frame::apply_magnets
kMagnetsBuildProducts Building and reorganizing products
kMagnetsToDoList Updating place holders using panel "ToDos"
kMagnetsChangeTemplate Change of template
kMagnetsLayoutRule Layoutrule "Update magnets"

All situations are activated by default after restarting InDesign®.

Name Type Default Description
Return int   old settings
state int kMagnetsAll State to change or ask?

kMagnetsPlaceholder : After loading place holders
kMagnetsCScript : Function call to frame::apply_magnets
kMagnetsBuildProducts : Building and reorganizing products
kMagnetsToDoList : Updating place holders using panel "ToDos"
kMagnetsChangeTemplate : Change of template
kMagnetsLayoutRule : Layoutrule "Update magnets"

kMagnetsAll : all
kMagnetsNothing : nothing
what int kMagnetsEnable What to do this the value?

kMagnetsEnable : Activate
kMagnetsDisable : Deactivate
kMagnetsToggle : Toggle
kMagnetsAsk : ask only
cometGroup int 0 In same rare cases you may wish to suppress magnets of a single Comet group while loading. Here you can define this groups. The blocker will reset on next idle time. If the values is != 0, the first two parameters are ignored.

#include "internal/types.h"

Activate all

prefs::enable_magnets (kMagnetsAll, kMagnetsEnable);

Update magnets after loading place holders?

if (bit_and (prefs::enable_magnets (kMagnetsAll, kMagnetsAsk), kMagnetsPlaceholder) == 0)
  wlog ("", "Suppress magnets after loading place holders\n");
else 
  wlog ("", "Apply magnets after loading place holders\n");

v3.3.1 R4330, 28.08.2913

cometGroupID since v3.4 R5200, 24. Feb 2014

priint:comet InDesign® Plug-Ins, comet_pdf

static int show_note_history(int state, int importMode)

State and behavior for showing the history of Comet notes. In the panel "Comet note" there is a check box Auto-prompt different comments. The statement will change this check box.
From R7277 3.4 and 4.0.4 also: set import mode. The optional 2nd parameter importMode controls the way, empty paragraphs are processed when importing notes.
The following values are valid:

Additionally, the flag kNotifyAutoFitNotes allows to fit note frames to the text content automatically.

Name Type Default Description
Return int   0
state int 2 0 : Do not show history prompt. This means, the check box is deselected and disabled.

1 : Always show history prompt. This means, the check box is selected but disabled.

2 : Ceck box is enabled and shows/changes the state of the first selected note in the document.
importMode int 0 import behaviour for empty paragraphs. Description see above.

#include "internal/types.h"

Convert empty paragraphs and auto fit note frames (e.g. in a login script)

int main ()
{
    prefs::show_note_history(1, kNotifyConvertEmptyParagraphs + kNotifyAutoFitNotes); 
    return 0;
}

v3.4 R5321, 8. May 2014

priint:comet InDesign® Plug-Ins

static int get_remove_old_masters()

Remove localized master page items on master page changes or not? The value equates to the menu

Plug-Ins -> Comet -%gt; Remove localized frames on master page changes

InDesign® does NOT remove localized master page frames after applying a new master page. This may lead to serioous erros esspacially while building products or reorganizing pages.

Imagine you have a master page frame F. Localize it! You will get frame F'. Then apply a different master page to this page. Now you have the new master frames AND the old localized frame F'. Set back the the master page back agian to the first item - oops, now you have F and F' on the page. This can not be okay, or?

Thats why the priint:comet InDesign® Plug-Ins removing localized master page frames after master page changes automatically. But in some rare circumstances one prefer the default InDesign® behavior. So you can turn off the Comet fix. Here you can get the current state of the behavior.

Name Type Default Description
Return int   0 : Do NOT remove localized master page items
1 : remove localized master page items
-1 : error

Toggle the current state for auto-removing localized master frames

int main ()
{
    int			remove	= prefs::get_remove_old_masters ();
wlog ("", "BEFORE : remove masters : %d\n", remove); prefs::set_remove_old_masters (!remove); wlog ("", "AFTER : remove masters : %d\n", prefs::get_remove_old_masters ());
return 0; }

v3.4 R5678, 10. Sep 2014

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_remove_old_masters(int state = 1)

Remove localized master page items on master page changes or not? Change the value of the menu

    Plug-Ins --> Comet --> Remove localized frames on master page changes

InDesign® does NOT remove localized master page frames after applying a new master page. This may lead to serioous erros esspacially while building products or reorganizing pages.

Imagine you have a master page frame F. Localize it! You will get frame F'. Then apply a different master page to this page. Now you have the new master frames AND the old localized frame F'. Set back the the master page back agian to the first item - oops, now you have F and F' on the page. This can not be okay, or?

Thats why the priint:comet InDesign® Plug-Ins removing localized master page frames after master page changes automatically. But in some rare circumstances one prefer the default InDesign® behavior. So you can turn off the Comet fix. Here you can get the current state of the behavior.

Name Type Default Description
Return int   -1 : error
otherwise : old state
state int 1 Remove localized master page frames or not?

0 : Do NOT remove
1 : Remove

Toggle the current state for auto-removing localized master frames

int main ()
{
    int			remove	= prefs::get_remove_old_masters ();
wlog ("", "BEFORE : remove masters : %d\n", remove); prefs::set_remove_old_masters (!remove); wlog ("", "AFTER : remove masters : %d\n", prefs::get_remove_old_masters ());
return 0; }

v3.4 R5678, 10. Sep 2014

priint:comet InDesign® Plug-Ins, comet_pdf

static int get_convert_quotas(int domain = 0)

Replace typographic quotas or not while importing tagged text?

Comet_pdf does not support automatic typographic quotas. The function therefor does not effect to the text import.

Name Type Default Description
Return int   kOn (= 1) : Yes, typographic quotas are used
kOff (= 2) : Nein
domain int kLocal kLocal : Local settings from the priint:comet InDesign® Plug-Ins
kGlobal : InDesign® setting from the Import Options dialog

#include "internal/types.h"

v3.4 R7022, 21. Nov 2014

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_convert_quotas(int state = 0, int domain = 0)

Replace typographic quotas (or not) while importing tagged text. You may change the settings locally only inside the priint:comet InDesign® Plug-Ins or in InDesign®. Local changes are valid only until you change the data connection. After changeing the data connection, the priint:comet InDesign® Plug-Ins using the InDesign® behavior by default again.

Comet_pdf does not support automatic typographic quotas. The function therefor does not effect to the text import.

Name Type Default Description
Return int   error code or 0
state int kSystem kSystem : Use InDesign® setting from the Import Options
kOn : replace into typographic quotas
kOff : import unchanged
domain int kLocal kLocal : Chang priint:comet InDesign® Plug-Ins behavior
kGlobal : Change InDesigns® Import Options

Local changes are resetted to kSystem after logout. Global changes are changing the behavior of ALL text imports!

#include "internal/types.h"
#include "internal/types.h"
int ttt (int doAll) { char txt [8000];
strcpy (txt, "%!TT12"); strcat (txt, ""); strcat (txt, ""); strcat (txt, ""); strcat (txt, ""); strcat (txt, "\""); strcat (txt, ""); strcat (txt, " Nagel");
textmodel::append ("\nSystem (pre)\t"); textmodel::append (txt);
if (!doAll) return 0;
prefs::set_convert_quotas (kOn); textmodel::append ("\nTypografic\t"); textmodel::append (txt);
prefs::set_convert_quotas (kOff); textmodel::append ("\nNo conversion\t"); textmodel::append (txt);
prefs::set_convert_quotas (kSystem); textmodel::append ("\nSystem (post)\t"); textmodel::append (txt);
return 0; }
int main () { int oldState = prefs::get_convert_quotas (kGlobal);
textmodel::append ("==== Local ===="); ttt (1);
textmodel::append ("\n\n==== Global no conversion ===="); prefs::set_convert_quotas (kOff, kGlobal); ttt (1);
textmodel::append ("\n\n==== Global typographic ===="); prefs::set_convert_quotas (kOn, kGlobal); ttt (1);
textmodel::append ("\n\n==== Back ===="); prefs::set_convert_quotas (oldState, kGlobal); prefs::set_convert_quotas (kSystem, kLocal); ttt (0);
return 0; }

v3.4 R7022, 21. Nov 2014

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_logstate(int what, int how)

Write additional log information. The log messages should be used especially for debugging.

With the menu command Plug-Ins -> Comet -> More Log Output you can switch on and off all additional log outputs.

Additional log messages should only be activated for a short time. Writing the messages can take a long time and significantly reduce performance. Very large log files may be involved. If additional log messages are written, confidential customer data can be written to the log file! The additional log messages are automatically switched off again after restarting InDesign >sup>®.

Name Type Default Description
Return int   Old state
what int - Which additional log information should be changed?

1 : Write log information about inserting TaggedText using textmodel::insert, textmodel::replace, ..., frame::insert, ... . Texts longer than 1,000,000 characters are shortened.

2 : Single steps of frame::fit and frame::fit_better
how int - News status

0 : Turn off
1 : Turn on
2 : what=1 only Write line delimiters as \n and \r

v4.0.4, 27. Okt 2015

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

static int enable_panel(
  int panelID,
  int state,
  char* signature)

Block Comet Admin panels. Calls to the function should preferably be made in the after-login script (panelstatement 92). After disconnecting the current data connection, all active locks are canceled.

The blocking of panels serves only to protect against unintentional changes of configuration data. Of course, we do not reveal how, but a reasonably skilled user can cancel the block at any time.

Locked panels can be opened further (or remain visible), but all controls are disabled. Important menus like updating placeholders in the placeholder panel are still available. Locked panels are marked with a wide text band:



The function needs the following include

#include "internal/panels.h"

Name Type Default Description
Return int   error code oder 0
panelID int - Class ID of panel or -1.

The following panels are supported:

kPanelProducts (3)
kPanelPreviews (6)
kPanelPageitems (8)
kPanelPageitemsBehavior (402)
kPanelPublications (9)
kPanelPublicationInfo (418)
kPanelToDoList (10)
kPanelPlaceholder (125)
kPanelPlaceholderValues (401)
kPanelPlaceholderValuesInfo (413)
kPanelPageTemplates (403)
kPanelPageElements (404)
kPanelCometAdmin (405)
kPanelTableModule (406)
kPanelTranslations (407)
kPanelLayoutRules (408)
kPanelFrameTags (409)
kPanelAreaBuild (410)
kPanelPriintAdjust (411)
kPanelPriintAdjustList (412)
kPanelFrontRow (414)
kPanelNotes (415)
kPanelPreviewDetails (416)
kPanelProductsOfDocument (417)
kPanelSettings (419)
kPanelCometTests (420)
kPanelURLLink (421)

-1 : all
state int - Lock state

0 : Block panel
1 : Enable panel
signature char* - Who blocked the panel?

The text is shown behind Panel blocked by and must not be empty and not longer than 255 characters. Unicode letters are encoded by <0x00FC>.
If this value starts with the '@' character, the prefix Panel blocked by is omitted.

#include "internal/panels.h"

This line will create the lock hint shown above:

prefs::enable_panel (kPanelPlaceholder, 0, "admin <0x2601><0x2665>.");

v4.1, 1. Mar 2018

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

static int enable_unicode_escapes(int state = -1)

Disable/Enable automatic conversion of Unicode escapes of the form \XXXX into Unicode letters if calls toConversion frame::replace, textmodel::replace, ... .

Conversion is enabled by default and is reset to this state on logout always.

Name Type Default Description
Return int   Current state

1 : Yes, convert Unicode escapes
0 : No
state int -1 Nwe state

1 : Yes, convert Unicode escapes
0 : No

int main ()
{
    int  oldState = prefs::enable_unicode_escapes (0);
frame::replace (gFrame, "\\\\TextModule\\Text5\\de8005.xml");
prefs::enable_unicode_escapes (oldState);
return 0; }

v4.1 R22423, 25. Apr 2018

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_updatetype(int update_type = 0)

Defining the method for handling or determining placeholder content.

Name Type Default Description
Return int   Error code or 0
update_type int 0 0 : Default behavior. Placeholders are loaded using the current data pool.

1 : Store data Placeholders are loaded using the current data pool.

After the data has been inserted into the document, the data is additionally stored in the current data folder:

If the placeholder is a cScript, the content of the char* variable gExportValue is used. The content must not be longer than 6 MB. Longer content leads to an InDesign® crash!

On Direct statements (select, get, ...) the content of the first column of the first result row is stored.

2 : Use update folder

Please note: The data folder does not have to contain data for all placeholders. But if it contains data for one placeholder, data for all products must be there.

v4.1 R23000, 8. May 2018

priint:comet InDesign® Plug-Ins, comet_pdf

get_updatetype, set_updatepath, get_updatepath

static int get_updatetype()

Get the current placeholder load behavior.

Name Type Default Description
Return int   0 : Default behavior. Placeholders are loaded using the current data pool.

1 : Store data Placeholders are loaded using the current data pool.

After the data has been inserted into the document, the data becomes additional stored in the current data folder:

If the placeholder is a cScript, the content of the char* variablegExportValue is used. The content must not be longer than 6 MB. Longer content leads to an InDesign® crash!

On Direct statements (select, get, ...) the content of the first column of the first result row is stored.

2 : Use update folder

Please note: The data folder does not have to contain data for all placeholders. But if it contains data for one placeholder, data for all products must be there.

v4.1 R23000, 8. May 2018

priint:comet InDesign® Plug-Ins, comet_pdf

set_updatetype, set_updatepath, get_updatepath

static int set_updatepath(char* newpath, int askFor = 0)

Set the update folder for placeholder loadings.

The data folder is used only if update type 2 ("use data") is set, see set_updatetype.

Name Type Default Description
Return int   Error code or 0
newpath char* oder String - Complete path to a valid update folder
askFor int 0 Use dialog to ask for the folder?

0 : No
1 : Yes, open folder selection dialog

v4.1 R23000, 8. May 2018

priint:comet InDesign® Plug-Ins, comet_pdf

set_updatetype, get_updatetype, get_updatepath

static char* get_updatepath()

Get the path to current update folder for placeholder loadings.

Name Type Default Description
Return char*   Complete path to the current update folder for placeholders loadings.

The return value is read only, do NOT CHANGE. The result will be overridden on following calls to the function. Learn more about functions returning r/o char* values.

v4.1 R23000, 8. May 2018

priint:comet InDesign® Plug-Ins, comet_pdf

set_updatetype, get_updatetype, set_updatepath

static int set_urllink_timeout(float newTimeout)

Set the timeout for connecting to a URL of a Web Image. The function only sets the timeout for the connection. The duration of the downloads remains unlimited.

The internal work for Web Images is done by a software called CURL. There is a default timeout for establishing the connection of 300 seconds. This is a bit long for checking and updating Web Images. We therefore set a timeout of 3 seconds, which you can change yourself using the function set_urllink_timeout.

Alternatively, the timeout for the connection can also be defined by request-timeout in your soapflags.ini.

Name Type Default Description
Return int   Error code or 0
newTimeout float - Timeout for connecting for Web Images in seconds.

<= 0.0 : 3.0 seconds
sonst : Timeout in seconds

Attention: It'a a float, not an integer!

v4.1 R25346, 25. June 2019

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

static int set_urllink_folder(char* path)

Set the fallback folder for Web Image downloads.

Please note, the function is a workaround for the missing implementation for panelstatement 141 in older versions of ISON/Pubserver. Usually you can find the script here:

    

See here for more information about image caching!

The path set by this function is only used if panelstatement 141 is empty and is reset to "" on logoff time always!

Name Type Default Description
Return int   Error code or 0
path String or char* - New fallback path for Web Image downloads

v4.1.6 R25445, 2. July 2019

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

get_urllink_folder, Web Image download folder

static char* get_urllink_folder()

Get the currently set fallback folder for Web Image downloads, see set_urllink_folder.

Name Type Default Description
Return char*   Currently used fallback folder for Web Image downloads.

The return value is read only, do NOT CHANGE. The result will be overridden on following calls to the function. Learn more about functions returning r/o char* values.

v4.1.6 R25445, 2. July 2019

priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

set_urllink_folder, Web Image download folder

static int get_xml_parsertype()

Which XML parser is used for reading XML? The setting is used globally for all XML files. The return value of the function corresponds to the program setting Plug-Ins -> Comet -> XML Parser in InDesign®, the program option -cometxmlparser in InDesign® Server resp. the program options -r or --xmlread in comet_pdf.

An XML parser is the part of the program that reads XML text and the content into internal data structures, the so-called XML trees (see here).

More information about the XML-Parser type can be found here

Name Type Default Description
Return int   Cuurently sed pasrer for reading XML

-1 : Error in determination

1 : Classic Windows : msxml, Mac : built-in CoreFoundation-Parser CFXMLParser

2 : Optimized Under Windows the setting is the same as 'Classic'. Under Mac, it fixes a bug in the CoreFoundation parser that caused &lt;...&gt; in running text to be interpreted as separate entities and all white spaces before and after this part of the text are lost. With 'Optimized' whitespaces around Unicode characters of the form <0xXXXX> are protected.
WARNING: Only entities of type <0xXXXX> are considered! In the Tagged Text "aaa<cSize:72.000000> <cSize:>bbb" the space between aaa and bbb is still lost.

3 : Fast In th plug-ins and in comet_pdf integrated fast and system-independent XML parser. The parser is about 50% faster than the CoreFoundation parser and msxml.

v4.1.6, R25445, 10. July 2019

priint:comet InDesign® Plug-Ins, comet_pdf

set_xml_parsertype, xmlquery

static int set_xml_parsertype(int newType)

Set the type of XML parser to be used for reading XML. The setting of the function corresponds to the program setting Plug-Ins -> Comet -> XML Parser in InDesign®, the program option -cometxmlparser in InDesign® Server resp. the program options -r or --xmlread in comet_pdf.

An XML parser is the part of the program that reads XML text and the content into internal data structures, the so-called XML trees (see here).

More information about the XML-Parser type can be found here

The setting is reset to the parser type previously defined in the program when the current data connection is disconnected.

Name Type Default Description
Return int   Error code or 0
newType int - Which parser should be used when reading XML?

-1 : Error in determination

1 : Classic Windows : msxml, Mac : built-in CoreFoundation-Parser CFXMLParser

2 : Optimized Under Windows the setting is the same as 'Classic'. Under Mac, it fixes a bug in the CoreFoundation parser that caused &lt;...&gt; in running text to be interpreted as separate entities and all white spaces before and after this part of the text are lost. With 'Optimized' whitespaces around Unicode characters of the form <0xXXXX> are protected.
WARNING: Only entities of type <0xXXXX> are considered! In the Tagged Text "aaa<cSize:72.000000> <cSize:>bbb" the space between aaa and bbb is still lost.

3 : Fast In th plug-ins and in comet_pdf integrated fast and system-independent XML parser. The parser is about 50% faster than the CoreFoundation parser and msxml.

v4.1.6, R25445, 10. July 2019

priint:comet InDesign® Plug-Ins, comet_pdf

get_xml_parsertype, xmlquery

static int get_transform_settings(
  int* changeScaleFactor = 0,
  int* scaleStrokes = 0,
  int* scaleEffects = 0)

Get the current InDesign® program settings for frame scalings General : Object Editing : When Scaling.

Name Type Default Description
Return int   Error code or 0
changeScaleFactor int* 0 Option Adjust Scaling percentage activated?
scaleStrokes int* 0 Option Include Stroke Weight activated?
scaleEffects int* 0 Option Include Effects activated?

v4.1.6, R25679, 2. Sept. 2019

priint:comet InDesign® Plug-Ins, comet_pdf

static int set_transform_settings(
  int changeScaleFactor = -1,
  int scaleStrokes = -1,
  int scaleEffects = -1)

Set the current InDesign® program settings for frame scalings General : Object Editing : When Scaling.

Using comet_pdf the function has no meaning!

Name Type Default Description
Return int   Error code or 0
changeScaleFactor int -1 Change option Adjust Scaling percentage

0 : Turn off
1 : Turn on
-1 : Leave untouched
scaleStrokes int -1 Change option Include Stroke Weight

0 : Turn off
1 : Turn on
-1 : Leave untouched
scaleEffects int -1 Change option Include Effects

0 : Turn off
1 : Turn on
-1 : Leave untouched

v4.1.6, R25679, 2. Sept. 2019

priint:comet InDesign® Plug-Ins, comet_pdf

This class has no child classes.

Since
Version 3.1, R1760, 25. Feb. 2010

Alphabetic index HTML hierarchy of classes or Java