streamserve persuasion sp4 document sorting and bundling

36
StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Upload: leque

Post on 09-Dec-2016

256 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: StreamServe Persuasion SP4 Document Sorting and Bundling

StreamServe Persuasion SP4 Document Sorting and Bundling

User GuideRev A

Page 2: StreamServe Persuasion SP4 Document Sorting and Bundling

StreamServe Persuasion SP4 Document Sorting and Bundling User GuideRev A© 2001-2009 STREAMSERVE, INC.ALL RIGHTS RESERVEDUnited States patent #7,127,520

No part of this document may be reproduced or transmitted in any form or by any means, electronic ormechanical, for any purpose, without the express written permission of StreamServe, Inc. Information in thisdocument is subject to change without notice. StreamServe Inc. assumes no responsibility or liability for anyerrors or inaccuracies that may appear in this book. All registered names, product names and trademarks ofother companies mentioned in this documentation are used for identification purposes only and areacknowledged as property of the respective company. Companies, names and data used in examples in thisdocument are fictitious unless otherwise noted.

StreamServe, Inc. offers no guarantees and assumes no responsibility or liability of any type with respect tothird party products and services, including any liability resulting from incompatibility between the third partyproducts and services and the products and services offered by StreamServe, Inc. By using StreamServeand the third party products mentioned in this document, you agree that you will not hold StreamServe, Inc.responsible or liable with respect to the third party products and services or seek to do so.

The trademarks, logos, and service marks in this document are the property of StreamServe, Inc. or otherthird parties. You are not permitted to use the marks without the prior written consent of StreamServe, Inc.or the third party that owns the marks.

Use of the StreamServe product with third party products not mentioned in this document is entirely at yourown risk, also as regards the StreamServe products.

StreamServe Web Sitehttp://www.streamserve.com

Page 3: StreamServe Persuasion SP4 Document Sorting and Bundling

3

Contents

About document sorting and bundling...........................................................5

Sorting documents ...........................................................................................7Enabling document sorting ................................................................................9Defining a document trigger ...............................................................................9Defining a sort key...............................................................................................9

Enveloping ......................................................................................................11Enabling enveloping of documents .................................................................15Defining a document trigger .............................................................................15Defining a mailing machine ..............................................................................15Including several documents in an envelope .................................................16Splitting a document into more than one envelope........................................16Limiting the number of envelopes to a recipient ............................................17Counting inserts ................................................................................................17

Retrieving information about documents.....................................................19Adding a document sorting and bundling script ............................................21

Generating statistics reports.........................................................................23Adding a document sorting and bundling script ............................................24

OMR .................................................................................................................25Defining an OMR code.......................................................................................26

STD strokes ...................................................................................................... 28Bar functions..................................................................................................... 28OMR examples ................................................................................................. 30

Labels ..............................................................................................................33Defining a label ..................................................................................................34

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 4: StreamServe Persuasion SP4 Document Sorting and Bundling

4

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 5: StreamServe Persuasion SP4 Document Sorting and Bundling

5

About document sorting and bundling

You can • sort processed documents according to any variable specified in the

StreamServe Project.• bundle processed documents into envelopes, according to any variable

specified in the StreamServe Project. You can send the documents to different mailing machines depending on the maximum number of sheets per envelope that each machine can handle. This enables you to optimize the number of sheets in each envelope based on postal fees and other distribution costs.

• define OMR marks to be printed on the sheets, enabling a mailing machine to for example identify the first and last pages in a document.

• define labels to be printed on the sheets, displaying for example the mailing machine that handled the sheet.

• retrieve statistics about post-processed documents, for example how many documents are directed to a specific connector or mailing machine folder. You can insert extra pages, and split output data depending on specific criteria, for example postal codes.

Note: You can not use the HTML output connector when post-processing documents. To create HTML output, use a File output connector and the HTML driver.

