chi*_*NUT 5 pdf postscript imagemagick gimp ghostscript
我想尝试手动编写PostScript文件.为什么?为什么不.从维基百科,我复制并粘贴了他们的基本Hello World程序,PostScript其中包括:
%!PS
/Courier             % name the desired font
20 selectfont        % choose the size in points and establish 
                     % the font as the current one
72 500 moveto        % position the current point at 
                     % coordinates 72, 500 (the origin is at the 
                     % lower-left corner of the page)
(Hello world!) show  % stroke the text in parentheses
showpage             % print all on the page
Run Code Online (Sandbox Code Playgroud)
当我试图打开它时GIMP,我明白了
打开'Hello World.ps'失败了.无法解释文件'Hello World.ps'
我可以ImageMagick用来转换文件
convert "Hello World.ps" "Hello World.pdf"
convert "Hello World.ps" "Hello World.eps"
Run Code Online (Sandbox Code Playgroud)
PDF打开成功并在Courier中显示"Hello World".EPS产生与PS相同的误差.
PS文件的语法有问题吗?
PS文件是不是要直接查看,而应该以PDF等包含格式查看?
GIMP是否无法处理这种特定格式的PS文件?
要逐一回答您的问题:
你的PostScript文件完全没问题.
如果您使用支持PostScript的查看器,则可以直接查看PostScript文件.(顺便说一句:PDF可能被视为'容器格式' - 但它永远不会嵌入PostScript文件来'查看'...)
要使Gimp能够处理PS/EPS文件,您需要在系统上使用Ghostscript(安装链接).
与点'3'相同 对于您的convert命令是正确的:除非本地系统上有可用的功能Ghostscript安装,否则ImageMagick无法处理PS/EPS或PDF输入文件.这可以作为一个所谓的"委托",由ImageMagick用来处理它无法处理的文件格式.代理人将这种格式转换为光栅文件,然后ImageMagick可以接管进行进一步处理.
要检查可用的ImageMagick委托,请运行以下命令:
convert -list delegate
convert -list delegate | grep -Ei --color '(eps|ps|pdf)' 
Run Code Online (Sandbox Code Playgroud)