如何在 Mathematica 中将 .eps 转换为 .pdf(也许使用 GhostScript?)?
最佳答案
安装后GhostScript并设置适当的环境变量(对于 Windows,您 should 将 gs\bin
和 gs\lib
添加到 PATH
,其中 gs
是顶级 Ghostscript 目录)您可以使用 Jens Nöckel's method将 .eps 转换为 .pdf(所有字形都将被概述):
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
。
另一种基于Kurt Pfeifle' code的方法(没有字体轮廓):
gsEPS2PDFEmbedFonts[epsPath_String, pdfOutputPath_String] :=
Run["gswin64c.exe -sFONTPATH=c:/windows/fonts -o \"" <>
pdfOutputPath <>
"\" -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress \"" <> epsPath <>
"\""]
这里c:/windows/fonts
是字体所在的目录。另请参阅here有关 GhostScript 命令行参数的信息。
关于wolfram-mathematica - 如何在 Mathematica 中将 .eps 文件转换为 .pdf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18647607/