【问题标题】:Running a postscript file on cygwin在 cygwin 上运行 postscript 文件
【发布时间】:2015-10-05 17:45:43
【问题描述】:

我编写了一个小的 c++ 代码来生成一个 postscript 文件。我已经安装了 ghostscript 查看器。我正在尝试在 cygwin 中打开 .ps 文件,但出现以下错误。

$ gs.exe fill_rect_chd.ps
GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 9.15: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
GPL Ghostscript 9.15: Cannot open X display `(null)'.
Unrecoverable error: ioerror in setpagedevice
Operand stack:
    true  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--  --nostringval--

我是 postscript 的新手。这是 .ps 文件中的代码

$ cat fill_rect_chd.ps
1 0 0 setrgbcolor
0 0 moveto
100 0 lineto
100 100 lineto
0 100 lineto
 fill

谁能建议/帮助我解决这个错误。

【问题讨论】:

  • 这里c++有什么相关性?删除了标签。询问时显示 C++ 代码。
  • 您好像没有运行 X 服务器。

标签: cygwin ghostscript postscript


【解决方案1】:

如评论所述,您需要(安装并)运行 x.org X-server 程序(Cygwin 附带:选择 X11:xinit 包)才能打开图形窗口。或者您可以安装 Windows 版本的 ghostscript。

【讨论】:

    【解决方案2】:

    我无法弄清楚 Cygwin,但我在我的 Windows 上安装了 GSview,这很容易打开一个“.ps”文件。

    感谢大家的帮助,我将安装服务器 X 并检查。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-08
      • 1970-01-01
      • 2012-02-11
      • 1970-01-01
      • 2018-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多