Sorting and bundling scenarioIn the scenario for the Post-processor repository, a set of documents was retrieved from the Post-processor repository. See StreamServe Post-processor repository documentation.This set of documents is split up and directed to two folders, one where an output file is created for the documents that can be included in an envelope for maximum seven pages, and one for documents that need bigger envelopes. In each output file, the documents are sorted according to the customer ID to allow all documents bound for a customer to be included in the same envelope.The invoices are sorted according to the postal code of the customers to reduce postal fees.OMR codes that identify the first and last sheet of each envelope are defined and printed onto the sheets, allowing the enveloping machine to put the sheets into one envelope per customer.A page number and the total number of pages is printed onto the document sheets.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 6: StreamServe Persuasion SP4 Document Sorting and Bundling

6About document sorting and bundling

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 7: StreamServe Persuasion SP4 Document Sorting and Bundling

7

Sorting documents

You can sort documents within an output job according to any variable defined in the Project. If the documents to be sorted are retrieved from the Post-processor repository, the sorting variable must be specified as metadata when storing the documents. The Key and Type values in the sort key configuration must be identical to the values that you have specified for the metadata. See StreamServe Post-processor repository documentation.If the documents to be sorted are not retrieved from the Post-processor repository, you must specify a document trigger. See Defining a document trigger on page 9.

Enabling document sortingTo sort documents, you must enable the Document Broker. The Document Broker stores documents temporarily until the entire job is received, sorts documents according to one or more variables that you specify, and forwards documents for further processing. You can temporarily disable document sorting without removing the sorting settings.See Enabling document sorting on page 9.

Sort keyTo sort documents, you must define at least one sort key.See Defining a sort key on page 9.

Defining additional sort keysIf the sort key to be used was not known when storing the data in the repository, you can define the variable to use as a sort key using scripting.The DeclareMetadata script function specifies a metadata name to be used for sorting or bundling of documents. The metadata name can then be associated with a variable by for example using the following functions:SetCurrMetadata – sets the metadata value on the current document.SetSegMetadata – sets the metadata value on a specified document.You can then sort the documents in the current segment by using the SortSegDoc script function:Note: If you do not use enveloping the whole input job is one segment.

Example 1 Job begin script

$ret = DeclareMetadata(“zip”, “N”; “A”)

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 8: StreamServe Persuasion SP4 Document Sorting and Bundling

8Sorting documents

Example 2 Post-processor Job begin script

$doc_id = getFirstSegDoc();

while (num($doc_id) > 0)

{$zip = “1234”

$setSegMetaData($doc_id, “zip”, $zip);

$doc_id = GetNextSegDoc($doc_id);}

See the Scripting reference.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 9: StreamServe Persuasion SP4 Document Sorting and Bundling

Enabling document sorting 9Sorting documents

Enabling document sorting1 In the Runtime window, open the output connector settings.2 Click Global Settings.3 On the Post-processing tab, select Enable Document Broker.

Defining a document triggerNote: Only when documents are not retrieved from the Post-processor

repository.

1 In the Runtime window, open the output connector settings.2 Click Document Trigger

3 Specify a Document trigger variable that defines a document. For example $invoice_no

4 Click OK.

Defining a sort key1 In the Platform window, open the output connector settings.2 In the File field, enter the path to the output file, relative to the export

directory. For example \out\sort.afp3 In the Runtime window, open the output connector settings.4 Click Job End and select the Document Sort tab.5 Click Add and enter the values.6 Click OK.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 10: StreamServe Persuasion SP4 Document Sorting and Bundling

10 Defining a sort keySorting documents

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 11: StreamServe Persuasion SP4 Document Sorting and Bundling

11

Enveloping

You can prepare the documents for enveloping. You can use any variable specified in your StreamServe Project, such as the customer ID, to define which documents to bundle into the same envelope.Note: If the documents to be enveloped are retrieved from the Post-processor

repository, the envelope variable must be specified as metadata when storing the documents. See StreamServe Post-processor repository documentation.

You can specify OMR codes to enable a mailing machine to identify for example the first and last pages in an envelope.See OMR on page 25.You configure the enveloping options in the Runtime settings for a File output connector that uses Job output mode.If the documents to be enveloped are not retrieved from the Post-processor repository, you must specify a document trigger. See Defining a document trigger on page 15.

