Similar to the archive function there are also the same two general ways to send the outgoing or incoming data to any other port. If needed several times at the same time.

Distributed printing allows to realize a lot of different scenarios. Hereafter we´ll present the most common cases:

Interdependent if ELP needs to distribute, split or forward jobs, in most cases the keys InPort or OutPort are used.

 

Sharing print queues

Most of the examples need a shared queue, so windows can receive the routed or splitted files:

Open the printer settings, e.g. Installation Tab -> click on printer icon then right mouse click on any printer property and select share name.

 

InPort method

This is the fastest method to store a copy of the incoming data stream to any reachable port of any server.

InPort=\\127.0.0.1\#PRINTERSHARENAME#
InPort=\\#HOSTNAME#\QueueShareName
InPort=\\FaxSERVER\Port
InPort=#PCNAME#\QueueShareName

 

If you would like to send a third copy for example of an invoice direct to the bookkeeping printer:

 

 

 

[Copy the incoming data stream to another queue]

Search_Windows_New=Invoice No.

; send the incoming stream to the queue with the share name: BookKeeping.
; The queue is located on the same PC/Server

InPort=\\127.0.0.1\BookKeeping

 

InPort-keys can be used as often as needed, in any triggered rule.

Notes: If the command is invoked after some SEARCH_xxx keys in conjunction with Add, Insert, etc commands had been already performed, those changes will remain in the distributed data stream!

Database handler

If a search in a database is performed, the record is found and

  1. the record contains a field called INPORT
  2. The field is filled with an InPort argument

Then ELP will also send the print file automatically into the provided port.

OutPort method

Works exactly the same as the InPort method, but the outgoing data stream is sent to the defined ports.

Send data stream to another Printer:

 

 

 

[Copy the outgoing data stream to another queue]

Search_Windows_New=Invoice No.

; send the incoming stream to the queue with the share name: BookKeeping.
; The queue is located on the same PC/Server

OutPort=\\127.0.0.1\BookKeeping

 

The possible disadvantage: if there is a rule which copies the job two times, then also arrive 2 copies at the second destination queue.
A cook book example explaining step by step

Forward data stream to another queues

 

 

 

[Forward outgoing data stream to another queue]

Search_Windows_New=Invoice No.

; send the incoming stream to the queue with the share name: BookKeeping. The queue is located on the same PC/Server

OutPort=\\127.0.0.1\BookKeeping
NoPrinting=ON

 

ELP offers more ways to forward / reroute jobs: Example: Forward jobs

Reroute data to archives for equal printer workload

ELP can rotate jobs between printers to give them a common workload. E.g. high volume fax receiving splitted on several printers. Together with Monitored Printing you even ensure that each document is 100% printed.

Example: Workload Job Rotation (Job Counter)

 

Split Data streams

Host systems typically produce in one run huge print jobs. Splitting data stream can be used to separate the single document out of a huge mail merge data stream. e.g. an Invoice or delivery note run. And then maybe in a second run apply forms management (ELP_Command) stuff like stapling or printing copies as well as sending e-mails, faxes etc..

Here you find detailed samples: Split mailmerge print files in their single documents , Stapling/punching and splitting mail merge documents

A complete different way to split a file for work load balancing, not using the OutPort key, can be found here: Example: Split a huge job into x parts

Additional technical information how streams are splitted can be found here.

ELP automatically tries to reinitialize the splitted jobs to the proper values. This includes setting the font in the new strip to the last used font of the old strip. It is strongly recommended not to use any forms via ELP_COMMAND when splitting. This may lead into wrong results. But this is usually no problem, as it can be applied in the second run.

 

Besides initializing the new part, ELP supports collecting downloaded fonts or characters as well as macros, which are already part of the already splitted data stream: just in case the key key OutPortMode_ CollectFonts=ON is set, those elements are also included at front of every splitted part, for example downloaded Windows TruetType fonts. This key can only be used in conjunction with the OutArchiveDir and OutPort keys.

In very rare cases this might go wrong. So ELP offers the possibility to add additional sequences or commands right before every split data stream, beginning with the second stream: Add the init sequences to the OutPort definition line, separated with a semicolon, like \\MyPC\MyPrinter;\x1B%-12345X....

 

To help to generate a valid initalization sequence you may use the PCL Initialization Generator and finally copy it out of the field and append it to your command.

 

If you want to define a cover sheet on every newly generated job use the key PortCoverSheet=#### (#### is the macro number). The key provides also a possibility to set any additional escape sequences for example for paper in and output tray selection. Also the usage of any ELP variable is allowed in the initialization string. Doing so, the sequences can be added with semicolon after the form number: PortCoverSheet=22000;\x1B&l26a5H for selecting A5 and HP paper tray 3.

The macro 22000 is available as a predefined cover sheet, but feel free to develop any own macro, using any predefined or any collected variables.

Using the ELP_Commands EB#; and EE#; do insert before each splitted part the requested forms/data streams.

You may use any variables in the PortName.

 

For distributing jobs to quite a range of printers, you may also store the final destination queue share name in the data stream, read it back with Search_xxx and StoreNextWordToVariable and send it then to the correct queue or even use the call key to use the lpr DOS command.

The additional key SplitAfterEachCopy which is not available in the user menu is only useable with the command keys OutArchiveDir or OutPort and the ELP_Command copy option K#;. Turned on, the job is splitted after each copy.

 

Database handler

If a search in a database is performed, the record is found and

  1. the record contains a field called OUTPORT
  2. The field is filled with an InPort argument

Then ELP will also send the print file automatically into the provided port.

Additional commands in conjunction with OutPort

