Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to have custom PBM build a printer invoking a custom CUPS backend



John,

It would help to see your CUPS error_log to understand what's going wrong here. I tried to reproduce the problem today on 10.2.6 but everything worked fine.

Here's what I did. Maybe you could follow these steps and let me know if you still see the 1028 error in Print Center. BTW 1028 is an IPP error code, defined as "client-error-not-possible".

// clone lpd backend
cp lpd.c mylpd.c

// edit mylpd to return something unique
diff lpd.c mylpd.c
< puts("network lpd \"Unknown\" \"LPD/LPR Host or Printer\"");
---
> puts("network mylpd \"Unknown\" \"MYLPD/LPR Host or Printer\"");

// edit the makefile to include the mylpd backend
< BACKENDS = ipp lpd parallel serial socket
---
> BACKENDS = ipp lpd parallel serial socket mylpd
> mylpd: mylpd.o ../cups/$(LIBCUPS)
> echo Linking $@...
> $(CC) $(LDFLAGS) -o mylpd mylpd.o $(LIBS)

// build cups
cd ..
sudo make install

// check that the new backend is installed
ls /usr/libexec/cups/backend/
http lpd mylpd parallel smb usb
ipp mdns pap serial socket

// restart the daemon
sudo killall -HUP cupsd

// check that mylpd is registered
lpinfo -v
...
network lpd
network mylpd
...

// create a queue with lpadmin
lpadmin -p test -E -v mylpd://1.2.3.4/q

// create a queue with the advanced pbm
// run Print Center
// select Advanced PBM
// enter a device name, e.g. "test2"
// enter a device uri, e.g. "mylpd://4.3.2.1/q
// select a PPD file, or the default generic PPD
// click Add

Also please see comments below.

-Paul



On Tuesday, May 27, 2003, at 07:42 PM, John Rice wrote:

Paul,
We are trying to get a custom PBM to build a printer that will invoke a
custom CUPS backend. By gleaning information from old TiogaDev postings and
from Printing postings we were indeed able to build printers using a custom
PBM.

Pass the following as CStringRef values for kPMPrinterURI (examples)
"pap://*/JSR_hot_folder2/LaserWriter" will build a valid 'AppleTalk' printer
"lpd://192.168.123.150/JSR_hot_folder2" will build a valid 'IP Printing'
printer

but trying the following to invoke a 'custom' backend called 'glilpd'
"'glilpd://192.168.123.150/JSR_hot_folder2" fails with a '1028' basic
catchall for something wrong with the syntax being passed back to Print Center
at printer creation.

I assume your PBM also supplied the other required keys (kPMPrBrowserSelectNameKey, kPMPPDNameKey, etc.)


How do we code the kPMPrinterURI so that it will build a printer that points
to a custom backend for processing?

I hope it's just a typo, but in the above paragraph you have

"'glilpd://192.168.123.150/JSR_hot_folder2"

"glilpd://192.168.123.150/JSR_hot_folder2" is valid


=====
Are the followng statements valid?
kPMPPDNameKey defined in PMTicket.h, CStringRef value = URI encoded
path/filename of PPD used to build printer

correct

kPrinterLocation still not defined in any header, key is "Location", not
mandatory for printer creation, CStringRef value shows up in the 'Location'
field in the 'Printer Info' dialog displayed when the user selects the 'Show
Info' icon.

correct


=====
Also by editing the contents of 'Printers.conf' directly and modifying an
existing 'lpd'-based printer to now be a 'glilpd'-based printer we were able
to invoke our backend successfully.
Custom 'glilpd' backend was resident in the '/System/Library/Printers/IOMs'
folder at the time Print Center failed to build the printer using custom
kPMPrinterURI value.

/etc/cups/printers.conf is where CUPS stores info about all the local queues. Better to use lpadmin to modify its contents but as you see, it's possible to edit the file to add/modify/delete queues.


thanks,
John
email@hidden

=====
excerpt from mailing list, the basic recipe that we followed

To answer your question about GetSelectedPrinters, the rules are as
follows. For Tioga PMs, the dictionary returned by GetSelectedPrinters
must contain keys for the printer name (kPMPrBrowserSelectNameKey),
kind (kPMPrBrowserSelectKindKey), address (kPMPrBrowserSelectAddrKey)
and type (kPMPrBrowserSelectRefKey). It looks like your PBM is
following this rule. There's an additional rule for CUPS drivers. The
address key must be a dictionary containing the PPD name
(kPMPPDNameKey), the printer location (kPrinterLocation) and device URI
(kPMPrinterURI). It's important to note that we use the presence of
the PPD key to differentiate between Tioga and CUPS printer queues --
if the key is present, we set up a CUPS queue (for example, cgpdftops
-> pstops -> backend, or cgpdftoraster -> rastertoprinter -> backend,
etc.) but if the key is absent, we set up a Tioga queue (pdftopm ->
dev/null).
=====
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.