Bug 690226 - Ghostscript is creating one extra page when duplex option is present in ps file
Summary: Ghostscript is creating one extra page when duplex option is present in ps file
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: 8.63
Hardware: Sun Solaris
: P4 major
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-11 23:04 UTC by nivethitha
Modified: 2011-08-16 19:38 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
ps file generated using pstops filter (978.88 KB, application/postscript)
2009-01-11 23:04 UTC, nivethitha
Details
pcl file by Ghostscript (688.38 KB, application/octet-stream)
2009-01-11 23:05 UTC, nivethitha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nivethitha 2009-01-11 23:04:17 UTC
Hi,

I gave a 3 page ps file which is generated using Mozilla application to pstops
filter with duplex and watermark option. Printed properly with duplex and
watermark on 3 pages.
The same file i gave it to gs in command line.
gs -sDEVICE=ljet4 -sOUTPUTFILE=gs.prn pstops_duplex_watermark.ps

It has generated 4 pages and watermark is printed on 4th page also only for
solaris 10 OS. 

We did not face the issue when we were using Solaris 9 OS. The same ps file i
gave it to AIX and it has generated 3 pages properly.

Please help with solution.
Comment 1 nivethitha 2009-01-11 23:04:58 UTC
Created attachment 4699 [details]
ps file generated using pstops filter
Comment 2 nivethitha 2009-01-11 23:05:26 UTC
Created attachment 4700 [details]
pcl file by Ghostscript
Comment 3 nivethitha 2009-01-29 05:12:59 UTC
Hi,

Please confirm the bug and please let me know whether the bug will be fixed in
later releases.
Comment 4 Ken Sharp 2009-01-29 05:45:11 UTC
When /Duplex is true it is necessary to generate 4 pages. Page 1, Page 2
(printed on the back of page 1), Page 3 and Page 4 (printed on the back of page
3). See p416 of the 3rd edition PostScript Language Reference Manual.

If this is not done, the 'last' page would remain in the duplex unit of the
printer and the first page of the next document printed as the reverse of the
3rd page. 

However, the 'ps file generated using pstops filter.ps' document does not
activate PostScript duplexing. There are a number of comments (which are no-ops
as far as staright PostScript interpreters are concerned), which relate to the
Foomatic RIP, eg:

%%BeginFeature: *Duplex DuplexNoTumble
%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble
%%EndFeature

Ghostscript will ignore these, other DSC processing applications may not. In
particular the FoomaticRip (a part of CUPS) may well do something with these
comments.

The job does in fact contain 4 pages, the fourth page consists of a simple showpage:

%%Page: 4 4
showpage

%%Trailer
%%Pages: 4
%%EOF

This gets a watermark because of the custom EndPage procedure contained in the
PostScript program.

So, Ghostscript is doing exactly what it should do. 

I believe that pstops may have added the additional 4th page due to duplexing
being active in the original program.

The original report says:

"I gave a 3 page ps file which is generated using Mozilla application to pstops
filter with duplex and watermark option. Printed properly with duplex and
watermark on 3 pages.
The same file i gave it to gs in command line."

Yet the only PostScript file we have been given appears to be the result of
pstops. So is the complaint that Ghostscript pritns 4 pages on the *converted*
job ? Or have we not been given the 'same file' as was input to pstops ?

Since pstops doesn't print anything, how was this 'printed properly' ?

Much of the report doesn't make sense. There are references to 'giving' the file
to operating systems, which don't handle PostScript directly. Eg:

"The same ps file i gave it to AIX and it has generated 3 pages properly"

Possibly what is meant is that the file has been processed by versions of
Ghostscript installed on several different operating systems. In this case it is
likely that the difference in behaviour is due to different versions of
Ghostscript being present. Possibly duplexing behaviour has changed between
different versions of Ghostscript, most likely due to bugs being fixed.


Summary:

The supplied PostScript file behaves as expected. The description of the
behaviour of the original file (not supplied apparently) matches the expected
behaviour of a PostScript device when Duplex is true. I don't believe this is a
bug, but can't tell for certain without the original file.
Comment 5 Marcos H. Woehrmann 2011-08-16 19:38:46 UTC
Not sure why this wasn't closed or why this was assigned to me.  Ken's analysis appears complete and correct.