Enabling envelopingTo bundle documents into envelopes, you must enable enveloping on the output connector. You can temporarily disable enveloping without removing the settings from the Document Sort tab.See Enabling enveloping of documents on page 15

Mailing machineYou define a mailing machine by specifying a name and the maximum number of sheets per envelope that the mailing machine can handle.If it is possible an envelope can contain more sheets than your mailing machines can handle, you must do at least one of the following:• Define a mailing machine with unlimited number of sheets per envelope.

This will require manual handling of the envelopes.• Enable the splitting of documents into several envelopes. See Dividing a

document into multiple envelopes on page 13.You can include several documents in the same envelope. See Including several documents in an envelope on page 16.To sort the documents within an envelope, see Sorting documents on page 7.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 12: StreamServe Persuasion SP4 Document Sorting and Bundling

12Enveloping

SegmentsUsing enveloping, the input job is split into separate output units, or segments, that are sent to the specified mailing machines. The segment that is bound for a specific mailing machine can be split into smaller segments if you want a printer start working before the whole job is processed.

Output file pathThe path to the output file must be specified as <folder>/<file>, where <folder> can include the %{TARGET} variable and <file> can include the %{SEGMENT} variable.

When the output file is created, the %{TARGET} variable is replaced by the name of the mailing machine used for enveloping the documents in this segment. If you configure the segment to be split into smaller parts, the %{SEGMENT} variable is replaced by a number that increases for each new segment file that is created.The file name must have an extension according to the output file format, for example .afp.

Example 1 Example of an output file path

target_%{TARGET}/segment_%{SEGMENT}.afp

Including multiple documents in an envelopeYou can include all documents with, for example, the same customer ID in the same envelope. If you have specified an enveloping machine but no envelope, each document is included in a separate envelope. You must define an envelope to include several documents in one envelope.See Including multiple documents in an envelope on page 12.If the documents to be enveloped are retrieved from the Post-processor repository, the variable to use as envelope key must be specified as metadata when storing the documents. The Key and Type values in the envelope key configuration must be identical to the values that you specified for the metadata.See the Post-processor repository documentation.If you do not use the Post-processor repository, the envelope key can be any variable defined in the Project.

Minimizing manual handlingAll documents that match an envelope definition are included in one envelope by default. If the total number of sheets in the documents exceeds the maximum number of sheets for the available envelopes, the documents are sent to manual handling.If you specify the Minimize manual handling option, the documents are sorted into several envelopes, which reduces manual handling. See Example 2 on page 13.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 13: StreamServe Persuasion SP4 Document Sorting and Bundling

13Enveloping

Example 2 Minimizing manual handling

In this example, documents with a maximum of seven sheets are sent to Mailing Machine 1, documents with eight to 15 sheets are sent to Mailing Machine 2, and documents with more than 15 sheets are handled manually.The envelope definition allows all documents with the same customer ID to be sorted into the same envelope.Suppose that you have a job with three documents, each containing six sheets, where all documents have the same customer ID.• If you select Minimize manual handling, there are two envelopes, one

envelope with two documents (12 sheets) and one envelope with one document (six sheets).

• If you do not select Minimize manual handling, all 18 sheets are sent to manual handling.

Dividing a document into multiple envelopesIf a document does not fit into one envelope, you can divide the documents into several envelopes. If a document is divided into several envelopes, the address associated with the document must be printed on the first sheet of each envelope. You can achieve this by either:• Producing page-formatted data where all pages contain the address.• Repeating the page that contains the address for each envelope.• Inserting a pre-defined address page for each envelope.See Splitting a document into more than one envelope on page 16.

Limiting the number of envelopes per recipientYou can limit the number of envelopes sent to each recipient. If this number is exceeded, envelopes have to be handled manually.Before you can limit the number of envelopes, you must:• Define a mailing machine with an unlimited number of sheets per envelope.• Select the Minimize manual handling or Allow document splitting

