首页>Linux>source

在我的网络上,我想使用Linux CUPSIPPEverywhere上使用无驱动程序print。 print系统。

我有一些网络print机,该print机仅通过bug即可支持IPP的无驱动程序print.一个不print某些pdf文件,另一个不print多个副本,依此类推.但是它们都使用其本机PPDprint机驱动程序都能很好地print.因此,我想在网络上提供一个print服务器,该服务器通过自己的print机驱动程序为网络print机提供服务,但在网络上作为每个网络print机的(虚拟?)全功能IPP设备出现。

这通常意味着print服务器正在将无驱动程序IPPprint命令从网络客户端"转换"到print机的旧版print命令,因此我在网络上只有IPPEverywhereprint队列。 默认情况下,CUPS创建一个本地print队列,该队列使用IPPEverywhere无驱动程序或通过无驱动程序为print机提供服务 使用其PPD文件的print机的旧版驱动程序。

┏━━━━━━━━━━━━━┓
┃ localhost   ┃
┃   ┌───────┐ ┃                ┏━━━━━━━━━┓
┃   │ Queue │═╋════════════════┫ Printer ┃
┃   └───────┘ ┃                ┗━━━━━━━━━┛
┗━━━━━━━━━━━━━┛

现在的想法是使print服务器的行为类似于网络上的无驱动程序print机:

┏━━━━━━━━━━━━━┓                ┏━━━━━━━━━━━━━┓
┃ localhost   ┃                ┃ printserver ┃
┃   ┌───────┐ ┃ IPPEverywhere  ┃   ┌───────┐ ┃  legacy PPD driver  ┏━━━━━━━━━┓
┃   │ Queue │═╋════════════════┫   │ Queue │═╋═════════════════════┫ Printer ┃
┃   └───────┘ ┃                ┃   └───────┘ ┃                     ┗━━━━━━━━━┛
┗━━━━━━━━━━━━━┛                ┗━━━━━━━━━━━━━┛

使用旧版驱动程序将print机连接到print服务器没有问题.这是旧的方法(但是将被上游CUPS版本弃用并删除)。

但是如何找到网络上的print服务器,以便例如可以使用IPPEverywhere连接到我的Android智能手机并进行print?

最新回答
  • 2021-1-5
    1 #

    有时我只能使用部分解决方案 用于网络上的Linux设备,但不适用于移动设备的通用print解决方案.但是要记录下来,我会分享.也许社区提供了一些指导或答案,所以我们可以找到最终的解决方案。

    我认为print机已成功连接,您可以从print服务器进行print:

    printserver ~$ lp -E -d myprinter /usr/share/cups/data/testprint
    

    我使用print机共享来直接访问print服务器上的队列.为此,我必须将其配置为默认服务器,而不是 localhost 用于本地print队列。

    ┏━━━━━━━━━━━━━┓                ┏━━━━━━━━━━━━━┓
    ┃ localhost   ┃                ┃ printserver ┃
    ┃             ┃ IPPEverywhere  ┃   ┌───────┐ ┃  legacy PPD driver  ┏━━━━━━━━━━━┓
    ┃             ┃════════════════╋═══│ Queue │═╋═════════════════════┫ myprinter ┃
    ┃             ┃                ┃   └───────┘ ┃                     ┗━━━━━━━━━━━┛
    ┗━━━━━━━━━━━━━┛                ┗━━━━━━━━━━━━━┛
    

    在安装了CUPS的print服务器上使用Debian Buster,您必须启用共享:

    printserver ~$ sudo cupsctl -E --share-printers
    printserver ~$ sudo cupsctl -E   # check settings
    

    在安装了CUPS的设备上也使用Debian,在 /etc/cups/client.conf中设置默认的print服务器 :

    client ~$ sudo bash -c 'echo "ServerName printserver" >> /etc/cups/client.conf'
    

    这就是我们访问print机所要做的全部工作.通过以下方法检查其状态和选项:

    client ~$ lpstat -E -t
    client ~$ lpoptions -E
    client ~$ lpoptions -E -l
    

    使用最后一条命令,您将找到 lp并非通用的print机特殊选项 ,例如 BRMonoColor 我的彩色print机.本示例将用灰色而不是默认颜色print两张双面纸的副本:

    client ~$ lp -E -d myprinter -n 2 -o fit-to-page -o collate=true -o sides=two-sided-long-edge -o BRMonoColor=Mono ./two-pages.pdf
    

    例如,如果将USBprint机本地连接到客户端,则可能会出现问题.您不会在 localhost上看到其队列 .在这种情况下,您始终可以使用环境变量 CUPS_SERVER指定print服务器。 :

    client ~$ CUPS_SERVER=localhost lpstat -E -t
    client ~$ CUPS_SERVER=localhost lp -E ...
    

    References:

      Debian - Printing

      github - IPP Sample Implementations

相关问题

  • bash:在文件顶部添加两个注释行
  • rhel:设置Samba以使用windows客户端的Linux Host与文件共享