Configure the CpMillUnitLibrary resource

Complete the steps in this procedure to create a unit library.

Unit libraries are JavaScript modules that CpMill calls at certain known times while processing a document (for example, begin document, page start, and page end). The modules can modify the contents of the document, extract information from the document, write the document, or parts of it, to a new location, or perform many other operations. For more information on configuring unit libraries, contact Support.

  1. In the Configure Unit Library dialog box, enter the unit library Name, Description, and any Comments.
  2. In the Document Properties Needed list, select the document properties needed by the unit library.
    These properties will be written to a file called <filename>.properties when Output Manager calls the document modification software. This file can be opened and read in by the unit library.
  3. In the Filters Needed list, select the filters needed for the unit library.
    Tips on selecting filters:
    • Select any expected input types and output types
    • If any interim data types are to be used in the script, include those types as well
    • It is recommended to include the NUL file type
    These filters will be written to a temporary location which will be sent to the document modification software.
  4. If you want to import the unit resource data, under Import Resource Data, click Browse and select the appropriate resource file. Specify the Code page to be used with the resource data.
    The resource data will display in the Unit box.
  5. Under Unit, specify the unit library. Enter the unit library code within the <script> </script> tags in the appropriate event handler sections.
    Review the default comments of a new unit library for descriptions of the parameters sent from Output Manager to the unit library and information about how to tell Output Manager about the documents modified or created by the unit library.
  6. If necessary, click Reload Variables from Unit to populate the Output variables grid with any output variables defined in the unit library.
  7. Click OK.