Clear Filters
Clear Filters

Problem with export_fig - eps2pdf

10 views (last 30 days)
Joppy
Joppy on 21 Oct 2017
Commented: Jan on 23 Oct 2017
I keep receiving the following error code when trying to use export_fig for .eps images. I have the latest copy of export_fig, Ghostscript, Xpdfreader/tools (pdftops), and I don't think I'm making any syntactical errors since I can save a .png without error.
Ghostscript error: perhaps C:\Users\-\AppData\Local\Temp\tp0529ef87_f6a2_44f2_bcb9_a061dc5608cf.pdf is open by another application
or maybe you have another gs executable in your system's path
Ghostscript options: -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="C:\Users\-\AppData\Local\Temp\tp0529ef87_f6a2_44f2_bcb9_a061dc5608cf.pdf" -dEPSCrop -sFONTPATH="C:\Windows\Fonts" -f "C:\Users\-\AppData\Local\Temp\tp9407d70e_bf3a_43bd_b0f1_b3d1844f732e.eps"
export_fig error. Please ensure:
that you are using the latest version of export_fig
and that you have Ghostscript installed
and that you have pdftops 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 164)
Error: /syntaxerror in -file-
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 2015 1 3 %oparray_pop 2014 1 3 %oparray_pop --nostringval-- 1998 1 3
%oparray_pop 1884 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push
Dictionary stack:
--dict:996/1684(ro)(G)-- --dict:0/20(G)-- --dict:123/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 7908
GPL Ghostscript 9.22: Unrecoverable error, exit code 1
Error in export_fig (line 674)
eps2pdf(tmp_nam, pdf_nam_tmp, 1, options.append, options.colourspace==2, options.quality, options.gs_options);
Error in Data_V1 (line 1288)
export_fig TEST -transparent -eps
I know it's a bit of a long shot, but I would appreciate any suggestions.

Answers (1)

Jan
Jan on 21 Oct 2017
Start with checking the error message:
C:\Users\-\AppData\Loca\Temp\tp0529ef87_f6a2_44f2_bcb9_a061dc5608cf.pdf
Is this really a "-" in the user name? Does the file exist? Is it opened by another process?
or maybe you have another gs executable in your system's path
Please check this also.
p = strsplit(getenv('PATH'), pathsep);
Are there several GhostScripts installed?
  2 Comments
Joppy
Joppy on 22 Oct 2017
Edited: Joppy on 22 Oct 2017
Thanks a lot for the response Jan.
There is no "-", the file does exist (it's a blank pdf), it isn't open by another process. At least not that I know of.
Sorry I'm not sure what that command is telling me exactly (number of gs executables?), but it returns this:
'C:\Windows\system32'
'C:\Windows'
'C:\Windows\System32\Wbem'
'C:\Windows\System32\WindowsPowerShell\v1.0\'
'D:\MATLAB\bin'
'D:\Downloads\Putty\'
'C:\Users\username\AppData\Local\Microsoft\WindowsApps'
'D:\Downloads\TeXstudio\New folder\miktex\bin\x64\'
I have uninstalled/reinstalled gs several times, but have made sure to completely remove it before reinstall. I'm beginning to think it has something to do with miktex..?
Jan
Jan on 23 Oct 2017
You can check this without uninstalling MiKTeX: Only remove its folder from the PATH (of Windows, not of Matlab) temporarily and try it again.
The message "Last OS error: No such file or directory" looks important.

Sign in to comment.

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!