linux - Ghostscript:如何包含它过去包含的 Apple ImageWriter 驱动程序?

标签 linux macos ghostscript

过去,Ghostscript用于合并这些 Apple Imagewriter 设备:iwhiiwloiwlq。我一直使用的版本是 gs 8.7,它不兼容 64 位。 macOS Catalina 无法使用它或任何其他 32 位代码,因此无法打印到这些设备。

更多最新版本,包括最新 Ghostscript 9.27省略那些设备。我不知道它们是什么时候被遗漏的,也不知道为什么遗漏了,但似乎是很久以前的事了。更糟糕的是,我不知道它们是如何被纳入 Ghostscript 的。除了从源代码构建 gs(我已经完成)外,我不知道从哪里开始。新的 Ghostscript 9.27 本身在 macOS Catalina 中运行良好。它包括许多“内置”设备,但没有我需要的 ImageWriter 设备。

驱动程序和 Ghostscript 最初是从 Linux 基金会的 Open Printing 网站获得的:https://openprinting.org/printer/Apple/Apple-ImageWriter_II ,但它们以最新 macOS 版本无法处理的包形式捆绑和分发。该网页还表明驱动程序是“类型:Ghostscript 内置”,在最新版本中不再存在。

这里是使用安装的 32 位版本的 gs -h:

GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: bbox
Available devices:
   alc1900 <snip> inferno iwhi iwlo iwlq jetp3852 jj100 <many other devices> <snip>
Search path:
   . : %rom%Resource/Init/ : %rom%lib/ :
   /usr/local/share/ghostscript/8.71/Resource/Init :
   /usr/local/share/ghostscript/8.71/lib :
   /usr/local/share/ghostscript/8.71/Resource/Font :
   /usr/local/share/ghostscript/fonts :
   /usr/local/share/fonts/default/ghostscript :
   /usr/local/share/fonts/default/Type1 :
   /usr/local/share/fonts/default/TrueType : /usr/lib/DPS/outline/base :
   /usr/openwin/lib/X11/fonts/Type1 : /usr/openwin/lib/X11/fonts/TrueType :
   /usr/share/cups/fonts
Initialization files are compiled into the executable.
For more information, see /usr/local/share/ghostscript/8.71/doc/Use.htm.
Please report bugs to bugs.ghostscript.com.
iMac4:ghostscript-9.27 john$ 

明显的症结就在我面前:“初始化文件被编译成可执行文件。”我知道,但是需要包含或修改哪些初始化文件(如果有的话)以确保将它们合并到构建中?我有用于 ImageWriter 的打印机 PPD。它们只是文本文件,我认为它们是必需的。他们应该吗?怎么办?

我尝试从源代码构建 gs 的唯一方法是使用 ./configure 然后是 make 这开始了一个需要几分钟的漫长编译过程,并且生成在 Catalina 中运行良好的可执行文件 gs。问题是它不包括我想要的驱动程序。尝试打印到该打印机会导致它以纯 ASCII 文本(非位图)打印“未知设备:iwhi”。

到现在为止,我应该很痛苦地明显地感到头晕目眩,不知道该转向哪里。谁能从这里为我指出正确的方向?

一些背景可以在这里找到:Apple ImageWriter printer installation in… - Apple Community .我写的。它的一些链接已经失效。如果图片未加载,而您想查看它,请单击它(这是站点问题)。

此处描述了最近的讨论:32-bit ghostscript, required for ImageWriter and other printers using CUPS

最佳答案

引用的设备已在此 commit 中删除如果您需要它们,那么您应该能够:

  1. 克隆我们的 git 存储库,这方面的帮助是 here
  2. git checkout a87e380acd5e326f7d4e4380348bac393fac3058
  3. 将 ghostpdl/devices/gdevadmp.c 文件复制到方便的地方
  4. git checkout master(或者如果你想要一个标记版本而不是前沿代码,例如 git checkout ghostpdl-9.27)
  5. 将保存的文件复制回ghostpdl/devices/gdevadmp.c
  6. 撤消 contrib.mak、configure.ac 和 unix-gcc.mak 中的更改 (使用 link 到 gitweb 你可以看到差异,它们不是 广泛)
  7. 在 ghostpdl 目录中:./autogen.sh 然后是 make

所有这些都假设您有一个可用的 C 编译器(gcc、make 等)和开发环境,但是您说您已经从源代码构建了 GS,所以应该没问题。最终结果应该是一个带有内置附加设备的唤醒 Ghostscript。

这个:

Initialization files are compiled into the executable.

指的是 PostScript 初始化文件,对于用 C 编写且必须编译的设备,它不会帮助您。虽然上面的行在技术上是正确的,但您可以使用 -I 开关来覆盖 ROM 文件系统(它指的是什么)并将初始化文件存储在磁盘上。

PPD 文件不会帮助您使用 Ghostscript,这些是 PostScript 打印机描述文件,它们被生成 PostScript 的应用程序用来为特定打印机定制 PostScript 程序。这些(我认为)被 CUPS 使用,但不是被 Ghostscript 使用。

关于linux - Ghostscript:如何包含它过去包含的 Apple ImageWriter 驱动程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58348378/

相关文章:

R 无法识别 GhostScript 以嵌入 eps 图

macos - cocoa:从 Mail.app 读取邮件

windows - 适用于 Windows 的自定义 USB 驱动程序?苹果电脑?

macos - 在 Mac 上设置 git/github : error on reading usr/local/etc/gitconfig

c++ - 无法打开 Windows GDI 打印机驱动程序

linux - 在调用 shell 时设置环境变量的最佳方法

linux - 工作窃取和内核级线程

c - 程序仅在首次运行时挂起?

linux - GNU Radio 和野生动物追踪

c# - 将 PDF 转换为图像 - 库或命令行 - 免费