options. See Splitting a document into more than one envelope on page 16.See Limiting the number of envelopes to a recipient on page 17.

Counting insertsPre-printed sheets, for example marketing material, can be included in the envelopes in addition to the standard documents. You can take these inserts into account when calculating the total number of sheets that fit in one envelope. See Example 3 on page 18.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 14: StreamServe Persuasion SP4 Document Sorting and Bundling

14Enveloping

If the inserts are printed on different paper quality than the sheets used for the standard documents, you must specify the weight equivalents for the insert sheets to correctly count the total sheet number. A weight equivalent is the insert sheet weight divided by the standard sheet weight. For example, the insert equivalent for an insert that is printed on a sheet weighing twice the standard sheet is 2.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 15: StreamServe Persuasion SP4 Document Sorting and Bundling

Enabling enveloping of documents 15Enveloping

Enabling enveloping of documents1 In the Runtime window, open the connector settings for the output

connector to be used.2 Click Global Settings.3 On the Post-Processing tab, select Enable Document Broker.

Defining a document triggerNote: Only when documents are not retrieved from the Post-processor

repository.

1 In the Runtime window, open the output connector settings.2 Click Document Trigger

3 Specify a Document trigger variable that defines a document. For example $invoice_no

4 Click OK.

Defining a mailing machine1 In the Platform window, open the connector settings for the output

connector.2 In the File field, enter the path to the output file, relative to the export

directory. For the syntax of this path, see Including several documents in an envelope on page 16.

3 Click OK.4 In the Runtime window, open the output connector settings.5 Click Job End and select the Enveloping tab.6 Click Add and enter the options.7 Click OK.

Mailing machine settings

Mailing machine name

The name of the mailing machine. This name substitutes %{TARGET} in the File destination path specified for the connector, see Output file path on page 12.

Maximum sheets per envelope

The maximum number of sheets that can be put into one envelope by the mailing machine.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 16: StreamServe Persuasion SP4 Document Sorting and Bundling

16 Including several documents in an envelopeEnveloping

Including several documents in an envelope1 In the Runtime window, open the connector settings for the output

connector to be used within the Job context.2 Click Job End and select the Enveloping tab.3 Click Define envelope.4 Click Add and enter the options. 5 Optionally, select Minimize manual handling. See Splitting a document

into more than one envelope on page 16.6 Click OK.

Splitting a document into more than one envelope

1 In the Runtime window, open the output connector settings.2 Click Job End and select the Enveloping tab.3 Click Advanced. The Advanced Enveloping dialog opens.4 Enter the appropriate settings and click OK.

Define maximum sheets per segment

If you have large jobs, you can divide the output file into segments. This means a printer can start printing when a segment is created, instead of waiting until the whole job is created in a single file.You can define the maximum number of sheets per segment. You can also let the last segment contain more sheets than the other segments, to avoid that the last segment will contain very few sheets.Note: The sheets in a document are always contained

within the same segment.

Mailing machine settings

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 17: StreamServe Persuasion SP4 Document Sorting and Bundling

Limiting the number of envelopes to a recipient 17Enveloping

Limiting the number of envelopes to a recipient

1 In the Runtime window, open the output connector settings.2 Click Job End and select the Enveloping tab.3 Click Advanced. The Advanced Enveloping dialog opens.4 Select Limit envelope count.5 Enter a value in the Max envelopes per recipient box, and click OK.

Counting inserts1 In the Runtime window, open the output connector settings.2 Click Job End and select the Enveloping tab.3 Click Advanced. The Advanced Enveloping dialog opens.

4 Enter the appropriate settings and click OK.

Advanced Enveloping settings (Document splitting)

Allow document splitting Simple – No address page is added to the envelopes.The address must be included on all logical pages produced by the PageOUT Process to use this option.Copy address page – The first page of the document is duplicated and put into each envelope.Insert address page – Inserts a new address sheet in each envelope, except in the first envelope. The address sheet must be available as an overlay in the resource set. Select the overlay to be used for the address sheet.

Define address sheet layout

If you select Copy address page or Insert address page, you can define the layout to use for the address pages.

