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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More on Stapled concatenated files HELP!!! plz

Status
Not open for further replies.

DanNJ

MIS
Mar 19, 2003
29
0
0
US
Staple each Doc, concatenated PS file- PLZ HELP!!

I have a bit of a problem. PostScript is a black box to me; I only know what I have learned in the past day about how PostScript works. I have to figure out how to concatenate three files together in one file but have each individual file stapled separately on a Xerox N4525. I have tried many things. To help you understand what I have tried I have listed the PS below (I am trying to concatenate three of these PS together) giving each line a number.

I have tried adding the following:

Attempt 1
False 0 startjob pop (between each doc)
Replacing line 3 with <</Staple 3>>setpagedevice
Results – all documents are stapled together as one. Same results if I remove “false 0 startjob pop” or if I try “true 0 startjob pop”

Attempt 2
false 0 startjob pop (between each doc)
Remove Line 3
Add <</Staple 3>>stepagedevice (between lines 99-100)
Add <</Staple 0>>stepagedevice (between lines 132-133)
Results – all documents are stapled together as one. Same results if I remove “false 0 startjob pop” or if I try “true 0 startjob pop”

Attempt 3
false 0 startjob pop (between each doc)
Add /foo save def (between lines 99-100)
Add foo restore (between lines 132-133)
Results – all documents are stapled together as one. Same results if I remove “false 0 startjob pop” or if I try “true 0 startjob pop”

Attempt 4
Tried all tests above again using << /Staple 1 /StapleDetails << /Type 6 /StapleMode 1 >> >> setpagedevice instead of <</Staple 3>>setpagedevice

WHAT AM I DOING WORNG?

