Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: bahman.kahinpour ()
Date: February 02, 2011 12:52PM

Hello,
First of all, thank you very much indeed for this perfect and invaluable piece of software the foo2zjs filter. It is some time that I am using this on FreeBSD (with CUPS) and it just works perfectly.
I have a question. I do not want to use CUPS, I want to use Standard Unix Printing "lpd" instead. It should work fine, as /dev/ulpt0 is recognized and works, but I have a question. How should I define this "foo2zjs" filter for "lpd"? I mean, what should I specify for "if" Input Filter, "of" Output Filter, ... in the /etc/printcap Printing Capabilities file?
Thank you in advance
Good Luck
Bahman Kahinpour

"UNIX is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie



Edited 1 time(s). Last edit at 02/02/2011 01:27PM by rickrich.

Re: Using foo2zjs witout CUPS (using with lpd Standard Unix Printing)
Posted by: rickrich ()
Date: February 02, 2011 01:23PM

http://www.linuxfoundation.org/collaborate/workgroups/openprinting/databaselpddocumentation

e.g.
queue1|The printer in room 403:\
    :lp=/dev/lp0:\
    :af=/path/to/ppd/file:\
    :if=/path/to/foomatic-rip:\
    :sd=/path/to/spool/directory:\
    :mx#0:sh:



Edited 1 time(s). Last edit at 02/02/2011 01:25PM by rickrich.

Re: Using foo2zjs witout CUPS (using with lpd Standard Unix Printing)
Posted by: bahman.kahinpour ()
Date: February 03, 2011 12:29AM

Where do the PPD files live on the disk? Actually, I installed foo2zjs without CUPS and I can't find PPD files on my disk. (I have HP P1102)

Shouldn't I use foo2zjs-wrapper instead of foomatic-rip?

"UNIX is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: rickrich ()
Date: February 03, 2011 12:59AM

$ locate 1102.ppd
/usr/share/cups/model/HP-LaserJet_Pro_P1102.ppd.gz
/usr/share/ppd/foo2zjs/HP-LaserJet_Pro_P1102.ppd.gz

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: bahman.kahinpour ()
Date: February 04, 2011 11:39AM

Hello again, I am sorry for being annoying and keeping asking questions continuously.

I have found something on FreeBSD 8.1 without CUPS. The thing is when doing a "gmake install" on a fresh FreeBSD system without CUPS, the directory /usr/local/share/cups/model does not exist and therefore the Makefile simply skips installing the ppd.gz files. I tried the following:

# mkdir /usr/local/share/cups
# mkdir /usr/local/share/cups/model

on a fresh FreeBSD system without CUPS and after that I found the files you mentioned in those directories (without CUPS, just with fake directories). So, there is a way to get the PPD files installed without CUPS.

My other problem is that I do not know exactly how to use the foo2zjs filter alongs with foomatic-filters. For example, if I have a PostScript file. Let's print directly to the printer. Is this correct for direct printing?

cat some-postscript-file.ps | foomatic-rip | foo2zjs-wrapper > /dev/ulpt0

How can I print directly to the HP LaserJet P1102 printer? Where should I specify that?

Using the answer to above question, I can easily remove the first "cat some-file.ps" part and use the rest as the main filter in LPD?

"UNIX is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: rickrich ()
Date: February 04, 2011 11:52AM


Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: rickrich ()
Date: February 04, 2011 02:47PM

LPR:
$ foomatic-rip -v --ppd `pwd`/PPD/HP-LaserJet_Pro_P1102.ppd < testpage.ps > xxx
foomatic-rip version 4.0.5.223 running...
called with arguments: '-v', '--ppd', '/home/rick/proj/foo2zjs/PPD/HP-LaserJet_Pro_P1102.ppd'
Parsing PPD file ...
Added option PageSize
Added option Quality
Added option Resolution
Added option ImageableArea
Added option PaperDimension
Added option InputSlot
Added option MediaType
Added option Density
Added option Copies
Added option halftone
Added option NupOrient
Added option NupPages
Added option Font