Advanced Enveloping settings (Count inserts)

Count inserts Select to activate the options below.

Define insert equivalents

Select a table resource which specifies the weight equivalency between an insert and a standard sheet used for the pages within the documents. See Weight equivalents table on page 18.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 18: StreamServe Persuasion SP4 Document Sorting and Bundling

18 Counting insertsEnveloping

Example 3 Counting inserts

A mailing machine can handle envelopes with up to seven sheets. A document contains seven sheets, and an insert will be included in each envelope.If you specify to count inserts the document is handled by another mailing machine that can handle more than seven sheets per envelope, or the document must be handled manually.

Weight equivalents tableThe table must contain two tab separated columns.The first column lists insert trays defined in the Insert mask option on the OMR settings, see Defining an OMR code on page 26.The second column lists the weight equivalents for each insert. The maximum value is 16.See Example 4 on page 18.Note: Inserts that are not listed in the weight equivalents table have equivalents

equal to 1.

Example 4 Weight equivalents table

//!CodePage UTF8!

1 2

3 0.5

5 1.5

Optimize inserts Select to avoid that a recipient receives more than one insert of the same type.

Advanced Enveloping settings (Count inserts)

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 19: StreamServe Persuasion SP4 Document Sorting and Bundling

19

Retrieving information about documents

You can retrieve data about the documents that will be sorted and bundled. For example you can retrieve metadata for a document, the number of sheets in a document, or the number of documents in an envelope. This information can be used as criteria for different processing options for the documents in a specific segment. For example, you can add or skip a specific page depending on the invoice number, or split the input job into two output files, where each file contain documents with a specific range of number of pages.For an example of how to divide output depending on number of pages in the documents, see Example 5 on page 20

Retrieving information about documentsYou retrieve data about the documents by using document sorting and bundling scripting functions. For example:GetPPMetadata – returns the value of a metadata for a specific document, for example the invoice number.

GetSegMetadata – returns the value of a metadata for a specific document within the segment, for example the invoice number.GetPPDocProperty – returns the value of a specified property for a document, for example the number of logical pages in the document.GetEnvelNr – returns the envelope number that a document is included in.GetSegment – returns the segment number that a document and an envelope are included in.IsFirstPageInEnvelope – returns information about whether or not the current page is the first page in the envelope.

Taking action based on the retrieved informationYou can perform actions on the documents or parts of the documents using scripting functions. For example:NextPage – skips the rest of the current page and processes next page.NextDoc – skips the rest of the current document and processes the next document.NextSegment – skips the rest of the current segment and processes the next segment.InsertPage – inserts a page in the current document.FlushOutput – sends parts of the job to the output connector even if the job is not completed.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 20: StreamServe Persuasion SP4 Document Sorting and Bundling

20Retrieving information about documents

SetDestPath – sets a destination path, and optionally, a file name.To add a document sorting and bundling script, see Adding a document sorting and bundling script on page 21.For more information on document sorting and bundling scripting functions, see the Scripting reference.

Example 5 Document sorting and bundling script on Job begin for splitting output

$doc_index = GetFirstDoc();

$PageCount = 0;

while(num($doc_index) > 0)

{$PageCount = num($pageCount) + num(GetPPDocProperty($doc_index, "pages"));

$doc_index=GetNextPPDoc($doc_index);}

if(num($PageCount) > 5)

{$filename = "./out/big.pcl";}

else

{$filename = "./out/small.pcl";}

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 21: StreamServe Persuasion SP4 Document Sorting and Bundling

Adding a document sorting and bundling script 21Retrieving information about documents

Adding a document sorting and bundling script

1 In the Runtime window, right-click a Process and select Connector Settings.

2 Click Global Settings.3 On the Post-Processing tab, select Enable Document Broker.4 Right-click the level where you want to add the script and select Script. The

Script editor opens.5 If you use scripting on Process begin or Page begin, select if the script will

be executed before or after the Process or Page is being processed.6 Edit the script and click OK.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 22: StreamServe Persuasion SP4 Document Sorting and Bundling

