2

I wish to include eps images generated from Matlab plot (pdf is generated by Matlab as a whole page, that's why eps), however the conversion fails, leaving blank pdf image. The messaghe is:

MiKTeX GPL Ghostscript

9.25: Unrecoverable error, exit code 1



Sorry, but "MiKTeX EPS-to-PDF Converter" did not succeed. The log file hopefully contains the information to get MiKTeX going again: C:\Users\Andrey\AppData\Local\MiKTeX\2.9\miktex\log\epstopdf.log

The content of the log file

2019-12-03 06:29:05,797+0100 INFO  epstopdf - starting with command line: epstopdf --outfile=images/kkk-eps-converted-to.pdf images/kkk.eps
2019-12-03 06:29:06,456+0100 FATAL epstopdf - Invalid argument
2019-12-03 06:29:06,457+0100 FATAL epstopdf - Info: 
2019-12-03 06:29:06,457+0100 FATAL epstopdf - Source: Libraries\MiKTeX\Core\Stream\FileStream.cpp
2019-12-03 06:29:06,457+0100 FATAL epstopdf - Line: 68

I have recently installed and updated Miktex and compile with LuaLatex.

Here is the content of the eps, if needed https://pastebin.com/1Rq86vVC

What is wrong with it? I have no idea what to do about it.

Update First of all I'd like to that I do compile with --shell-ecape (from TexStudio)

Process started: lualatex.exe --shell-escape -synctex=1 -interaction=nonstopmode 

I tried suggestion from Christian Shenk. The command is

mgs.exe -q -sDEVICE=pdfwrite -dSAFER -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=images/kkk-eps-converted-to.pdf - -c quit

I tried to execute it in command processor. It creates a 0 byte pdf file and gets stuck.

Update 2

I executed

epstopdf --outfile=images/kkk-eps-converted-to.pdf images/kkk.eps

And I did get additional information

Error: /invalidfont in /findfont
Operand stack:
   Helvetica-BoldOblique
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   --nostringval--   1967   1   3   %oparray_pop
Dictionary stack:
   --dict:973/1684(ro)(G)--   --dict:0/20(G)--   --dict:123/200(L)--
Current allocation mode is local

I have no clue how I can fix it. It mentions something about "Helvetica-BoldOblique", but the images don't use it, but regular Helvetica.

  • are you running the command with shell-escape? Could you give us a Minimal Working Example of a tex file that recreates the problem? – Elad Den Dec 3 '19 at 6:45
  • @EladDen you shouldn't need shell escape here (restricted epstopdf is allowed by default) – David Carlisle Dec 3 '19 at 10:16
  • You can execute Ghostscript manually in order to get more information: epstopdf -n --outfile=images/kkk-eps-converted-to.pdf images/kkk.eps will show you the command to execute. – Christian Schenk Dec 3 '19 at 11:07
  • 1
    I do not get any error. Make sure you have all packages mentioned here github.com/MiKTeX/miktex-packaging/issues/112 installed, you are maybe missing some font. – ivankokan Dec 3 '19 at 20:45
  • 1
    @ivankokan I have absolutely no idea. That is what epstopdf showed after executing commabd by Christian Schenk. But you were right about packages. Almost none were installed. I installed them and this solved the problem . You may post it as an answer for extra rep ;). I expected, however, Miktex to install missing packages. – Andrey Pro Dec 3 '19 at 21:15
3
  • About -n option

Christian suggested to use -n option to get the insight of the used command, e.g.

epstopdf -n --outfile=images/kkk-eps-converted-to.pdf images/kkk.eps

What you got is

mgs.exe -q -sDEVICE=pdfwrite -dSAFER -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=images/kkk-eps-converted-to.pdf - -c quit

and it got stuck because it waited for the input file/stream (lesson learned here: https://github.com/MiKTeX/miktex/issues/393#issuecomment-543080026).

So, running

mgs.exe -q -sDEVICE=pdfwrite -dSAFER -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=images/kkk-eps-converted-to.pdf - -c quit < images/kkk.eps

will do.

  • Error: /invalidfont in /findfont

I guess you do not have the necessary fonts installed within your MiKTeX. Make sure you have all the packages mentioned here https://github.com/MiKTeX/miktex-packaging/issues/112 installed and try again.

EDIT: I had no problems with converting your file. Then I uninstalled only helvetic package and got the error you got:

Error: /invalidfont in /findfont
Operand stack:
   Helvetica-BoldOblique
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   --nostringval--   1967   1   3   %oparray_pop
Dictionary stack:
   --dict:973/1684(ro)(G)--   --dict:0/20(G)--   --dict:123/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
MiKTeX GPL Ghostscript 9.25: Unrecoverable error, exit code 1

Sorry, but "MiKTeX EPS-to-PDF Converter" did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\user\AppData\Local\MiKTeX\2.9\miktex\log\epstopdf.log

Therefore, missing helvetic package was the root cause of your issue.

I also created an issue (actually a suggestion for possible enhancement): https://github.com/MiKTeX/miktex/issues/429.

| improve this answer | |
  • This solved my problem. Thanks! – mwoua Apr 17 at 20:32
1

I solved this problem:

Step 1: Remove the entire MikTeX exists on your computer using the Control Panel, after removing deleted folder named MikTeX in C:\ Program files (x86 ) to avoid errors when resetting because the same name folder (uninstall is complete without restarting the computer)

Step 2: Reinstall the MikTeX below (no need to install the program editor as texstudio, Texmaker, viettex, ...), this error is due to foundation MikTeX

MikTeX file download link: click here

After downloading, you unzip. Installation file named setup-2.8.3553.exe in directory MikTeX /setup

Step 3: Install the file setup-2.8.3553.exe as usual, remember to tick select Complete MikTeX to install the full version.

Note when using:

Note 1: The order declaring the package ordered to order from top to bottom as follows:

  1. \ usepackage {graphicx}

  2. \ usepackage {epstopdf}

  3. \ usepackage {subfigure}

Note 2: Before running TeX files, please ensure that you have deleted the corrupted PDF files are output from run error before (just leave a tail .eps image file)

Coppy right: https://nhcan.wordpress.com/2020/04/05/loi-khi-bien-dich-file-latex-co-hinh-anh-dinh-dang-eps/

| improve this answer | |
0

This problem is due to a known issue with the current MiKTeX package. See https://github.com/MiKTeX/miktex-packaging/issues/112

A possible workaround that worked for me is to install the "helvetica" package (plus, any other font used by the Matlab code) using the MiKTeX Console.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.