3

我想使用“hplip”从 android 设备打印。请告诉我如何构建“hplip”并在 android 中使用。是否有任何可用于 android 的包装器?

在此处查看 hplip 文档

4

1 回答 1

1

您可以静态构建作为“hplib”和Ghostscript一部分的“hpijs” ,它可以在 Android 上运行。打印命令如下:

gs -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD -sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="deskjet 5550" -r300x300 -dNOPAUSE -dSAFER -sOutputFile="/dev/usb/lp0" ruler.pdf -c quit

PS:很久很久以前“hpijs”是单身,所以你可以得到旧版本。这是一个构建 hpijs 的 shell。(shell 的注释是母语,你可以使用谷歌翻译:))

#!/bin/sh
# 说明:本脚本是交叉(ARM)编译hpijs-2.1.4

DESTDIR=${PWD}/_install
# 1.下载源码 项目地址:http://sourceforge.net/projects/hpinkjet/files/
wget http://superb-dca2.dl.sourceforge.net/project/hpinkjet/hpijs/2.1.4/hpijs-2.1.4.tar.gz &&

# 2.解压源码
tar xvzf hpijs-2.1.4.tar.gz && cd hpijs-2.1.4 &&

# 3.配置 说明:CXXFLAGS默认是"-g -O2",这里添加-static以静态编译hpijs
./configure --host=arm-linux --target=arm-linux --build=i686-linux CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld RANLIB=arm-linux-ranlib AR=arm-linux-ar CXXFLAGS="-static -g -O2" --prefix=/ LDFLAGS=-L../jpeg-8b/.libs &&

# 4.修正语法错误 dj3320.cpp第403行和registry.cpp第249行 开头的char改为const char
sed -i '249s/\tchar\t/\tconst char\t/' registry.cpp &&
sed -i '403s/  char/  const char/' dj3320.cpp &&

# 5.编译并安装
make && make install DESTDIR=$DESTDIR

# 6.hpijs支持的打印机型号:hpijs-2.1.4/ppd查看.
#    MDL MFG名字都在ppd文件中.
于 2014-05-23T03:14:08.417 回答