Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Staple each doc in a concantinated file

Status
Not open for further replies.

DanNJ

MIS
Mar 19, 2003
29
US
Lets say I take 10 ps files and I copy them together in a text editor then send it to a printer as 1 file. Is it possible to have each job in the master file get separately stapled?

I am using a Xerox DP92 or n4525 to print.

Any help would be great.

thx
Dan
 
Wow... where to start.

1) Clobbering together a bunch of PostScript files will almost certainly produce unexpected results. Well, unexpected that is if you expect that to WORK!! There are specific techniques you have to learn if you wish to concantenate a collection of disparate PostScript files. I can teach you these, if you wish.

2) Stapling is a device-specific operation. PostScript is a device-independent language. The instructions for stapling then will need to use a PostScript operator called "setpagedevice", with the parameters specified by your hardware manufacturer.

If all of this is beyond what you want to learn, look at using a PDF workflow, just distill all your files separately, use Acrobat to assemble your document and author a JDF file for Job Definition (stapling).
 
Tgreer (firstname wouldn't be toby would it?)

I know what my staple commands for each device are,
I have tried the following for my N4025 to try to staple
the second document but instead none were stapled.
Here is the code I used:


%!PS-Adobe-3.0

%Exact copy of next ps here
%%EOF
false 0 startjob pop

%!PS-Adobe-3.0

% Select legal

<< /DeferredMediaSelection true /PageSize [612 1008] /ImagingBBox null >> setpagedevice

% to create duplex output enter:

<< /Duplex true >> setpagedevice

% Select output bin 1

<</OutputType (FINISHER BIN 1)>> setpagedevice

%

%%Creator: CompuSet Version 6.4.00

%%CreationDate: 3/19/03 12:14:49

%%BoundingBox: 0 0 612 1008

%%Pages: 4

%%DocumentSuppliedResources: procset CompuSet 6.4 1

%%DocumentNeededResources: font Frutiger-Bold

%%LanguageLevel: 2

%%EndComments

%

% This should appear right after the % End Comments:

%

%Created by Xerox Corporation, All Rights reserved.

%

%%BeginProlog

%

/g4imagemask {

16 dict begin

/g4Xdict exch def

/g4dict exch def

/g4rot 0.0 def

/g4pos 0 def

/g4res 300.0 def

/g4off 0 def

/g4bytes 0 def

/g4file currentfile def

/posX 0.0 def

/posY 0.0 def

/scaleX 1.00 def

/scaleY 1.00 def

/needClose false def

/percSeen 0 def

g4Xdict /ScaleX known { /scaleX g4Xdict /ScaleX get 0.00 add def } if

g4Xdict /ScaleY known { /scaleY g4Xdict /ScaleY get 0.00 add def } if

g4Xdict /PosX known { /posX g4Xdict /PosX get 0.0 add def } if

g4Xdict /PosY known { /posY g4Xdict /PosY get 0.0 add def } if

g4Xdict /Rotate known { /g4rot g4Xdict /Rotate get 0.0 add def } if

g4Xdict /Resolution known { /g4res g4Xdict /Resolution get 0.0 add def } if

g4Xdict /Length known { /g4bytes g4Xdict /Length get 0 add def } if

g4Xdict /FileName known {

/g4file g4Xdict /FileName get (r) file def

/needClose true def

} if

g4Xdict /Offset known { /g4off g4Xdict /Offset get 0 add def } if

g4off 0 ne { g4file dup fileposition g4off add setfileposition } if

/g4rows g4dict /Rows get def

/g4cols g4dict /Columns get def

g4bytes 0 gt { [ { /g4pos g4file fileposition g4bytes add def } stopped ] pop } if

gsave



g4rot 90 eq {612 0 translate 90 rotate}

{g4rot rotate} ifelse

posX posY translate

g4cols g4res div 72.0 mul scaleX mul g4rows g4res div 72.0 mul scaleY mul scale



% Filling the image from the upper left corner of the page

g4cols g4rows true [g4cols 0 0 g4rows neg 0 g4rows]

g4file g4dict /CCITTFaxDecode filter imagemask

{

needClose { g4file closefile exit } if

g4pos 0 gt { g4file g4pos setfileposition exit } if

g4file read {

37 eq

{/percSeen percSeen 1 add def percSeen 4 ge {exit} if}

{/percSeen 0 def}

ifelse

} {exit} ifelse

} loop

grestore

end

} bind def



%

%%BeginProlog

%%BeginResource: procset CompuSetDict 6.4 1

/CompuSetDict 100 dict def CompuSetDict begin /AW {0.0 exch awidthshow} bind def /BK {0.0 0.0 0.0 setrgbcolor 0.0 setgray} bind

def /CF {closepath 1.0 setgray setrgbcolor fill grestore} bind def /D5 {.3 setlinewidth [.5 1.5] 0 setdash stroke grestore} bind

def /D6 {1 setlinewidth [1 1.5] 0 setdash stroke grestore} bind def /D7 {2 setlinewidth [2 2.5] 0 setdash stroke grestore} bind

def /DS {setlinewidth [4 4] 0 setdash stroke grestore} bind def /_DSC_DT {/setpagedevice {pop} def /setuserparams {pop} def

/letter {} def /halfletter {} def /ledger {} def /11x17 {} def /a0 {} def /a1 {} def /a2 {} def /a3 {} def /a4 {} def /a5 {} def

/a6 {} def /a7 {} def /a8 {} def /a9 {} def /a10 {} def /b0 {} def /b1 {} def /b2 {} def /b3 {} def /b4 {} def /b5 {} def

statusdict begin statusdict /setduplexmode {pop} put statusdict /setpapertray {pop} put statusdict /setjobtimeout {pop} put

statusdict /setmargins {pop pop} put statusdict /setpageparams {pop pop pop pop} put statusdict /setpage {pop pop pop} put

statusdict /setpagemargin {pop} put statusdict /lettertray {} put end userdict /letter {} put} bind def /FL {closepath setgray

fill grestore} bind def /FM {findfont exch makefont setfont} bind def /FN {findfont exch scalefont setfont} bind def /GR

/grestore load def /GS /gsave load def /IS 64 string def /L1 {findfont dup length dict begin{1 index /FID ne {def} {pop pop}

ifelse} forall /Encoding ISOLatin1Encoding def currentdict end} bind def /LD {exch definefont pop} bind def /LI /lineto load def

/MV /moveto load def /_DSC_NS {/showpage {} def} bind def /RG {1.0 setgray setrgbcolor} bind def /RM {0.0 rmoveto} bind def

/_DSC_RO /rotate load def /_DSC_RS /restore load def /RU {setlinewidth stroke grestore} bind def /SC /scale load def /_DSC_SP

/showpage load def /SH /show load def /_DSC_SV /save load def /_DSC_TR /translate load def /WH {1.0 1.0 1.0 setrgbcolor 1.0

setgray} bind def /_DSC_WN {/pp 1 string def/s 1 string def/rn{currentfile s readhexstring{0 get}{pop exit}ifelse}def

/unpack{/DC 0 def /BC 0 def{DC bytestr length ge{exit}if rn /BC exch def BC 127 le{/BC BC 1 add def DC 1 DC BC add 1 sub{bytestr

exch rn put}for}{/BC BC 255 xor 2 add def rn /pp exch def DC 1 DC BC add 1 sub{bytestr exch pp put}for}ifelse /DC DC BC add

def}loop bytestr}bind def}bind def /WS {0.0 exch 32 exch widthshow} bind def end

%%EndResource

%%EndProlog

%%BeginSetup

CompuSetDict begin

%%EndSetup


% enable stapling

<< /Staple 1 /StapleDetails << /Type 6 /StapleMode 1 >> >> setpagedevice

%%Page: 1 1

%%BeginPageSetup

%%PageMedia: Color Weight Type

%%EndPageSetup

_DSC_SV

28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 2 Page 1 Front)SH