22 Adding a document sorting and bundling scriptRetrieving information about documents

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 23: StreamServe Persuasion SP4 Document Sorting and Bundling

23

Generating statistics reports

You can retrieve and report information about documents to be post-processed. The information can be written to a separate file or a repository. You must use scripting to retrieve and report the information. For example, you can use the following script functions to retrieve statistics information:• GetEnvelNr

• GetMailMachine

• ConnectorPageActual

Note: The GetDocSheetCount function can only be used if you have specified a mailing machine. See Defining a mailing machine on page 15.

To write or store the retrieved information you can, for example, use the following script functions:• FileOpen

• FileWrite

• ODBCConnect

• ODBCExecute

Note: To use Post-processor scripting to insert or skip pages, you must specify a sort variable or a mailing machine.

Example 1 Script that generates number of sheets per mailing machine

$mailmachine = "Sheets to mailingmachine" + "<20>" + GetMailMachine() + "<3a><20>";

$pagecount = ConnectorPageActual();

fileopen("Statistics\pagecount.txt","a");

filewrite("Statistics\pagecount.txt",$mailmachine + $pagecount + "<0d><0a>" + "<0d><0a>");

This can result in the following rows in the statistics file:Sheets to mailingmachine Invoice: 24

Sheets to mailingmachine Overflow: 16

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 24: StreamServe Persuasion SP4 Document Sorting and Bundling

24 Adding a document sorting and bundling scriptGenerating statistics

Adding a document sorting and bundling script

1 In the Runtime window, right-click a Process and select Connector Settings.

2 Click Global Settings.3 On the Post-Processing tab, select Enable Document Broker.4 Right-click the level where you want to add the script and select Script. The

Script editor opens.5 If you use scripting on Process begin or Page begin, select if the script will

be executed before or after the Process or Page is being processed.6 Edit the script and click OK.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 25: StreamServe Persuasion SP4 Document Sorting and Bundling

25

OMR

OMR (Optical Mark Reader) codes are a set of strokes that can be used, for example, by an enveloping machine to identify the first and last pages in a document. Depending on the requirements of the enveloping machine, you can define:• Standard OMR codes (STD)• Generic OMR codes• Bar codes (where the strokes in an OMR code definition can have different

thicknesses)You can add one or more OMR codes to a document. You specify the OMR code definition at Job begin or Document begin. Definitions specified at Document begin override definitions at Job begin.Note: If you use constant values for the OMR code, add the OMR code at Job

begin only, for performance reasons.

You configure the OMR options in the Runtime settings for an output connector that uses Job output mode.

Standard strokesSTD OMR codes use standard strokes, i.e. each stroke position in the code has a predefined meaning.See STD strokes on page 28.

Bar functionsBy defining a generic OMR code or a bar code, you can use bar functions at any stroke position in the OMR code.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 26: StreamServe Persuasion SP4 Document Sorting and Bundling

26 Defining an OMR codeOMR

Defining an OMR code1 In the Platform window, open the connector settings for the File output

connector to be used.2 In the File field, enter the path to the output file, relative to the export

directory, for example \out\jobwithomr.afp3 In the Runtime window, open the connector settings for the output

connector to be used within the Job context.4 Click Document Trigger.

5 Set a Document trigger variable that defines a document, for example invoice_no

6 Click Job Begin and select the OMR tab.7 Click Add and enter the parameters.8 Click OK.

OMR settings

Name The OMR code name. This is only used as an internal reference.Only the first OMR code of two or more OMR codes with identical names is printed. An OMR code defined on both Job begin and Document begin will be printed only on Job begin.

Type The OMR code type.For STD, STDH, and STDE OMR types, see STD strokes on page 28.For the GEN1, INT2OF5, and CODE39 OMR types, you can define the OMR by using bar functions, see Bar functions on page 28.

X (mm) The absolute horizontal position of the OMR code (0 is left).

Y (mm) The absolute vertical position of the OMR code (0 is top).

Rotation (degrees) The rotation of the OMR code.

