Skip to main content
Participant
August 11, 2015
Question

how does eoclip work on this sample postscript program?

  • August 11, 2015
  • 2 replies
  • 1441 views

I am totally new to Postscript programming and I want to know what eoclip operator does on this particular program.

<< /PageSize [792 1224] >> setpagedevice

eoclip newpath

12 8 768 1208 rectclip

72 72 scale

8 8 1 [8 0 0 8 0 0] {<c936>} image

showpage

I already understand the other operator does, except eoclip.

The output of this program in ghostscript is a blank page.

but when I removed the eoclip operator, the image prints correctly.

I am confused on how the even-odd rule applies on this program.

This topic has been closed for replies.

2 replies

Legend
August 12, 2015

If you don't have it, the PostScript Language Reference Manual is here: https://www.adobe.com/products/postscript/pdfs/PLRM.pdf

Participating Frequently
August 11, 2015

Hi, xiriusly.

The eoclip operator clips to the current path using even-odd logic. The problem with your code is that there is no current path at the time you call eoclip; you are therefore clipping to an empty path, that is, a path with no interior. Your imageable region ends up being a space of 0 area.

Add something like this before your call to eoclip and you should see part of your image appear:

12 0 moveto

30 0 rlineto

-15 20 rlineto

closepath

Now your call to eoclip will make the imageable region the interior of this triangle.

Hope this helps.

- John Deubert

===============

Acumen Training

PostScript & PDF

Consulting & Training

john@acumentraining.com

www.acumentraining.com

===============