Bug 702597

Summary: Can't use EndPage procedure with PDF file
Product: Ghostscript Reporter: Rafael A. M. Amaral <rafaelamaral320>
Component: PDF InterpreterAssignee: Default assignee <ghostpdl-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: sphinx.pinastri
Priority: P4    
Version: 9.52   
Hardware: PC   
OS: Windows 10   
Customer: Word Size: ---

Description Rafael A. M. Amaral 2020-07-30 14:32:52 UTC
- Using:
    gs -sDEVICE=tiffsep1 -sCompression=lzw -o out%d.tif post.ps input.pdf

- With post.ps:

    %!
    <<
        /EndPage {
        newpath
            0 0 moveto
            1000 1000 lineto
        stroke
        } bind
        /Orientation 3
    >> setpagedevice

- Ghostscript returns an error.
 - KenS in StackOverflow said it could be a bug in the PDF interpreter.
- It works if I use BeginPage, instead.


The question in StackOverflow:

https://stackoverflow.com/questions/63166024/how-can-i-write-a-line-in-a-pdf-with-a-gradient-with-ghostscript-postscript-with/63168132#63168132
Comment 1 Peter Cherepanov 2020-08-01 17:16:54 UTC
This /EndPage procedure and the bug report are invalid.
/EndPage must take 2 integers, consume them and return a boolean value.
The following configuration works just fine.

    <<  /EndPage {
        newpath 0 0 moveto 1000 1000 lineto stroke
        exch pop 2 ne
        } bind
        /Orientation 3
    >> setpagedevice