[cairo-bugs] [Bug 43634] New: EPS output works poorly with dvips

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Dec 8 08:20:44 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=43634

             Bug #: 43634
           Summary: EPS output works poorly with dvips
    Classification: Unclassified
           Product: cairo
           Version: 1.10.3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: postscript backend
        AssignedTo: ajohnson at redneon.com
        ReportedBy: tommie at spotify.com
         QAContact: cairo-bugs at cairographics.org


The PostScript surface pushes the userdict onto the dictionary stack in its
setup code when in EPS mode. This (sometimes) causes problems when dvips
includes the EPS image, due to the "showpage" command not being a no-op if it
happens to be in userdict.

This is probably what causes
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620146 as well.

The dvips decorations for EPSes essentially does

  /SDict 200 dict def
  ...
  SDict begin
  /showpage {} def
  [insert EPS]
  end

However, the EPS generated by Cairo turns this into

  /SDict 200 dict def
  ...
  SDict begin
  /showpage {} def
  userdict begin
  [insert rest of EPS]
  end
  end

and if userdict happens to contain a non-nooped showpage, this will cause the
showpage redefinition to be ignored.

The way I interpret the EPS 3 specification, section 2.4 is that you shouldn't
use userdict:

  There are some PostScript language operators plus
  statusdict and userdict operators that are intended
  for system-level jobs or page descriptions that are
  not appropriate in an EPS file.

and 3.2 hints that you should create your own dictionary instead:

  [...] Ideally, the imported EPS file should create
  its own dictionary, but if it does not, [...]

I had a quick look at an Illustrator-generated EPS, and it creates a dict of 75
entries and uses that as the top-of-dictionary-stack, something like:

  /dict_count countdictstack def
  75 dict begin
  [insert rest of EPS]
  countdictstack dict_count sub {end} repeat

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the cairo-bugs mailing list