Skip to content
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

Bug using Ghostscript to generate pdf/eps files #79

Closed
chrede88 opened this issue Jun 19, 2015 · 6 comments
Closed

Bug using Ghostscript to generate pdf/eps files #79

chrede88 opened this issue Jun 19, 2015 · 6 comments

Comments

@chrede88
Copy link

Hi,

I have after many hours finally figured out why Ghostscript failed on specific figures (e.g. not all).
I'm not sure if it is a Ghostscript or export_fig bug. But you guys should be able to figure that out pretty fast.

I'm running Ghostscript 9.15 (home brew install) and the newest export_fig (downloaded today) on a mac running OS 10.10.3 (Yosemite). I'm running Matlab R2014b.

So, here is the problem:
I can only export figures without a prefix (e.g. x10^-3). See photos:
screen shot 2015-06-19 at 22 52 55
screen shot 2015-06-19 at 22 53 12

Matlab/Ghostscript throws the following error if the figure contains a prefix:

Error: /typecheck in /findfont
Operand stack:
   CMSY10
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1951   1   3   %oparray_pop   1950   1   3   %oparray_pop   --nostringval--   1934   1   3   %oparray_pop   1820   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1903   1   3   %oparray_pop
Dictionary stack:
   --dict:1180/1684(ro)(G)--   --dict:0/20(G)--   --dict:121/200(L)--
Current allocation mode is local
Last OS error: Invalid argument
Current file position is 71000
GPL Ghostscript 9.15: Unrecoverable error, exit code 1
Ghostscript error: perhaps /private/tmp/tp6b10bd40_3cfd_4cfd_950a_3a9dcd9e8928.pdf is open by some other application
export_fig error. Please ensure:
  that you are using the latest version of export_fig
  and that you have Ghostscript installed
  and that you do not have multiple versions of export_fig installed by mistake
  and that you did not made a mistake in the expected input arguments

If the problem persists, then please report a new issue.

Error using eps2pdf (line 149)
Error: /typecheck in /findfont
Operand stack:
   CMSY10
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2
   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1
   %stopped_push   1951   1   3   %oparray_pop   1950   1   3   %oparray_pop
   --nostringval--   1934   1   3   %oparray_pop   1820   1   3   %oparray_pop
   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--
   --nostringval--   2   %stopped_push   --nostringval--   1903   1   3   %oparray_pop
Dictionary stack:
   --dict:1189/1684(ro)(G)--   --dict:0/20(G)--   --dict:121/200(L)--
Current allocation mode is local
Last OS error: Invalid argument
Current file position is 71000
GPL Ghostscript 9.15: Unrecoverable error, exit code 1


Error in export_fig (line 616)
                eps2pdf(tmp_nam, pdf_nam_tmp, 1, options.append, options.colourspace==2,
                options.quality, options.gs_options);

Issue #27 appears to be on the same topic.

@chrede88
Copy link
Author

Using special latex letters as: \partial in axis labels or in the title also generate the same error.

@altmany
Copy link
Owner

altmany commented Jun 23, 2015

Just before the error there was a red message on your Matlab Command Window "...or maybe the ... options(s) are not accepted by your GS version" - what exactly is written there?

@altmany
Copy link
Owner

altmany commented Jun 23, 2015

Also, please email me (altmany at gmail) the temporary EPS file that is generated (that's the file located in your tempdir folder with a name like /private/tmp/tp6b10bd40_3cfd_4cfd_950a_3a9dcd9e8928.eps).
You can get this file if you place a file anywhere in your eps2pdf.m file and then look at the value of the input parameter source.

@altmany
Copy link
Owner

altmany commented Jul 14, 2015

Christian - you did not answer my request for additional information. I do not have a Mac and I cannot reproduce this error, so I need your assistance in order to solve this issue.

As noted, I need to know the contents of the ...or maybe the ... options(s) are not accepted by your GS version message that is displayed next to the error, as well as get the temporary EPS file that is generated in your /private/tmp/ folder.

@wrg11
Copy link

wrg11 commented May 19, 2016

I had a similar problem, but not with export_fig. I was importing figures into a LaTeX document by exporting from Matlab with 'print -deps' and then relying on the application (TeXshop) to convert to pdf with ghostscript. I also verified that it was a ghostscript problem with a command-line call: 'gs myfig.eps'; this gave more diagnostic info suggesting that the issue was with a missing font. There's a happy ending though, because I came across export_fig while looking for a solution, and 'export_fig myfig -pdf' works smoothly. I guess this means you aren't interested in pursuing the problem, but if you are I can happily supply details, files etc.

@altmany
Copy link
Owner

altmany commented May 19, 2016

@wrg11 - thanks for the reminder that this issue has been open way too long without any response from @chrede88, so I'm closing this issue. If anyone believes it should remain open, then please supply specific reproducible steps and details that might help track it down.

@altmany altmany closed this as completed May 19, 2016
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

No branches or pull requests

3 participants