Thanks to visit codestin.com
Credit goes to github.com

Skip to content

showpage at the end of .eps files #4992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2015
Merged

showpage at the end of .eps files #4992

merged 1 commit into from
Aug 26, 2015

Conversation

ParfenovS
Copy link
Contributor

There can be problems with viewing of *.eps files using evince or okular. See, for example, this thread:
https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1348384
There are the same problems in the last releases of Fedora. Note that the same *.eps files which can not be viewed with evince/okular can be opened and viewed with inkscape, ghostscript etc.
These commits allow to avoid such problems. I understand that *.eps files without showpage at the end are valid. But the presence of showpage is allowed and should not lead to some problems.

There can be problems with viewing of *.eps files using evince or okular. See, for example, this thread:
https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1348384
There are the same problems in the last releases of Fedora. Note that the same *.eps files which can not be viewed with evince/okular can be opened and viewed with inkscape, ghostscript etc.
These commits allow to avoid such problems. I understand that *.eps files without showpage at the end are valid. But the presence of showpage is allowed and should not lead to some problems.
@mdboom
Copy link
Member

mdboom commented Aug 26, 2015

Seems fine to me.

@mdboom mdboom added this to the next point release milestone Aug 26, 2015
@WeatherGod
Copy link
Member

@mdboom, any reason you didn't merge this?

@mdboom
Copy link
Member

mdboom commented Aug 26, 2015

No -- just wanted to give it more time in case anyone else had more comments.

@WeatherGod
Copy link
Member

My only question (and this arises out of naiveness of eps) is that it looks like there is eps code that is emitted further up that defines a "showpage" function. Would that cause any conflicts (or is that exactly what is supposed to happen)?

@ParfenovS
Copy link
Contributor Author

emitted further up that defines a "showpage" function

Indeed, this operator can be redefined. According to eps specification:
The showpage operator is permitted in EPS files because it is present in so
many PostScript language files. Therefore, it is reasonable for an EPS file to
use the showpage operator, although it is not necessary if the EPS file will
only be imported into another document. The application importing the EPS
file is responsible for redefining showpage. showpage may be redefined
using the following code segment:
/showpage { } def

As I understand the situation is following.
The very correct eps file should not contain showpage at its end. It allows to import such files correctly (for example, in some documents). But many eps files actually have showpage at its end. Redefenition like /showpage { } def allows to deal with such not very correct files as it zeros this operator if it's present at the end. Thus, the presence of such operator at the end should not affect importing eps file as a program or library can deal with such redefinition (cairo, inkscape, gs can).

The same is said in following link:
http://paulbourke.net/dataformats/postscript/
"There shouldn't be a showpage, since EPS is designed to be included inside other documents a showpage would obviously ruin the intended effect. In reality most programs that import EPS redefine showpage so that if it does exist it doesn't cause problems, a common definition is "/showpage { } def""

tacaswell added a commit that referenced this pull request Aug 26, 2015
FIX: eps will work in more viewers

Add a 'showpage' command at the end of the file.
@tacaswell tacaswell merged commit 0c48667 into matplotlib:master Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants