为 Windows 编译的 CUPS 服务器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2844819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CUPS Server compiled for Windows?
提问by Peter Illes
Is there a version of the CUPS server available for Windows? Looking at the CUPS source code it seems it is ready for Visual Studio compilation, but I did not find any trace of an actual supported package. I'd like to set up a CUPS server on Windows so that I can print form Linux/MacOSX/Win clients to printers I set up on this server.
是否有适用于 Windows 的 CUPS 服务器版本?查看 CUPS 源代码,它似乎已准备好进行 Visual Studio 编译,但我没有找到任何实际支持的包的痕迹。我想在 Windows 上设置一个 CUPS 服务器,以便我可以从 Linux/MacOSX/Win 客户端打印到我在这台服务器上设置的打印机。
回答by Kurt Pfeifle
I've got a new answer for you:
我有一个新的答案给你:
Since some time there is a project called
ippsample
on GitHub. It's slowly approaching a mature version 1.0 release.Here are the first two sentences of given as self-description in the mandatory README file:
"This code provides sample implementations of IPP Clients, Printers, and Proxies. It is largely based upon the CUPS software,with substantial changes to the ippproxy and ippserver implementations to make them more general-purpose and configurable."(my emphasis)
This project is hosted by the
ISTO Printer Working Group (PWG)
, the same industry organization which develops and promotes the IPP as a general standard.The
ippserver
,ipptool
,ippfind
,ippproxy
andipptransform
components of the IPP Sample project together make up for a standard-conformingIPP Everywhere
implementation, covering the client as well as the server side of printing.The GitHub code for IPP Sample project is maintained by the very same Mike Sweet who also develops CUPS -- so it's the real thing.
Yes, it compiles and works nicely on Windows, and there are a bunch of
.vclxproj
and.sln
filesavailable to make the build process with MS Visual Studio as smooth as possible.Yes, the IPP Sample code is working and can print to a CUPS server (or receive print jobs from there) running on macOS or any blend of Linux.
No, this is not yet a fully-blown CUPS server for Windows which can serve as a drop-in replacement for a Windows print server. It does not have with ALL the features which would be required.
But if you want to create such a beast:
- this is the place were you would have to poke around first;
- this is were you possibly could fork the code and start adding functionality to get where you want to go.
Oh, and did you know that Apple recently changed the license conditions for CUPSand made it more permissive, moving away from GPL2 to Apache 2.0 licensing?
You have never heard of "IPP Everywhere"before? It is the future of "driverless" printing.
Never heard of "driverless printing"? A slightly modified (and stripped down) version of it already implemented as "Apple AirPrint"for iPhone and iPad devices.
The current implementation of the CUPS-based printing stack includes new pieces of code in the
cups-drivers
projectwhich recently moved to GitHub. This new code implements IPP Everywhere functionality.This
cups-filters
project is under the stewardship by The Linux Foundation's OpenPrinting departmentever since Apple handed over these parts of the original CUPS source code to them when they became no longer useful for macOS but were still important to Linux.What are the basic ideas of driverless printing then?
Have the devices automatically announce their presence and their type of service in the local network. Use the IETF standard protocols
mDNS
andDNS-SD
(which are implemented in macOS under the name of "Bonjour"and in Linux as "Avahi") to take note of the offered services.Tell the print clients that they can use the
IPP
protocol in order to get a query response when they make aget-printer-attributes
request. This request will tell them which set of print options the devices support. The print clients can then show an exactly tailored print dialog to show to the printing user a selection of choices. The print client will also be told what job submission formats each devices supports. This MUST be either PDF or a simple raster format called "PWG-Raster".So... where would you need a specific "printer driver" in such an environment? Everything and everyone can create PDF documents nowadays. Check! No need for a device-specific conversion to any other print language.
Are there printers which support IPP Everywhere already? Oh yes, look here -- they are all said to be fully compliant with the standard:
一段时间以来,
ippsample
在 GitHub 上有一个名为的项目。它正在慢慢接近成熟的 1.0 版本。以下是强制性 README 文件中作为自我描述给出的前两句话:
“此代码提供了 IPP 客户端、打印机和代理的示例实现。它主要基于 CUPS 软件,对 ippproxy 和 ippserver 实现进行了重大更改,使其更加通用和可配置。” (我的重点)
该项目由
ISTO Printer Working Group (PWG)
开发和推广 IPP 作为通用标准的同行业组织主办。在
ippserver
,ipptool
,ippfind
,ippproxy
和ipptransform
在IPP样本项目的组件共同构成了一个符合标准的IPP Everywhere
实施,涵盖了客户端,以及打印的服务器端。IPP 示例项目的 GitHub 代码由同样开发 CUPS 的 Mike Sweet 维护——所以它是真实的。
是的,它编译并很好地工作在Windows,并有一堆
.vclxproj
和.sln
文件服务,令您与MS Visual Studio中的生成过程尽可能顺利。是的,IPP 示例代码正在运行,可以打印到运行在 macOS 或任何 Linux 上的 CUPS 服务器(或从那里接收打印作业)。
不,这还不是 Windows 的成熟 CUPS 服务器,可以作为 Windows 打印服务器的直接替代品。它不具备所需的所有功能。
但是如果你想创造这样一个野兽:
- 这是你必须先四处看看的地方;
- 这是您可能可以分叉代码并开始添加功能以到达您想要去的地方。
哦,您是否知道Apple 最近更改了 CUPS 的许可条件并使其更加宽松,从 GPL2 转向 Apache 2.0 许可?
您以前从未听说过“IPP 无处不在”吗?这是“无人驾驶”打印的未来。
从未听说过“无人驾驶打印”?它的一个稍微修改(和精简)的版本已经实现为 iPhone 和 iPad 设备的“Apple AirPrint”。
基于 CUPS 的打印堆栈的当前实现包括
cups-drivers
项目中最近移至 GitHub 的新代码段。这个新代码实现了 IPP Everywhere 功能。该
cups-filters
项目由Linux 基金会的 OpenPrinting 部门管理,自从 Apple 将原始 CUPS 源代码的这些部分交给他们后,当它们对 macOS 不再有用但对 Linux 仍然很重要时。那么无驱动打印的基本思路是什么?
让设备自动宣布它们在本地网络中的存在和它们的服务类型。使用 IETF 标准协议
mDNS
和DNS-SD
(在 macOS 中以“Bonjour”的名义实现,在 Linux 中以“Avahi”的名义实现)记录所提供的服务。告诉打印客户端,他们可以使用该
IPP
协议在发出get-printer-attributes
请求时获得查询响应。此请求将告诉他们设备支持哪些打印选项集。打印客户端然后可以显示精确定制的打印对话框以向打印用户显示选择的选择。打印客户端还将被告知每个设备支持哪些作业提交格式。这必须是 PDF 或称为“PWG-Raster”的简单光栅格式。那么......在这样的环境中,您在哪里需要特定的“打印机驱动程序”?如今,每个人都可以创建 PDF 文档。查看!无需将特定设备转换为任何其他打印语言。
是否有支持 IPP Everywhere 的打印机?哦,是的,看这里——据说它们都完全符合标准:
回答by Kurt Pfeifle
The .slnand .vcprojfiles you've been seeing in the CUPS sources are not meant to compile all of CUPS for Windows.
您在 CUPS 源代码中看到的.sln和.vcproj文件并不意味着为 Windows 编译所有 CUPS。
They serve to compile only a few of its utilities (such as ipptool.exe
)...
它们仅用于编译其中的一些实用程序(例如ipptool.exe
)...
Making the complete CUPS server+filtering code work on Windows would be a daunting task, since Windows spooling and printing is so much different from the Unix world.
使完整的 CUPS 服务器+过滤代码在 Windows 上工作将是一项艰巨的任务,因为 Windows 假脱机和打印与 Unix 世界有很大不同。
回答by el.pescado
CUPS uses Internet Printing Protocol for client-server communications. According to Technet article, Windows can be used as IPP host:
CUPS 使用 Internet 打印协议进行客户端-服务器通信。根据Technet 文章,Windows 可以用作 IPP 主机:
To enable a computer running Windows Server 2008 to act as a server supporting Internet printing, you must install the Web Server (IIS) role, the Print Services role, and the Internet Printing role service in the Print Services role.
要使运行 Windows Server 2008 的计算机充当支持 Internet 打印的服务器,您必须在打印服务角色中安装 Web 服务器 (IIS) 角色、打印服务角色和 Internet 打印角色服务。
Moreover, it seems that Windows, Linux and Mac OS X clients can use printers shared via SMB.
此外,Windows、Linux 和 Mac OS X 客户端似乎可以使用通过 SMB 共享的打印机。