Products | About Us

Adding lines to top of printjob

Hello,

Is it possible to add lines to the top of a print job, for every print job ?

What I have is a Xerox Workcentre Pro that has to do secure printing from AIX using LPR/LPD to a Windows 2003 server running Print Distributor (confused yet?).

Using plain text it works like a charm, but the problem is when I start using PS files, the Windows driver for the Xerox Workcentre will notice that I have used PS myself and presume I know what I am doing (hehe...) and stops adding the secure printing bit.

Now, I can add the code myself using Print Distributor I expect, but how ? :)

This is what I would like to add (or part of it, need to see how little or much I need) :

%-12345X@PJL JOB

@PJL ENTER LANGUAGE = POSTSCRIPT

%!PS-Adobe-3.0

%%XRXbegin

%%Line has been deleted;

%%Line has been deleted;

%%OID_ATT_START_SHEET OID_VAL_JOB_SHEET_FULL;

%%OID_ATT_JOB_TYPE OID_VAL_JOB_TYPE_SECURE_PRINT;

%%OID_ATT_JOB_PASSWORD "@[UT";

%%OID_ATT_COLOR_MODE OID_VAL_COLOR_MODE_BLACK_WHITE;

%%XRXend

%%XRXDriverBuildVer: 4.176.0.0U 2006.01.16

%%XRXProdDllVer: 4.176.0.0U 2006.01.16

%%XRXToolkitDllVer: 4.253.0.0U 2006.01.16

%%XRXBaseDllVer: 0.3.3790.3959

%!PS-Adobe-3.0

%%Title: STDIN.860200

%%Creator: PScript5.dll Version 5.2.2

%%CreationDate: 5/4/2009 15:19:4

%%For: root (192.168.100.40)

%%BoundingBox: (atend)

%%Pages: (atend)

%%Orientation: Portrait

%%PageOrder: Special

%%DocumentNeededResources: (atend)

%%DocumentSuppliedResources: (atend)

%%DocumentData: Clean7Bit

%%TargetDevice: (Xerox WCP 75/65) (3010.106) 1510

%%LanguageLevel: 3

%XRXType: RAW

%%EndComments

Stefan Mansier
5th May 2009

Stefan,

Add a script action and paste in the following code. Then make sure you move the script action up to be the first in your list of actions.


' Start of script

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTSIn = objFSO.OpenTextFile(PrintFilePath, 1, false, 0)
Set objTSOut = objFSO.CreateTextFile(PrintFilePath & ".tmp", true, false)

objTSOut.WriteLine("%!PS-Adobe-3.0")
objTSOut.WriteLine("%%XRXbegin")
objTSOut.WriteLine("%%Line has been deleted;")
objTSOut.WriteLine("%%Line has been deleted;")
objTSOut.WriteLine("%%OID_ATT_START_SHEET OID_VAL_JOB_SHEET_FULL;")
objTSOut.WriteLine("%%OID_ATT_JOB_TYPE OID_VAL_JOB_TYPE_SECURE_PRINT;")
objTSOut.WriteLine("%%OID_ATT_JOB_PASSWORD ""@[UT"";")
objTSOut.WriteLine("%%OID_ATT_COLOR_MODE OID_VAL_COLOR_MODE_BLACK_WHITE;")
objTSOut.WriteLine("%%XRXend")

Do While objTSIn.AtEndOfStream = False
objTSOut.Write(objTSIn.Read(1))
Loop

objTSIn.Close
objTSOut.Close

' Delete the original and move the new file in its place
objFSO.DeleteFile PrintFilePath
objFSO.MoveFile PrintFilePath& ".tmp", PrintFilePath

' End of script

Tony Edgecombe
5th May 2009

Great!
Is there also a way to print the ^[ (escape) character ?

Stefan Mansier
15th May 2009

objTSOut.Write(Chr(27))

Tony Edgecombe
15th May 2009

This thread is closed to new posts.

Feed