OutPort You may add a semicolon and behind a unique job initialization. See here for more details.
ClosePortsBeforeCall Set this key to ON, if the job distribution should be stopped before the Call[NoPrint] commands.
ClosePortsBeforeInsert Set this key to ON, if the job distribution should be stopped before the InsertAtJobEnd[DoNothing] command. This key will prevent that loaded files are inserted into the distributed data stream.
PortCoverSheet Once this key is defined and OutPort splitting is performed, the provided macro is called as a cover sheet right before every new splitted job.
Insert a semicolon and add any needed initialization PCL sequences, like paper in and out tray selections.
OutPortMode_CollectFonts Only usable for splitting files using the OutPort method.
ELP does collect all fonts and insert them at the beginning of the next part.
To work proper don't use the key FastMacroLoading=ON
DoNotProcessIncomingStream Does not process the original incoming data stream, instead the returned stream of the CallAtStartUp key is processed. Note: the returned stream size limit is 62550 Bytes.
SplitEveryPage Only usable for splitting files using the OutPort method.
ELP does automatically split every page of the job into a single print job.
DoNotInitializeNewSplitStream This key set to ON does advice ELP to add NO initialization at front of the next part. Should be used if the splitting takes place direct in front of an UEL statement, e.g. split each copy.

 

Distribute jobs based up file size or amount of pages

The idea is to redirect larger jobs to more efficient printers.This method will send the output data stream to any device, depending upon its file size or amount of pages. This could save a lot of printing costs.

Notes:

  • This function will NOT work, if data are further processed to STDOUT!
  • This function will also work for NON PCL5 data streams, but in that case the proper amount of pages needs to be passed in using the -p5 command line argument. MS Windows installations do that usually. The amount of pages are listed in the viewed queue.

Depending on the analysis of the job content, ELP is able to define as many different distribution rules as needed. In order to do so, there must be the ini file key DISTRIBUTE_SECTION used in any triggered or searched section. The argument is the name of a special section, which contains the final distribution rules. If those rules have to be performed for each job, set the Distribute_Section Key into the rule GLOBAL . If the out data is sent to another port, please make sure that ELP is not running into an endless loop, sending the incoming distributed data again and again to the same port. Best thing is, that the destination port is NOT ELP activated. Please note, that for every printer you print to, an ELP licenses is needed, independent if the destination queue is activated or not. The distribute_section can be freely named. Note that only this section can hold any number of the following keys:

 

DISTRIBUTE_FILESIZE The syntax is any positive number followed by an comma and the full port or directory where the data stream is to be rerouted to.
If the number is less or equal the outgoing printing file size, the job will be stored or rerouted to the file/port, which is defined after the comma.
DISTRIBUTE_FILESIZE=4000000,\\Servername\PrinterShareName1
DISTRIBUTE_PAGECOUNT The syntax is any positive number followed by an comma and the full port or directory where the data stream is to be rerouted to.
If the number is less or equal the total amount of printed pages, the job will be stored or rerooted to the file/port, which is defined after the comma.
DISTRIBUTE_PAGECOUNT=10,\\Servername\PrinterShareName2
The amount of pages is based upon the final content at the end of the job process of the variable #ACCTOTALPAGES#.


Notes:

 

  • If both keys are provided in the distribute section, and both succeed, the page count key has the higher priority.
  • For MS Windows a Printer port or a valid file name is treated as the same. So you can use the keys to generate also archive files.
  • The syntax is: Distribute_xxx=IntegerValue,Port or file.
    The integer value is the page count or file size minimum, at which the job has to be moved into a file or as in most cases to another port = Printer Queue)

If a job is moved then the key Distribute_CallOnChange located in the same distribution section can be used to call any external software. This command:

"Distribute_CallOnChange=net send #USERNAME# Job printed at #VAR_DISTRIBUTE_PORT#"

sends a message back to the user right at the time the print job is rerouted to the other printer. If the net send option is disabled, maybe call your communication software or use the e-mail feature of W-ELP which can be configured using the Admin tab.

Find a nice example here: Forward jobs (Example C)

Distribute the job using system tools or lprU

Basically it is to use one of the call keys to distribute the jobs. Available commands for MS Windows are:

  • copy /B FileName \\ServerName\PrinterReleaseName
  • lpr -S Server -P Printqueue FileName
  • lprU -S Server -P Printqueue -J JobName -U Username [-c Class] FileName

Please note, that for every printer you print to, an ELP licenses is needed, independent if the destination queue is activated or not.

[send a copy to ....]

Search_Binary=cc John Travolta

; Copy file to another folder

call=cmd /c copy /B "#MyFilename#" c:\data;OFF

; Copy file to a printer

call=cmd /c lpr -S 123.56.89.10 -P lp "#MyFilename#";OFF

; Copy file to a queue (Unix print services need to be started)

call=cmd /c lpr -S Server -P Printqueue "#MyFilename#";OFF

; Copy file to a queue with the username (Unix print services need to be started, lprU is supplied with W-ELP)

call=cmd /c "#ELP_PROG_PATH#lprU.exe" -S Server -P Printqueue -J "#PRINTDOCNAME#" -U "#USERNAME#" "#MyFilename#";OFF

Call_via_PJ_Notify=ON

Notes:

  • For every printer you print to an ELP licenses is needed, independent if the destination queue is activated or not.
  • If "#MyFilename#" is a just archived file, use key: CloseArchivesBeforeCall to have full access to it.
  • lprU is an enhancement of the standard lpr command in Windows which additionally allows to specify the user. lprU is provided "as is" and has limited support by stethos.
  • The parameters must all be UPPER CASE and followed by a blank.
  • All parameters which might include blanks must be enclosed in doublequotes.

 

Related articles: Running convert.exe process in user context