line 1 %!PS-Adobe-3.0
line 2 % Select legal
line 3 <</Staple 0>>setpagedevice
line 4 << /DeferredMediaSelection true /PageSize [612 1008] /ImagingBBox null >> setpagedevice
line 5 % to create duplex output enter:
line 6 << /Duplex true >> setpagedevice
line 7 % Select output bin 1
line 8 <</OutputType (FINISHER BIN 1)>> setpagedevice
line 9 %%Creator: CompuSet Version 6.4.00
line 10 %%CreationDate: 3/19/03 12:14:48
line 11 %%BoundingBox: 0 0 612 1008
line 12 %%Pages: 4
line 13 %%DocumentSuppliedResources: procset CompuSet 6.4 1
line 14 %%DocumentNeededResources: font Frutiger-Bold
line 15 %%LanguageLevel: 2
line 16 %%EndComments
line 17 % This should appear right after the % End Comments:
line 18 %Created by Xerox Corporation, All Rights reserved.
line 19 %%BeginProlog
line 20 /g4imagemask {
line 21 16 dict begin
line 22 /g4Xdict exch def
line 23 /g4dict exch def
line 24 /g4rot 0.0 def
line 25 /g4pos 0 def
line 26 /g4res 300.0 def
line 27 /g4off 0 def
line 28 /g4bytes 0 def
line 29 /g4file currentfile def
line 30 /posX 0.0 def
line 31 /posY 0.0 def
line 32 /scaleX 1.00 def
line 33 /scaleY 1.00 def
line 34 /needClose false def
line 35 /percSeen 0 def
line 36 g4Xdict /ScaleX known { /scaleX g4Xdict /ScaleX get 0.00 add def } if
line 37 g4Xdict /ScaleY known { /scaleY g4Xdict /ScaleY get 0.00 add def } if
line 38 g4Xdict /PosX known { /posX g4Xdict /PosX get 0.0 add def } if
line 39 g4Xdict /PosY known { /posY g4Xdict /PosY get 0.0 add def } if
line 40 g4Xdict /Rotate known { /g4rot g4Xdict /Rotate get 0.0 add def } if
line 41 g4Xdict /Resolution known { /g4res g4Xdict /Resolution get 0.0 add def } if
line 42 g4Xdict /Length known { /g4bytes g4Xdict /Length get 0 add def } if
line 43 g4Xdict /FileName known {
line 44 /g4file g4Xdict /FileName get (r) file def
line 45 /needClose true def
line 46 } if
line 47 g4Xdict /Offset known { /g4off g4Xdict /Offset get 0 add def } if
line 48 g4off 0 ne { g4file dup fileposition g4off add setfileposition } if
line 49 /g4rows g4dict /Rows get def
line 50 /g4cols g4dict /Columns get def
line 51 g4bytes 0 gt { [ { /g4pos g4file fileposition g4bytes add def } stopped ] pop } if
line 52 gsave
line 53
line 54 g4rot 90 eq {612 0 translate 90 rotate}
line 55 {g4rot rotate} ifelse
line 56 posX posY translate
line 57 g4cols g4res div 72.0 mul scaleX mul g4rows g4res div 72.0 mul scaleY mul scale
line 58
line 59 % Filling the image from the upper left corner of the page
line 60 g4cols g4rows true [g4cols 0 0 g4rows neg 0 g4rows]
line 61 g4file g4dict /CCITTFaxDecode filter imagemask
line 62 {
line 63 needClose { g4file closefile exit } if
line 64 g4pos 0 gt { g4file g4pos setfileposition exit } if
line 65 g4file read {
line 66 37 eq
line 67 {/percSeen percSeen 1 add def percSeen 4 ge {exit} if}
line 68 {/percSeen 0 def}
line 69 ifelse
line 70 } {exit} ifelse
line 71 } loop
line 72 grestore
line 73 end
line 74 } bind def
line 75 %%BeginProlog
line 76 %%BeginResource: procset CompuSetDict 6.4 1
line 77 /AW {0.0 exch awidthshow} bind def /BK {0.0 0.0 0.0 setrgbcolor 0.0 setgray} bind
line 78 def /CF {closepath 1.0 setgray setrgbcolor fill grestore} bind def /D5 {.3 setlinewidth [.5 1.5] 0 setdash stroke grestore} bind
line 79 def /D6 {1 setlinewidth [1 1.5] 0 setdash stroke grestore} bind def /D7 {2 setlinewidth [2 2.5] 0 setdash stroke grestore} bind
line 80 def /DS {setlinewidth [4 4] 0 setdash stroke grestore} bind def /_DSC_DT {/setpagedevice {pop} def /setuserparams {pop} def
line 81 /letter {} def /halfletter {} def /ledger {} def /11x17 {} def /a0 {} def /a1 {} def /a2 {} def /a3 {} def /a4 {} def /a5 {} def
line 82 /a6 {} def /a7 {} def /a8 {} def /a9 {} def /a10 {} def /b0 {} def /b1 {} def /b2 {} def /b3 {} def /b4 {} def /b5 {} def
line 83 statusdict begin statusdict /setduplexmode {pop} put statusdict /setpapertray {pop} put statusdict /setjobtimeout {pop} put
line 84 statusdict /setmargins {pop pop} put statusdict /setpageparams {pop pop pop pop} put statusdict /setpage {pop pop pop} put
line 85 statusdict /setpagemargin {pop} put statusdict /lettertray {} put end userdict /letter {} put} bind def /FL {closepath setgray
line 86 fill grestore} bind def /FM {findfont exch makefont setfont} bind def /FN {findfont exch scalefont setfont} bind def /GR
line 87 /grestore load def /GS /gsave load def /IS 64 string def /L1 {findfont dup length dict begin{1 index /FID ne {def} {pop pop}
line 88 ifelse} forall /Encoding ISOLatin1Encoding def currentdict end} bind def /LD {exch definefont pop} bind def /LI /lineto load def
line 89 /MV /moveto load def /_DSC_NS {/showpage {} def} bind def /RG {1.0 setgray setrgbcolor} bind def /RM {0.0 rmoveto} bind def
line 90 /_DSC_RO /rotate load def /restore /restore load def /RU {setlinewidth stroke grestore} bind def /SC /scale load def /showpage
line 91 /showpage load def /SH /show load def /save /save load def /_DSC_TR /translate load def /WH {1.0 1.0 1.0 setrgbcolor 1.0
line 92 setgray} bind def /_DSC_WN {/pp 1 string def/s 1 string def/rn{currentfile s readhexstring{0 get}{pop exit}ifelse}def
line 93 /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
line 94 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
line 95 def}loop bytestr}bind def}bind def /WS {0.0 exch 32 exch widthshow} bind def
line 96 %%EndResource
line 97 %%EndProlog
line 98 %%BeginSetup
line 99 %%EndSetup
line 100 %%Page: 1 1
line 101 %%BeginPageSetup
line 102 %%PageMedia: Color Weight Type
line 103 %%EndPageSetup
line 104 save
line 105 28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 1 Page 1 Front)SH
line 106 restore
line 107 showpage
line 108 %%Page: 2 2
line 109 %%BeginPageSetup
line 110 %%PageMedia: Color Weight Type
line 111 %%EndPageSetup
line 112 save
line 113 28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 1 Page 1 Back)SH
line 114 restore
line 115 showpage
line 116 %%Page: 3 3
line 117 %%BeginPageSetup
line 118 %%PageMedia: Color Weight Type
line 119 %%EndPageSetup
line 120 save
line 121 28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 1 Page 2 Front)SH
line 122 restore
line 123 showpage
line 124 %%Page: 4 4
line 125 %%BeginPageSetup
line 126 %%PageMedia: Color Weight Type
line 127 %%EndPageSetup
line 128 save
line 129 28.0 /Frutiger-Bold FN 55.98 863.98 MV (Document 1 Page 2 Back)SH
line 130 restore
line 131 showpage
line 132 %%Trailer
line 133 %%EOF
 
