There are several ways how to perform such a ask with ELP, depending upon the requirements:

Solution 1:

This solution is the easiest one, but the data stream must fit to those requirements:

A) Not too big, as the printing will slow down, the more single documents the stream has. Maybe up to 50 or 80 single to staple documents are possible to do, but more then that, the ELP output process gets really slow.
B) You do NOT want to archive the single items, or the ELP_Command is not too complex: Overlaying the same form on every page is ok, but changing paper trays or uses different forms on different pages is in that method also NOT really recommended
C) Each single document of the mail merge data stream must have the same amount of pages.
D) Each document part must be printable stand alone
E) For ELP versions running on appliances or as a printer firmware extension, please make sure that the file stapling.ini is available. Also the print file sizes should not exceed more then 2MB. If your printer has a lot of memory, you may have more memory available. In that case change the key ELP_Max_Heap in rule Global. But note if the value is increased too much, the printer may crash. On appliances you may go up to 60MB.

If those 4 requirements are true, then you may use this ELP_Command:

ELP_Command=T#:$;
# is the number for the stapling method, if you enter the command using the ELP Command Generator most manufacturers are listed in the drop down menu. If your command / item is missing, then you can add it in the stapling.ini file, using an ASCII Editor, like Notepad.
:$ The amount of pages added with double point, which belong to one single document.

ELP_Command=T200:3;

; this command will staple every 3 pages together, using the Ricoh: One staple on top left of paper method.

Solution 2:

This solution is for those data streams, not matching A. B, and D above and MS Windows only.

The data stream is spitted into its single documents, fixed every X pages. See Split a big job into 50 pages pieces, as this is maximum amount of pages being stapled and change the 50 pages to the amount of pages needed.

Solution 3:

Like solution 2, but each single document may have a variable amount of pages. Usually 2 queues are needed for that process. When the costs explode your budget as double the amount of commands are needed, there are ways to reefed the split documents to the same queue, see below.

-------- The configuration file convert.ini in the c:\ProgramData\WELP folder

[Name of Incoming Queue]

; define a rule for the incoming data. YOU NEED TO RENAME THAT SECTION !

IniFile=#ELP_FORMS_PATH#Split.ini

; For the 2 queues strategy activate another Configuration file for all streams coming form that queue

[Name of Queue receiving the split jobs]

; YOU NEED TO RENAME THAT SECTION !

ELP_Command=C1:1SI11F500FF;C1:2F501;C1S0F502;T200;

; Print the first page in duplex for plain media type, put a full letter head on and insert a new blank page

; Add on the second, newly added page, the Terms & conditions

; On all remaining pages, print simplex and put only the logo on

Exit=ON

; This is the end of process for that queue

If the first pages are not duplexed, see here.

-------- The configuration file split.ini in the c:\ProgramData\WELP folder

[GLOBAL]

;... Whatever you need

OutPort=\\#HOSTNAME#\PrinterShareNameOfOutPort

; sends the outgoing data stream to the out queue B

NoPrinting=ON

; The data stream is on Queue A not printed

OutPortMode_CollectFonts=ON

; in order that all parts are correctly printed collect and insert all needed stuff

; use the rule assistant -> Add rule/section to generate this SEARCHED(!) rule, use

; test button to see if the term can be found and on the secondary screen insert the

; Add_binary command.

[Search for a word/term on every last page of a single document]

Search_Windows=Total Amount:

; Select in the rule assistant the Search mode and TEST if the argument can be found

; You may add several independent searched Items to that rule.

Add_Binary=\x1B&f997Y

; If one of the search items is found, then add the ELP command to split the document right after the next form feed.

Solution 4:

Same a solution 3, but as quite some printers are needed, the data stream is split back to the same queue. A special trigger needs to be added to differentiate the incoming document between the split and to split job. In that case only the convert.ini file is needed

-------- The configuration file convert.ini in the c:\ProgramData\WELP folder

[Is is a split jobs]

Search_Binary=@PJL COMMENT "ELP Splitted job"

; If the trigger is found, it is a split job

ELP_Command=C1:1SI11F500FF;C1:2F501;C1S0F502;T200;

; If the first pages are not duplexed, see here.

Exit=ON

; All rules below are only executed if the one above, which is right at the job beginning

; is not found.

[Search for a word/term on every last page of a single document]

Search_Windows=Total Amount:

Add_Binary=\x1B&f997Y

; Same as above

[Add the second run trigger]

OutSearch_Binary=\x1B%-12345X

; The out going data stream is searched for the UEL (If available) and then add the trigger for the

; second run detection

Add_Binary=@PJL COMMENT "ELP Splitted job"\x0D\x0A; Insert the trigger behind the UEL

[Job to split]

Trigger_Binary=1

; Rule always executed after job was read into memory

OutPort=\\#HOSTNAME#\#PRINTERSHARENAME#

NoPrinting=ON

OutPortMode_CollectFonts=ON

Related articles: Rules theory, Rule assistant, Add key to rule, Split a big job into 50 pages pieces, as this is maximum amount of pages being stapled