Parameter Summary
-----------------

Spooler: direct
Printer: 
Shell: /bin/bash
PPD file: /home/rick/proj/foo2zjs/PPD/HP-LaserJet_Pro_P1102.ppd
ATTR file: 
Printer model: HP LaserJet Pro P1102 Foomatic/foo2zjs-z2 (recommended)
Options: 
Job title: rick@dual.rkkda.org
File(s) to be printed:
<STDIN>

Printing system options:
Options from the PPD file:

================================================

File: <STDIN>

================================================

Filetype: PostScript
Reading PostScript input ...
--> This document is DSC-conforming!

-----------
Found: %%BeginSetup
"Prolog" section is missing, inserting it.
Inserting option code into "Prolog" section.
Inserting option code into "Setup" section.
Found: %%EndSetup

-----------
New page: %%Page: 1 1
No page header or page header not DSC-conforming
"PageSetup" section is missing, inserting it.
Inserting option code into "PageSetup" section.
New page found but previous not printed, print it now.
Found: %%Page: 1 1
 --> Output goes directly to the renderer now.


Starting renderer with command: "foo2zjs-wrapper -z2 -P -L0     -r1200x600 -p1 -T3 -m1 -s7   -n1 "
Starting process "kid3" (generation 1)

-----------
New page: %%Page: 1 1
Starting process "kid4" (generation 2)
Found: %%Page: 1 1
 --> Output goes to the FIFO buffer now.

No page header or page header not DSC-conforming
"PageSetup" section is missing, inserting it.
Inserting option code into "PageSetup" section.
Starting process "renderer" (generation 2)
Stopping search for page header options
Found: 0015170d000c00090001020000111d0d000c06000012370a001700000a0a001200000002
 --> Output goes directly to the renderer now.


Closing renderer
JCL: %-12345X@PJL
<job data> 

renderer exited with status 0
kid4 exited with status 0
kid3 finished
kid3 exited with status 0

Closing foomatic-rip.
$

LPRNG:

$ foomatic-rip -v --lprng --ppd `pwd`/PPD/HP-LaserJet_Pro_P1102.ppd < testpage.ps > xxx
foomatic-rip version 4.0.5.223 running...
called with arguments: '-v', '-lprng', '--ppd', '/home/rick/proj/foo2zjs/PPD/HP-LaserJet_Pro_P1102.ppd'
Parsing PPD file ...
Added option PageSize
Added option Quality
Added option Resolution
Added option ImageableArea
Added option PaperDimension
Added option InputSlot
Added option MediaType
Added option Density
Added option Copies
Added option halftone
Added option NupOrient
Added option NupPages
Added option Font

Parameter Summary
-----------------

Spooler: lpd
Printer: 
Shell: /bin/bash
PPD file: /home/rick/proj/foo2zjs/PPD/HP-LaserJet_Pro_P1102.ppd
ATTR file: 
Printer model: HP LaserJet Pro P1102 Foomatic/foo2zjs-z2 (recommended)
Options: 
Job title: rick@dual.rkkda.org
File(s) to be printed:
<STDIN>

Printing system options:
Options from the PPD file:

================================================

File: <STDIN>

================================================

Filetype: PostScript
Reading PostScript input ...
--> This document is DSC-conforming!

-----------
Found: %%BeginSetup
"Prolog" section is missing, inserting it.
Inserting option code into "Prolog" section.
Inserting option code into "Setup" section.
Found: %%EndSetup

-----------
New page: %%Page: 1 1
No page header or page header not DSC-conforming
"PageSetup" section is missing, inserting it.
Inserting option code into "PageSetup" section.
New page found but previous not printed, print it now.
Found: %%Page: 1 1
 --> Output goes directly to the renderer now.


Starting renderer with command: "foo2zjs-wrapper -z2 -P -L0     -r1200x600 -p1 -T3 -m1 -s7   -n1 "
Starting process "kid3" (generation 1)

