PJL parsing is started when the following "string" is encountered in the data-stream: "<ESC>%-12345X@PJL" followed by a "<LF>", or a PJL command followed by a "<LF>". Each line following this line, and starting with "@PJL" is interpreted as a PJL command. Anything else causes PJL interpretation to finish.
The escape sequence "<ESC>%-12345X" is called the Universal Exit Language (UEL) command. It should cause the PCL5 PDL to stop reading and parsing the data-stream, and switch back to the caller (for example, the emulation chooser). According to the specifications, a PCL5 job must be enclosed within UEL escape sequences, which are used as markers to identify job boundaries.
In order to efficiently parse PJL it is sufficient to start each line with a "@PJL" string and end each line with a "<LF>".
Example
<ESC>%-12345X@PJL<LF>
@PJL JOB NAME = "job1"<LF>
this is a page of job 1<LF><FF>
<ESC>%-12345X@PJL<LF>
@PJL EOJ<LF>
@PJL JOB NAME = "job2"<LF>
this is a page of job2<LF><FF>
<ESC>%-12345X@PJL<LF>
@PJL EOJ
In the example above, it is not allowed to split the job between the "EOJ" and "JOB" lines. Reason: the "@PJL JOB NAME = "job2"" will be interpreted as plain text, not as PJL.
A valid sequence would be:
<ESC>%-12345X@PJL<LF>
@PJL JOB NAME = "job1"<LF>
this is a page of job 1<LF><FF>
<ESC>%-12345X@PJL<LF>
@PJL EOJ<LF>
<ESC>%-12345X@PJL JOB NAME = "job2"<LF>
this is a page of job2<LF><FF>
<ESC>%-12345X@PJL<LF>
@PJL EOJ