_DSC_RS

_DSC_SP

%%Page: 2 2

%%BeginPageSetup

%%PageMedia: Color Weight Type

%%EndPageSetup

_DSC_SV

28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 2 Page 1 Back)SH

_DSC_RS

_DSC_SP

%%Page: 3 3

%%BeginPageSetup

%%PageMedia: Color Weight Type

%%EndPageSetup

_DSC_SV

28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 2 Page 2 Front)SH

_DSC_RS


_DSC_SP

%%Page: 4 4

%%BeginPageSetup

%%PageMedia: Color Weight Type

%%EndPageSetup

_DSC_SV

28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 2 Page 2 Back)SH

_DSC_RS

_DSC_SP

end

%%Trailer

% disable stapling. THis means, the pages from the lates enabling code up to and

% including to the page ending just before these comment lines are stitched.

<</Staple 0>>setpagedevice

%%EOF
false 0 startjob pop

%!PS-Adobe-3.0

% Exact Copy of previous PS
%%EOF





 
Oh one more thing, the first and third docs do not have the staple commands.
 
I didn't analyze your code in too much detail, I don't have the time at the moment. I can tell you that you are indeed concatenating your files correctly, with

false 0 startjob pop

between jobs. And you are using setpagedevice for your page-level parameters, as you should. So, rest assured you aren't crazy and you're doing things the &quot;right way&quot;.

But take a closer look at the CompuSetDict procset. It appears to redefine most of the stuff you need, including setpagedevice, to be no-ops! So the problem may be that your setpagedevice operator has been redefined to pop your parameters off the stack!

As a debug step to see if this is the problem, comment out the

CompuSetDict begin

line. Replace each _DSC_SV with &quot;save&quot;, _DSC_RS with &quot;restore&quot; and _DSC_SP with &quot;showpage&quot;.

See how your job runs without using the CompuSetDict dictionary.

Tom


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top