Q: When we send data stream from the host, how can we archive them to a user specific directory. The user name provided through the queue is always the host name.
A: There are in theory 5 ways (or more ?) possible. They are all related to the ini-file you have now... Meaning the standard archive command must be executed after you had the chance to recognize that this is an Host based stream. In other words the default Archive command needs to be in a triggered section!
My favourite and you will see most elegant solution is the third method! Because it even works today and provides to the printer the most information for any future products.
The name is provided as a part of the document description in the queue. We do have functions like left() and right() and even strpos().
; section which is triggered for all data stream coming from that server
; the rest is maybe not needed at all, just ot show you...
; This is to stop execution of original ini file, so nothing else is used, maybe unless you put additional stuff into the section or in a valid init-file name EXIT=ON
Before every data stream you can have your own ini-file, which is also executed when found...
Esc%-12345X@PJL ENTER LANGUAGE=ELP
; here you can add any command you like e.g. the oferwriting of the user variable:
; or even both:
Esc%-12345X FOLLOWED BY YOUR FILE NAME
3. And preferred solution (SAP can do that easily)
Before explaining this one some background info:
When a job arrives, ELP takes the user name from the windows queue, but as like your HOST case, this might not be the user who created the file.
So ELP looks also in the file and searches for some PJL commands, which are defined by HP to tell the printer some more info about the job.
ThisPJLcommandis@PJLSETJOBATTR="JobAcct1=UserName" So if this PJL command is found, ELP overwrites the windows USERNAME with the name after JobACCT1=
Hopefully your job starts with Esc%-12345X followed maybe with some PJL commands where the last one is @PJL ENTER LANGUAGE=PCL or POSTSCRIPT followed by CR-LF and the real data stream, then the change is very very easy.
Esc%-12345X@PJL COMMENT "Host Job BlahBlah Blah"
@PJL ENTER LANGUAGE=PCL
If a printer is not able to handle the PJL stuff, nothing will happen, usually they ignore it.
Tip: Print a windows job into a file and open it with Notepad to see, what you can set with PJL commands. Take a LJ 4250 to see the most available stuff.
4. Last method
[Search for own user name]
; delete this and the next word
So the data stream will contain a text this:
Tip: If you want to maintain it in the data stream, maybe do not erase it, but set the printer to white printing before and back to black after the text, so the text will not be displayed on the paper.
5. ELP running on the same operating system
Reads a value of an environment variable and stores it into an upper case ELP variable surrounded by #-signs.