$ cd foo2zjs $ foo2ddst-wrapper testpage.ps > xxx.prn $ ddstdecode -d xxx xxx.prn \033%-12345X@PJL @PJL SET TIMESTAMP=2019/02/01 11:45:03 @PJL SET FILENAME=stdin @PJL SET COMPRESS=JBIG @PJL SET USERNAME=root @PJL SET COVER=OFF @PJL SET PAGESTATUS=START @PJL SET COPIES=1 @PJL SET MEDIASOURCE=TRAY1 @PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET PAPER=LETTER @PJL SET PAPERWIDTH=5100 @PJL SET PAPERLENGTH=6600 @PJL SET RESOLUTION=600 @PJL SET IMAGELEN=57799 DDST_JBIG_DATA_BEGIN 57799 bytes DL = 0, D = 0, P = 1, - = 0, XY = 5100 x 6600 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 72 LRLTWO TPBON 52 stripes, 0 layers, 1 planes DDST_JBIG_DATA_END @PJL SET DOTCOUNT=12345 @PJL SET PAGESTATUS=END @PJL EOJ \033%-12345X $ eog xxx-01-4.pbm #image view it! $ nc 192.168.1.nnn 9100 < xxx.prn #print it
Download http://foo2zjs.rkkda.com/tmp/ricoh-sp201-win.prn $ ddstdecode -d www ricoh-sp201-win.prn #decode it $ eog www-01-4.pbm #view it $ nc 192.168.1.nnn 9100 < ricoh-sp201-win.prn #print it
Quote
mvr88
OK, replacing identify with pamfile (netpbm-package) did it, e.g.
< read fn ft xs ys garb < <(identify $page | tr "x" " ")
> read xs ys < <(pamfile $uid/$page | sed -r 's/.* ([0-9]+) by ([0-9]+).*/\1 \2/g')
$ pstoricohddst-gdi '' '' '' '' 'PageSize=letter' < ~/testpage.ps > xxxx.prn which: no inotifywait in (/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/:/home/rick/go/bin) $ ddstdecode xxxx.prn \033%-12345X@PJL @PJL SET TIMESTAMP=2019/02/05 12:48:40 @PJL SET FILENAME=Document @PJL SET COMPRESS=JBIG @PJL SET USERNAME= @PJL SET COVER=OFF @PJL SET HOLD=OFF @PJL SET PAGESTATUS=START @PJL SET COPIES=1 @PJL SET MEDIASOURCE=TRAY1 @PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET PAPER=LETTER @PJL SET PAPERWIDTH=5100 @PJL SET PAPERLENGTH=6600 @PJL SET RESOLUTION=600 @PJL SET IMAGELEN=57795 DDST_JBIG_DATA_BEGIN 57795 bytes DL = 0, D = 0, P = 1, - = 0, XY = 5100 x 6600 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 72 LRLTWO TPBON 52 stripes, 0 layers, 1 planes DDST_JBIG_DATA_END @PJL SET DOTCOUNT=193891 @PJL SET PAGESTATUS=END @PJL EOJ \033%-12345X $
$ diff -u ~/src/pstoricohddst/pstoricohddst-gdi ~/bin/pstoricohddst-gdi --- /home/rick/src/pstoricohddst/pstoricohddst-gdi 2019-02-05 12:45:07.367490804 -0600 +++ /home/rick/bin/pstoricohddst-gdi 2019-02-05 15:18:10.064700146 -0600 @@ -171,7 +171,8 @@ # Converting from PostScript to PostScript-monochrome, then to PBM image format (per page) log "Converting document to pages" - gs -sDEVICE=ps2write -sPAPERSIZE=$lcpagesize -sOutputFile=- -r$resolution -dQUIET -dBATCH -dNOPAUSE - | gs -sPAPERSIZE=$lcpagesize -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE - + # gs -sDEVICE=ps2write -sPAPERSIZE=$lcpagesize -sOutputFile=- -r$resolution -dQUIET -dBATCH -dNOPAUSE - | + gs -sPAPERSIZE=$lcpagesize -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r$resolution -dQUIET -dBATCH -dNOPAUSE - log "Conversion complete" output_headerTry that and report back. I don't know why the two copies of gs were there.