Bug 702597 - Can't use EndPage procedure with PDF file
Summary: Can't use EndPage procedure with PDF file
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.52
Hardware: PC Windows 10
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-30 14:32 UTC by Rafael A. M. Amaral
Modified: 2020-08-01 17:25 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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