You might not be doing anything wrong, it could be a lot of different things. We'll just have to work through the problem.

Try this: put your &quot;false 0 startjob pop&quot; between the files. false vs. true makes no difference for reasons that don't matter.

Put your staple dictionary i.e.
&quot;<</Staple 3>> setpagedevice&quot; immediately after that... on the next line:

%% 1st PS document

false 0 startjob pop
<< /Staple 3 >> setpagedevice

%% next PS document

false 0 startjob pop
<< /Staple 0 >> setpagedevice

%% third PS document.


Watch your spelling and remember PS is case-sensitive.

Deep breaths!

Thomas D. Greer
tgreer@choicesolutions.com
 
Tom,

I tried what you said but I ended up with the whole thing stapled. Is there a Staple Now command or a command that will make the jobs act like seperate jobs?
 
I suspected as much... your printer is not respecting the page-level scope of setpagedevice.

PostScript doesn't contain a &quot;staple&quot; command, that's device-specific. &quot;setpagedevice&quot; is how you pass that kind of command, which is what we're trying to do!

The &quot;startjob&quot; command is designed to make pages act like separate jobs. So there's nothing wrong with your code, it's your device that isn't behaving properly.

It just may be that your device doesn't support stapling individual pages, so stapling the entire file is the only action to take if the job contains any reference to stapling.

Try this, replace the &quot;<</Staple 0>> setpagedevice&quot; (supposed to turn off stapling I guess), to:

<</Staple null>> setpagedevice

If that doesn't work, we'll forget about trying to do this in PostScript, and look at the Xerox Job Ticket format, assuming your device supports XJT? That's something for you to check. XJT is a special commenting structure you add to PostScript to support device-level parameters, such as binding, stapling, gluing, tray selection, slip-sheet insertion and so on.
 
Tom,

I haven't been able to find any info for the n4525 about XJT. What exactly is it? Is it operating system specific? I am on Solaris. I did run into some info on PJL that I am going to try.
 
PJL is for HP devices. XJT is Xerox's. It's a commenting structure they devised... PostScript ignores it as a comment, but Xerox RIPs (at least on the DocuTech and DigiPath) process XJT comments for device parameters. I assume stapling is one of them.

I'm going way back in my memory here, but I think the format is:

%XRXedgeStitching: SinglePortrait

to make the whole job staple. I remember you could call out individual pages, to print from different trays, etc.



All of the XRX comments were at the front of the file, not inline, since they had to be preprocessed, so you have to specify page numbers for certain commands.

I know this isn't much help... but as I think more back on this, there were Xerox specific extensions to setpagedevice to define &quot;sets&quot; and &quot;runs&quot;, as a way to specify pages with unique settings.

I think your best bet is to contact Xerox directly for support.

Sorry!




 
Tom

Thanks for all the help, you put me on the right track. I feel confident that I will figure it out
 
Thatz just what I needed , thanks again tom
 
Tom,

Thanks again for the help. I finally have the solution for both the N4525 and DP92.

With the DP92 I added a /Staple 1 setpagedevice before each first page and a /Staple 4 setpagedevice in the pagesetup of the last page of the file.

For the N4525 I used a /staple 1 setpagedevice before page 1 and a PJL UEL to separate each file.


Dan
 
DanNJ,

Did you need to concatenate the files to prevent offsetting on the N4525? I am trying to stop offsetting on certain jobs but I still need them to be individually stapled. I've tried combining them using the methods in this thread but they always turn out staped individually and offset (using PJL UEL) or all stapled together and not offset (not using PJL UEL).
 
Just for a quick try, could you move the individual PostScript files into a directory and call them one by one with something like the following PS where the first part of the array points to a specific file and the next part points to the dictionary containing the setpageparams.

This is only to verify that something happening in between the PS files.

%!
[
[ { (/C/Temp/File_01.ps) (r) file cvx exec } << /Staple 3 >> ]
[ { (/C/Temp/File_02.ps) (r) file cvx exec } << /Staple 0 >> ]
]
{
save
exch aload pop
setpagedevice
exec
restore
} forall

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top