wolfram-mathematica - 如何在 Mathematica 中将 .eps 文件转换为 .pdf?

标签 wolfram-mathematica ghostscript

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

最佳答案

安装后GhostScript并设置适当的环境变量(对于 Windows,您 shouldgs\bings\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/

相关文章:

java - 如何创建虚拟磁盘空间以避免节省硬盘空间?

pdf - 使用 Ghostscript 从 PDF 中提取文本 - 未知设备 : txtwrite

pdf - 从 PDF 创建 JPG 缩略图会导致新版 ImageMagick 出现问题

pdf - 使用 GhostScript 为从 PDF 转换的 Jpeg 设置自动高度/宽度

执行 Ghost4J 时出现 java.lang.IllegalStateException(Linux 32 位与 64 位)

wolfram-mathematica - 在Mathematica中的笔记本中列出所有用户定义的变量和函数

wolfram-mathematica - ...Values 的 "Sort"选项有什么作用?

python - 在 blender 外运行 Blender python 脚本

plot - Mathematica 中带有两个数据集的 ListPlot

python - 用奇异矩阵计算求解方程组