Graphics, Figures & Tables"MiKTeX EPS-to-PDF Converter" did not succeed

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
chauve4life
Posts: 1
Joined: Wed Oct 03, 2018 6:58 pm

"MiKTeX EPS-to-PDF Converter" did not succeed

Post by chauve4life »

Bonjour,

J'aimerais sur Matlab utiliser epstopdf (j'ai utilisé MikTeX pour installer le package epstopdf) pour convertir automatiquement un fichier EPS en un fichier PDF. A vrai dire, c'est intégré dans un programme pour imprimer en PDF une figure faite sur Matlab avec des fonts différentes de celles qu'on peut utiliser (Helvetica, Courier, Times-Roman), et j'ai suivi le tuto suivant http://isa.uniovi.es/~guerrero/FontExam ... eFiles.zip. En gros l'histoire c'est d'imprimer en EPS avec une police utilisable (Helvetica par exemple) et d'appliquer un post traitement sur l'EPS pour retrouver la bonne font. Une fois cela réalisé, on converti l'EPS en PDF, et c'est là que ça bloque. Voici le programme:

%Ici j'ai créé ma figure avec la police LM Sans 12, je ne le met pas car pas interessant

%1- Preprocess. Remap the fonts to the Matlab subset
% Find font objects
font1 = findall(gcf,'fontname','LM Sans 12');

%2- Replace fonts
% Important Note: axes font must be remapped BEFORE the xlabel and ylabel
% remap
set(font1,'fontname','Helvetica','fontweight','bold'); % Remap to Helvetica-Bold

%3- Obtain the eps file using print
file_name = 'B07';
%set(fig,'paperpositionmode','auto','units','centimeters','paperunits','centimeters','papersize',[5 16]);
print(fig,'-depsc','-painters','-r600','-loose',strcat('.\',file_name)); % eps

%4- Postprocess (recover the fonts in figure)
set(font1,'fontname','LM Sans 12','fontangle','normal','fontweight','light');

%5- Obtain the pdf file using epstopdf (included for instance in MikTex)
system(sprintf('epstopdf --gsopt="-sFONTMAP=""C:/Users/BBB/Desktop/General/FontExample2.gs"" -sFONTPATH=C:/Windows/Fonts -dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/prepress" "%s.eps"',strcat('.\',file_name)));

----------

FontExample2.gs contient la chose suivante:

/Helvetica-Bold (C:/WINDOWS/Fonts/lmsans12-regular_0.otf) ;

----------

Quand je lance mon programme j'ai:

Unrecoverable error: undefinedfilename in C:/Users/BBB/Desktop/General/FontExample2.gs -sFONTPATH=C:/Windows/Fonts -dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/prepress

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

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

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

----------

Dans le log j'ai:

2018-10-03 12:52:40,833-0400 INFO epstopdf - starting with command line: epstopdf "--gsopt=-sFONTMAP="C:/Users/BBB/Desktop/General/FontExample2.gs" -sFONTPATH=C:/Windows/Fonts -dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/prepress" .\B07.eps

2018-10-03 12:52:41,061-0400 FATAL epstopdf - Invalid argument

2018-10-03 12:52:41,061-0400 FATAL epstopdf - Info:

2018-10-03 12:52:41,061-0400 FATAL epstopdf - Source: Libraries\MiKTeX\Core\Stream\FileStream.cpp

2018-10-03 12:52:41,061-0400 FATAL epstopdf - Line: 61

--------

Je n'arrive pas à trouver où j'ai fait l'erreur d'argument :'(

Merci beaucoup à ceux qui prendront le temps de m'aider :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

"MiKTeX EPS-to-PDF Converter" did not succeed

Post by Stefan Kottwitz »

Welcome to the forum!

We speak English here. You are welcome to post your questions at out French partner site TeXnique.fr.

Stefan
LaTeX.org admin
Post Reply