Side The side of the sheet where the OMR code is placed.

Bar functions Functions representing bar strokes (used only for GEN1, INT2OF5 and CODE39)See Bar functions on page 28.

Low sequence The sequence start value.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 27: StreamServe Persuasion SP4 Document Sorting and Bundling

Defining an OMR code 27OMR

For the OMR type specific attributes, refer to the corresponding barcode specification.

High sequence The highest value in sequence.

Sequence order The sequence order. None is Ascending.

Insert mask By setting this option, inserts can be included in envelopes depending on the OMR type. You can use a maximum of 31 insert trays, so you can enter an integer from 0 to (232-1) since the value is used as a binary mask. For example, 13=1101 means that inserts 1,3 and 4 are used for the documents within the job.

ON value The value that indicates that a specific stroke is printed, normally 1.

Bar height (mm) The height of the OMR code in millimeters.

OMR settings

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 28: StreamServe Persuasion SP4 Document Sorting and Bundling

28 Defining an OMR codeOMR

STD strokes

Bar functionsThe following bar functions can be used for the GEN1, INT2OF5 and CODE39 OMR types.

Stroke position

Value Explanation

1 1 Synchronization

2 0 Space, double row-distance

3 1 Read control

4 Seq1 1st bit of the sequence

5 Seq2 2nd bit of the sequence

6 Seq4 3rd bit of the sequence

7 Seq8 4th bit of the sequence

8 notlast 1 – if the sheet is not the last one.0 – if the sheet is the last one.

9 last 1 – if the sheet is the last one.0 – if the sheet is not the last one.

10 0 Call slave – this stroke is not supported by StreamServe, always 0.

11 Ins1 1st bit of insert mask

12 Ins2 2nd bit of the insert mask

13 Ins3 3rd bit of the insert mask

14 Ins4 4th bit of the insert mask

15 Parity 1 – if the sum of strokes with value 1 is even0 – if the sum of strokes with value 1 is odd.

Only for STDE and STDHE

16 1 Extra bit at the end.

Barfunction Description

1 Bar is printed.

0 Bar is not printed.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 29: StreamServe Persuasion SP4 Document Sorting and Bundling

Defining an OMR code 29OMR

seqN N=1,2,3,4,... A bar is printed depending on the binary representation of the sequence. See Example 2 on page 31.

insN N=1,2,3,4... A bar is printed depending on binary representation of the insert mask. For example, if Insert mask is set to 10, which is 1010 in binary representation, it means that ins2 and ins4 are available to use as inserts for the job. The maximum value of N is 31.

firstpage A bar is printed if it is the first page in the document.

notfirstpage A bar is printed if it is not the first page in the document.

lastpage A bar is printed if it is the last page in the document.

notlastpage A bar is printed if it is not the last page in the document.

$variable A bar is printed depending on value of $variable

$variable[N] A bar is printed depending on value of $variable and the bit representation. N=1,2,3,4... The maximum value of N is 31.For example, if the following bar functions are specified:$page_no[3]/$page_no[2]/$page_no[1]

then for $page_no = 3, bars are printed corresponding to 0/1/1.

evenparity A bar is printed if the number of the other bars is odd. This bar function is used as a security check. If this function is set, the numbers of bars on the sheet must be even. This means that if the number of bars printed to the sheet is odd, the parity bar must be added. If the OMR reads an odd number, there is a misreading. Therefore, security is doubled.

Barfunction Description

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 30: StreamServe Persuasion SP4 Document Sorting and Bundling

30 Defining an OMR codeOMR

OMR examples

Example 1 OMR example with envelope bar functions

OMR codes are printed from left to right. The following bar functions print an OMR code with two bars on every sheet, one bar if the sheet is first in the envelope, one bar if the sheet is last in the envelope, and another two bars on every sheet:

oddparity A bar is printed if the number of the other bars is even. This bar function is used as a security check. If this function is set, the numbers of bars on the sheet must be odd. This means that if the number of bars printed to the sheet is even, the parity bar must be added. If the OMR will reads an even number, there is a misreading. Therefore, security is doubled.

