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

编程入门 行业动态 更新时间:2024-10-28 19:19:49
本文介绍了如何在Mathematica中将.eps文件转换为.pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

推荐答案

安装 GhostScript 并设置适当的环境变量(对于Windows,您应该添加gs\bin和gs\lib到PATH,其中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?

本文发布于:2023-10-30 00:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   中将   文件   如何在   eps

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!