手把手教你嵌入式Linux系统驱动 hp1020plus驱动安装教程( 二 )


第一次执行会出现以下错误
Error: /invalidfont in findfont
Operand stack:le=test_1.pbm /uchess.ps
F1 12 Times-Roman Font Times-Roman 290498 Times-Roman –nostringval– Times-Roman NimbusRomNo9L-Regu Courier NimbusMonL-Reguint
Execution stack:
%interp_exit .runexec2 –nostringval– –nostringval– –nostringval– 2 %stopped_push –nostringval– –nostringval– –nostringval– false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 –nostringval– –nostringval– –nostringval– 2 %stopped_push –nostringval– –nostringval– 3 4 %oparray_pop 4 4 %oparray_pop –nostringval– –nostringval– –nostringval– –nostringval– –nostringval– false 1 %stopped_push 7 5 %oparray_pop –nostringval– –nostringval– –nostringval– 1 -1 1 –nostringval– %for_neg_int_continue
Dictionary stack:
–dict:1118/1686(ro)(G)– –dict:0/20(G)– –dict:75/200(L)– –dict:31/70(L)– –dict:17/17(ro)(G)– –dict:1118/1686(ro)(G)–
Current allocation mode is local
Last OS error: 2
Current file position is 61042
GPL Ghostscript 8.15: Unrecoverable error, exit code 1
在ubuntu中把
/usr/share/fonts/type1/gsfonts/n021003l.pfb文件拷贝到开发板的
/usr/printer/ghostscript/share/ghostscript/fonts目录下
再次执行
./gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=a4 -r600x600 -sDEVICE=pbmraw -sOutputFile=test_1.pbm /usr/print/ghostscript-8.15/share/ghostscript/8.15/examples/chess.ps
即可生成pbm文件
4、测试打印文件
准备打印 , 在开发板终端中发送固件到打印机
cd /usr/printer
这句执行完后打印机有响声
cat sihp1020.dl > /dev/usb/lp0
这句执行完后打印机开始打印
foo2zjs -z1 -p9 -r600x600 test_1.pbm > /dev/usb/lp0
注意一:发送固件到打印机中第一次打印 , 打印出来的是乱码 , 之后的打印才是正常的 。
注意二:打印文件中的文字打印出来的字体受开发板的字库所影响 , 分辨率比较低 。

推荐阅读