-----------
New page: %%Page: 1 1
Found: %%Page: 1 1
 --> Output goes to the FIFO buffer now.

No page header or page header not DSC-conforming
"PageSetup" section is missing, inserting it.
Inserting option code into "PageSetup" section.
Starting process "kid4" (generation 2)
Starting process "renderer" (generation 2)
Stopping search for page header options
Found: 0015170d000c00090001020000111d0d000c06000012370a001700000a0a001200000002
 --> Output goes directly to the renderer now.


Closing renderer
JCL: %-12345X@PJL
<job data> 

renderer exited with status 0
kid4 exited with status 0
kid3 finished
kid3 exited with status 0

Closing foomatic-rip.



Edited 1 time(s). Last edit at 02/04/2011 02:49PM by rickrich.

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: bahman.kahinpour ()
Date: February 04, 2011 03:12PM

Thank you very much indeed for your help and support Rick.

I followed the instructions in http://www.linuxfoundation.org/collaborate/workgroups/openprinting/databaselpddocumentation to prepare /etc/printcap but I noticed that it was not working. I replaced foomatic-rip with a shell script and tried to trace the things inside the script and found out what the problem was.

Using you guide (foomatic-rip) I generated a valid ZJStream and tried to send it to the printer. Even though the stream was valid (checked it with your "zjsdecode" tool), issuing the command
# cat validzjstream.zjs > /dev/ulpt0
did not work at all.

With CUPS and foo2zjs, the printer was working fine on FreeBSD but as I suspected /dev/ulpt0 not working, I added "FileDevice Yes" to cupsd.conf and changed the Device Connection in CUPS from "usb://HP/HP%20LaserJet%20Professional%20P1102?serial=000000000Q80MQWZPR1a" to /dev/ulpt0, and it was not working then.

I actually do not know that how CUPS communicates with the printer but it was not using /dev/ulpt0 before, it was using "usb://HP/HP%20LaserJet%20Professional%20P1102?serial=000000000Q80MQWZPR1a" and was working properly. I remember I had enabled LIBUSB when compiling CUPS on FreeBSD.

Do you have any idea what I should do? foo2zjs correctly gives a ZJStream which printer talks and understands, but I can't send it to the printer through device node /dev/ulpt0 and /dev/unlpt0. This is while CUPS send the same output to the printer easily through usb://HP/HP%20LaserJet%20Professional%20P1102?serial=000000000Q80MQWZPR1a. In order to use LPD I should use lp=/dev/ulpt0, I can't use lp=usb://HP/HP%20LaserJet%20Professional%20P1102?serial=000000000Q80MQWZPR1a.

"UNIX is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: rickrich ()
Date: February 04, 2011 03:29PM

USB NOTES FOR FREEBSD 8.0 AND GREATER
    -------------------------------------
        $ gmake
        $ ./getweb 1020
            OR other printer, e.g. 2600n
        # gmake install install-hotplug
        # ./freebsd-install

        Use:
            usb:/dev/ulpt0
            usb:/dev/ulpt1
        for the URI.

        More information:
            http://menhennitt.com.au/wordpress/2009/09/27/printing-to-an-hp-laserjet-1020-from-freebsd-8-using-cups-and-foo2zjs
            http://farid.hajji.name/blog/2010/02/02/printing-woes-on-freebsd-8-with-cups/

Re: Using foo2zjs without CUPS (using with lpd Standard Unix Printing)
Posted by: bahman.kahinpour ()
Date: February 04, 2011 03:43PM

Thanks for help Rick. I think I finally could get it working... The problem was that /dev/unlpt0 should be used but if you used /dev/ulpt0 something like a ZeroCD feature gets activated and the device becomes a CD-ROM... So, /dev/ulpt0 should never be used...

"UNIX is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie

Sorry, only registered users may post in this forum.
This forum powered by Phorum.