Issue 12087 - Add CUPS support
Summary: Add CUPS support
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.2
Hardware: PC Linux, all
: P3 Trivial with 2 votes (vote)
Target Milestone: OOo 2.0
Assignee: ulf.stroehler
QA Contact: issues@gsl
URL:
Keywords:
: 12539 19111 22311 30077 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-03-06 09:32 UTC by gbeauche
Modified: 2004-07-13 14:34 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Get PPD files from CUPS (5.87 KB, patch)
2003-03-06 09:32 UTC, gbeauche
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description gbeauche 2003-03-06 09:32:32 UTC
Hi,

If printer queue is controlled by CUPS, it would be better to get PPD files from
it instead of relying on SGENPRT (Generic Printer). Indeed, the Generic version
probably don't have all the necessary Resolution options or similar things handy
for the printer.

The following patch assumes two things:

1) "lpstat -s" to be the CUPS version, if installed. Henceforth, we are trying
to get the PPD in PrinterInfoManager::initialize(). If it fails, the Generic one
is still used.

2) We can clean PPD parsers in the SalInstance destructor. i.e. Otherwise,
psp::PPDParser::freeAll() was not called anywhere. This has the effect to remove
temporary files introduced from cupsGetPPD() calls.

Caveats:

- I am not familiar with psprint code, especially the PPDValues merging process.
i.e. if we could get a valid PPDParser, we are merging values the same way as
PrinterInfoManager::addPrinter() but with aMergeInfo filled in earlier.

- Some PPDs have JCLResolution option instead of plain Resolution. OOo doesn't
appear to handle the former.

- I unconditionnally link against -lcups, this should be added as a 3RDPARTY
library instead and possibly statically linked in or dlopen()'ed in
ppdparser.cxx (GetPPDFilesFromCUPS)?

- This unveils another bug. It does appears that OOo binds AnySetup options to
only the first page. More details about that later in a new Issue I hope.
Comment 1 gbeauche 2003-03-06 09:32:56 UTC
Created attachment 5001 [details]
Get PPD files from CUPS
Comment 2 philipp.lohmann 2003-03-06 12:14:24 UTC
I don't think i can apply the patch in its current state. Reasons:

- it links against libcups, which would mean that the users print
system HAS to be CUPS; i don't think we should require this. We should
use CUPS load on call and fall back to old behaviour if libcups cannot
be opened. I would put this process in a separate one instance object.

- removing the PPD files is a good thing (i remember we talked about
this on the mailing list), but on second thought i think it might be
better to import the PPD file wholesale like spadmin does; this way
one has the PPD file cached and needn't import it on every start (the
file would be downloaded via IPP; we shouldn't do that without need).
Also you could get rid of the temporary file right away.

CUPS is on my list; i planned to do that as a virtual overloaded
PrinterInfoManager making use of the whole CUPS library rather than
just getting a PPD file; i agree that getting the PPD's would be a
good first step, though.

Regarding AnySetup: including things multiple times can (in my
experience) easily break something; e.g. if you set the page size in
every page setup it overrides duplex printing since a new page will
then always begin on the front side of a new paper. The PPD features
are emitted anew on a new PageSetup if they have actually changed
(which is not the case with most documents); you can see that e.g.
with documents that actually contain pages of different sizes.
Comment 3 christof.pintaske 2003-03-06 13:03:47 UTC
cp->pl: maybe even for 1.1
Comment 4 philipp.lohmann 2003-03-12 13:36:07 UTC
will add CUPS support (not sure about timeframe)
Comment 5 philipp.lohmann 2003-06-02 11:41:37 UTC
*** Issue 12539 has been marked as a duplicate of this issue. ***
Comment 6 philipp.lohmann 2003-08-05 17:55:21 UTC
It does not seem to be an option to cache the PPDs as there is AFAICS
not validation mechanism; so we'll need to download the PPDs on
demand. And CUPS does not seem to have a mechanism to store a
user/printer specific setup (containing things like default paper
sizes, duplex and other goodies), so we'll not be able to get rid of
OOo's printer configuration in toto. There will still need to be an
spadmin else the user won't have the goodies he has with the old solution.
Comment 7 philipp.lohmann 2003-09-05 13:22:49 UTC
*** Issue 19111 has been marked as a duplicate of this issue. ***
Comment 8 philipp.lohmann 2003-09-05 14:22:06 UTC
fixed in CWS cups01
Comment 9 philipp.lohmann 2003-10-10 14:11:48 UTC
adjusted target
Comment 10 philipp.lohmann 2003-10-17 11:47:38 UTC
pl->us: please verify in CWS cups01
Comment 11 philipp.lohmann 2003-11-05 17:39:24 UTC
.
Comment 12 ulf.stroehler 2003-11-13 18:55:25 UTC
changing issue "resolution" to "FIXED" in order to mark it "VERIFIED".
Comment 13 ulf.stroehler 2003-11-13 18:55:46 UTC
verified issue.
Comment 14 philipp.lohmann 2003-12-17 12:53:45 UTC
adjusting target; this is a feature and will go into 2.0
Comment 15 nospam4obr 2004-02-06 15:06:28 UTC
The Q-PCD issue for CUPS support is #19995#.
Comment 16 ulf.stroehler 2004-06-08 17:00:00 UTC
*** Issue 22311 has been marked as a duplicate of this issue. ***
Comment 17 philipp.lohmann 2004-06-11 09:36:11 UTC
*** Issue 30077 has been marked as a duplicate of this issue. ***
Comment 18 ulf.stroehler 2004-06-24 11:35:25 UTC
Re-verified in master 680_m41.
Comment 19 nospam4obr 2004-07-13 14:34:31 UTC
Set Q-PCD task as parent.