Print

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!

The most elegant solution is the third one! Because it even works today and provides to the printer the most information for any future products.

1. Solution

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().

[RZPH98]

; section which is triggered for all data stream coming from that server

Variable=MyPosVar:STRPOS(#USERNAME#,"@")

Variable=#MyUserName#:LEFT(#USERNAME#,#MyPosVar#)

; the rest is maybe not needed at all, just to demonstrate ...

OutArchiveDir=.......

; 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

 

2. Solution

Before every data stream you can have your own ini-file, which is also executed when found...

​Esc%-12345X@PJL ENTER LANGUAGE=ELP

[GLOBAL]

; here you can add any command you like e.g. the overwriting of the user variable:

variable=USERNAME:YourName

; or

OutArchiveDir=#PCNAME#\archive\YourName;Filename

Exit=ON

; or even both:

variable=USERNAME:YourName

OutArchiveDir=#PCNAME#\archive\#USERNAME#;Filename

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 quite simple.

Esc%-12345X@PJL COMMENT "Host Job BlahBlah Blah"

@PJLSETJOBATTR="JobAcct1=SwedishPrint"

@PJL ENTER LANGUAGE=PCL

EscE....

 

If a printer is not able to handle the PJL stuff, nothing will happen, usually they ignore it.
Hint: 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]

; Trigger

Search_Binary=!USERNAME!

; delete this and the next word

Erase_Binary=ON
StorenextWordToVariable=USERNAME

 

So the data stream will contain a text this:
!USERNAME!SwedPrint

Hint: 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.