[cups.development] Is cupsGetPPD supposed to fetch PPDs from remote servers?

Helge Blischke h.blischke at acm.org
Tue Dec 14 09:35:37 PST 2010


Vadim Troshchinskiy wrote:

> Hi! I'm debugging an issue with printing from a Java program. The setup is
> as follows:
> 
> The program runs inside a VM. The user connects to the VM with NX. Within
> the VM, there's a CUPS instance running. Also, NX forwards port 2100 on
> the VM to port 631 on the computer running the NX client. For the sake of
> making testing easier in this case I'm using cups-pdf as the printer on
> the client side. The CUPS in the VM is then configured as follows:
> 
> # Printer configuration file for CUPS v1.4.3
> # Written by cupsd
> # DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
> <Printer Virtual_PDF_Printer>
> Info Virtual_PDF_Printer
> DeviceURI ipp://127.0.0.1:2100/printers/Virtual_PDF_Printer
> State Idle
> StateTime 1292260814
> Type 6
> Accepting Yes
> Shared No
> JobSheets none none
> QuotaPeriod 0
> PageLimit 0
> KLimit 0
> OpPolicy default
> ErrorPolicy retry-job
> </Printer>
> 
> 
> The issue is that Java programs fail to print. Debugging the applications
> shows that first it tries to open the printer's PPD in /etc/cups/ppd/,
> fails to find it there, then tries to request it from localhost:631, that
> also fails, and gives up there. Java fails to obtain useful information
> about the printer, so printing fails to work.
> 
> I looked at the code of openjdk, which turned out to contain a simple call
> to cupsGetPPD. The way that code looks like it seems unlikely to be the
> problem.
> 
> Then, I think the question is, is what happens a bug, and what should be
> happening? For instance:
> 
> Should cupsGetPPD notice that Virtual_PDF_Printer is at
> ipp://127.0.0.1:2100/printers/Virtual_PDF_Printer and fetch the PPD from
> http://127.0.0.1:2100/printers/Virtual_PDF_Printer? (it tries
> http://127.0.0.1:631/printers/Virtual_PDF_Printer which gets a 404)
> 
> Or, perhaps if a PPD is requested from the local CUPS it should fetch it
> from the remote one and then deliver it?
> 
> Or, are PPDs always supposed to be available locally?
> 
> 
> Thanks!
> 
> 

Your Java program should use cupsGetPPD2, which has an additional (first) 
parameter that specifies the HTTP connection.

Helge





More information about the cups-devel mailing list