Apache OpenOffice (AOO) Bugzilla – Issue 12087
Add CUPS support
Last modified: 2004-07-13 14:34:31 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.
Created attachment 5001 [details] Get PPD files from CUPS
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.
cp->pl: maybe even for 1.1
will add CUPS support (not sure about timeframe)
*** Issue 12539 has been marked as a duplicate of this issue. ***
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.
*** Issue 19111 has been marked as a duplicate of this issue. ***
fixed in CWS cups01
adjusted target
pl->us: please verify in CWS cups01
.
changing issue "resolution" to "FIXED" in order to mark it "VERIFIED".
verified issue.
adjusting target; this is a feature and will go into 2.0
The Q-PCD issue for CUPS support is #19995#.
*** Issue 22311 has been marked as a duplicate of this issue. ***
*** Issue 30077 has been marked as a duplicate of this issue. ***
Re-verified in master 680_m41.
Set Q-PCD task as parent.