firstsheetinenvelope A bar is printed if it is the first sheet in the envelope.

notfirstsheetinenvelope A bar is printed if it is not the first sheet in the envelope.

lastsheetinenvelope A bar is printed if it is the last sheet in the envelope.

notlastsheetinenvelope A bar is printed if it is not the last sheet in the envelope.

Combinations of bar functions

func1 & func2 A bar is printed if both func1 and func2 print a bar.Note: The evenparity and oddparity functions

cannot be combined.

func1 | func2 A bar is printed if func1 or func2 print a bar. Note: The evenparity and oddparity functions

cannot be combined.

Barfunction Description

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 31: StreamServe Persuasion SP4 Document Sorting and Bundling

Defining an OMR code 31OMR

Example 2 OMR example with sequence bars

This example is identical to the example above, but sequence bars are added to the OMR code. The sequence bars have binary representation.

Bar functions 1/1/firstsheetinenvelope/lastsheetinenvelope//1/1

First sheet of envelope Intermediate sheets Last sheet of envelope

Bar functions 1/1/firstsheetinenvelope/lastsheetinenvelope/

/1/1/seq1/seq2/seq3

First sheet Second sheet Third sheet

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 32: StreamServe Persuasion SP4 Document Sorting and Bundling

32 Defining an OMR codeOMR

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 33: StreamServe Persuasion SP4 Document Sorting and Bundling

33

Labels

You can add one or more labels to an output document. The label can contain variables that for example specify the sheet number or the enveloping machine that handled the sheet.You define the label at Job begin or Document begin. Definitions specified at Document begin override definitions at Job begin.Note: If you use constant values for the label, for performance reasons, add the

label at Job begin only.

You configure the label options in the Runtime settings for an output connector that uses Job output mode.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 34: StreamServe Persuasion SP4 Document Sorting and Bundling

34 Defining a labelLabels

Defining a label1 In the Platform window, open the connector settings for the output

connector to be used.2 In the File field, enter the file path to the output file, relative to the export

directory, for example \out\jobwithlables.afp3 In the Runtime window, open the connector settings for the output

connector to be used.4 Click Document Trigger.

5 Set a Document trigger variable that defines a document, for example invoice_no

6 Click Job Begin and select the Labels tab.7 Click Add and enter the parameters.8 Click OK.

Label settings

Name The label name. This is only used internally as a reference.Only the first label of two or more labels with identical names is printed. A label defined on both Job begin and Document begin is printed only on Job begin.

X (mm) The X position of the label in millimeters (0 is left).

Y (mm) The Y position of the label in millimeters (0 is bottom).

Rotation (degrees) The clock-wise rotation of the label.

Side The side of the sheet where the label is placed.

Place on sheets The sheet(s) in a document where the label is placed. Select Between to put the label on all sheets except the first and the last sheet.

Font The font to use for the label text.

Font size The size in number of points of the font used for the label text.

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 35: StreamServe Persuasion SP4 Document Sorting and Bundling

Defining a label 35Labels

Text The printed text. You can use the following variables in your text:Note: The variable names are case sensitive.

<%NumSheets> – The number of sheets in the document.<%MailMach> – The name of the mailing machine.<%EnvelNr> – The number of the current envelope. Every envelope gets a unique number when it is created.<DOCUMENT> – The number of the current document. Documents are numbered per segment (if defined) and mailing machine.<PAGEINJOB> – The number of the current logical page. Pages are numbered per segment (if defined) and mailing machine.<SHEETINJOB> – The number of the current sheet. Sheets are numbered per segment (if defined) and mailing machine.<PAGESINDOCUMENT> – The number of pages in the document.<PAGEINDOCUMENT> – The number of the current page in the document.<SHEETINDOCUMENT> – The number of the current sheet in the document.

Label settings

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A

Page 36: StreamServe Persuasion SP4 Document Sorting and Bundling

36 Defining a labelLabels

StreamServe Persuasion SP4 Document Sorting and Bundling User Guide Rev A