【发布时间】:2012-04-29 10:36:00
【问题描述】:
我有最新的 GPL Ghostscript v9.05,我在 Win 32 位系统上运行它。在我的 XP 机器上,这两个命令
ps2pdf -v -
和
rungs -v (used internally by TeXLive)
Ghostscript 9.05 报告如下:
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
在另一台 Win 7 计算机上,命令
ps2pdf -v -
在命令行中不被识别为有效的ps2pdfsyntax,但rungs -v 工作正常。
我在互联网上阅读了有关在此处为 Ghostscript 设置临时目录的信息:
http://schlingel.bplaced.net/?p=54
它基本上说要编辑Ghostscript的lib文件夹中的gssetgs.bat文件并添加以下行:
set path=%ProgramFiles%\gs\gs9.02\lib;%ProgramFiles%\gs\gs9.02\bin;%windir%\SysWOW64
set TMP=%YOUR_TEMP%
set TEMP=%TMP%
在我的例子中,这需要通过将 9.02 替换为 9.05 来进行适当的修改。现在在 Win 7 上,关于临时文件夹的最后两行应该如何?我可以为Set TMP 提供如下:
set TMP=%"C:\Users\hihi\AppData\Local\Temp"%
语法正确吗?
我还将tmp 和temp 变量放在我的环境变量中。
更新
A.使用ps2pdf,下面是我在我的Win 7 机器上将PS 转换为PDF 文件的方法,但出现错误:
C:\work\misc>ps2pdf -dNOSAFER -sDEVICE=pdfwrite -r720 -dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dEPSCrop "%1.ps" "%1.pdf"
Unknown device:
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
defaultdevice
注意:以上命令在我的 Win XP 机器上运行良好!
B.在这里使用gswin32c 是我如何在我的Win 7 机器上将PS 转换为PDF 文件,这工作:
C:\work\misc>gswin32c.exe -o "%1.pdf" -dNOSAFER -sDEVICE=pdfwrite -r720 dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dNumRenderingThreads=2 -c "60000000 setvmthreshold" -f -dEPSCrop "%1.ps"
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Regu font from %rom%Resource/Font/NimbusSanL-Regu... 2837152
1454727 4413848 3026018 1 done.
Loading Dingbats font from %rom%Resource/Font/Dingbats... 2837152 1510862 457461
6 3180865 1 done.
Loading NimbusSanL-Bold font from %rom%Resource/Font/NimbusSanL-Bold... 2857248
1553499 4655000 3251960 1 done.
注意:上面的命令在我的 Win XP 机器上也可以正常工作
总结:我的 Win 7 机器上的 ps2pdf 有问题。
新功能(2012 年 5 月 9 日)
当我按照 Ken 的建议 rem 最后两行时,我得到了这样的结果:
C:\work\misc>ps2pdf -dNOSAFER -r720 -dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dEPSCrop "%1.ps" "%1.pdf"
Unrecoverable error: typecheck in .putdeviceprops
avoiding clean up
temp 文件夹有你提到的那些临时文件。
_.at的内容:
-dCompatibilityLevel#1.4
-dNOSAFER
-r720
-dCompatibilityLevel
_.at2的内容:
-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite
-sOutputFile#-dUseFlateCompression
-dCompatibilityLevel#1.4
-dNOSAFER
-r720
-dCompatibilityLevel
-c .setpdfwrite -f1.5
5 月 11 日更新
注意:现在在我的 win 7 机器上运行良好
C:\work\misc>ps2pdf -dNOSAFER -r720 -dCompatibilityLevel#1.5 -dUseFlateCompression#true -dMaxSubsetPct#100 -dSubsetFonts#true -dEmbedAllFonts#true -dEPSCrop "defense.ps" "defense.pdf"
avoiding clean up
_.at的内容:
-dCompatibilityLevel#1.4
-dNOSAFER
-r720
-dCompatibilityLevel#1.5
-dUseFlateCompression#true
-dMaxSubsetPct#100
-dSubsetFonts#true
-dEmbedAllFonts#true
-dEPSCrop
_.at2的内容:
-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite
-sOutputFile#"defense.pdf"
-dCompatibilityLevel#1.4
-dNOSAFER
-r720
-dCompatibilityLevel#1.5
-dUseFlateCompression#true
-dMaxSubsetPct#100
-dSubsetFonts#true
-dEmbedAllFonts#true
-dEPSCrop
-c .setpdfwrite -f"defense.ps"
谢谢。
【问题讨论】:
标签: windows ghostscript