EPS images and MS Word

I have been looking at the problem of figures saved as EPS images not printing correctly under from MS Word (an invalidrestore error is generated). I believe that matplotlib is incorrectly creating the EPS file. According to the DSC Spec (http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf), the Prolog section should only contain procset definitions (which should also be enclosed in %%BeginResource / %%EndResource pairs). It looks like the generated EPS files contain an ordinary dictionary definition as well as font information in the Prolog. I believe these commands should more properly be moved to the Script section of the document (perhaps within the %%BeginSetup/%%EndSetup sub-section).

I manually edited an EPS file to make the prolog empty, and moved the mpldict definition to the body of the file, and it then worked fine with MS Word.

Dave Baum

This is great Dave -- could you send a patch against backend_ps for us?

Thanks,
JDH

ยทยทยท

On 6/4/07, Dave Baum <Dave.Baum@...1630...> wrote:

I have been looking at the problem of figures saved as EPS images not
printing correctly under from MS Word (an invalidrestore error is
generated). I believe that matplotlib is incorrectly creating the
EPS file. According to the DSC Spec (http://partners.adobe.com/
public/developer/en/ps/5001.DSC_Spec.pdf), the Prolog section should
only contain procset definitions (which should also be enclosed in %%
BeginResource / %%EndResource pairs). It looks like the generated
EPS files contain an ordinary dictionary definition as well as font
information in the Prolog. I believe these commands should more
properly be moved to the Script section of the document (perhaps
within the %%BeginSetup/%%EndSetup sub-section).

I manually edited an EPS file to make the prolog empty, and moved the
mpldict definition to the body of the file, and it then worked fine
with MS Word.