如何在Mathematica中将.eps文件转换为.pdf? [英] How can I convert .eps file to .pdf in Mathematica?

查看:210
本文介绍了如何在Mathematica中将.eps文件转换为.pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Mathematica 中(可能使用GhostScript?)将.eps转换为.pdf?

How can I convert .eps to .pdf inside Mathematica (perhaps using GhostScript?)?

推荐答案

安装 GhostScript 并设置适当的环境变量(对于Windows,您应该添加gs\bings\libPATH,其中gs是顶级Ghostscript目录),您可以使用 Jens Nöckel将.eps转换为.pdf的方法(将概述所有字形):

After installing GhostScript and setting appropriate environment variables (for Windows you should add gs\bin and gs\lib to the PATH, where gs is the top-level Ghostscript directory) you can use Jens Nöckel's method for converting .eps to .pdf (all the glyphs will be outlined):

gsEPS2PDF[epsPath_String, pdfPath_String] := 
 Run["gswin64c.exe -sDEVICE=pdfwrite -dNOCACHE -sOutputFile=\"" <> 
   pdfPath <> "\" -q -dbatch -dNOPAUSE \"" <> epsPath <> "\" -c quit"]

此处gswin64c.exe是用于64位Windows系统的GhostScript可执行文件的名称,对于Linux,请用gs替换它.

Here gswin64c.exe is the name of GhostScript executable for 64bit Windows systems, for Linux replace it with gs.

另一种基于 Kurt Pfeifle代码的方法(无字体概述):

Another method based on Kurt Pfeifle' code (without font outlining):

gsEPS2PDFEmbedFonts[epsPath_String, pdfOutputPath_String] := 
 Run["gswin64c.exe -sFONTPATH=c:/windows/fonts -o \"" <> 
   pdfOutputPath <> 
   "\" -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress \"" <> epsPath <> 
   "\""]

此处c:/windows/fonts是字体所在的目录.另请参阅此处,以获取有关GhostScript命令行参数的信息.

Here c:/windows/fonts is the directory where fonts are located. See also here for information about GhostScript command line parameters.

这篇关于如何在Mathematica中将.eps文件转换为.pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