🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.postscript.programming
Article #1231

copypage in PS Level 3

#1231
From: Birger Kraegelin
Date: Tue, 18 Feb 2003 08:45
48 lines
2305 bytes
We switched our laser printer from a PS level 2 one to a PS level 3 one. Now our postscript code doesn't work anymore.

For printing multiple copies of our order forms we prepend every print job (generated on a Unix machine) with a little postscript program, which redefines the showpage operator and does a sequence of copypage and showpage. Each subsequent copy of the page gets watermarked with "Copy I", "Copy II", "Copy III".

In PS level 3 the semantics of copypage changed and the page gets erased.

We don't have access to the source of the application generating the postscript output. And the way generating the printout might change in newer versions.

Is it possible to have equal functionality in PS level 3? How to write such a program, which language features to use?

A snippet of our code:
----------------------------------------
/showpage
{ % open local var dictionary
  % we only need one var
  2 dict
  begin
    % make first copy of page
    copypage
    % set to default graphics state
    gsave initgraphics
    % generate sign on the page
    /Do-Sign
    { gsave
      newpath
      160 100 moveto
      55 rotate true charpath clip -55 rotate
      0.5 setlinewidth 0.75 setgray
      0 3 1092
      { newpath
        dup 0 exch moveto
        0 lineto
        stroke
      } for
      copypage grestore
    } def
    /Times-Roman findfont 160 scalefont setfont
    (Copy I) Do-Sign
    (Copy II) Do-Sign
    (Copy III) Do-Sign
    grestore erasepage initgraphics
  % close local dictionary
  %
  end
} bind def
----------------------------------------

Thanks for any help
Technical Details
Message-ID: <1de7e6ce.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c61a,41c664b117f1a15b
X-Google-Attributes: gid10c61a,public
X-Google-ArrivalTime: 2003-02-18 01:08:04 PST
From: "Birger Kraegelin" <krg@iitb.fhg.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.postscript.programming
Subject: copypage in PS Level 3
Message-ID: <1de7e6ce.-1@WebX.la2eafNXanI>
Date: Tue, 18 Feb 2003 00:45:20 -0800
Lines: 57
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit