[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Page selection with "special" print devices
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2001-06-28 16:54:54
[Download RAW message or body]

Stefan Schimanski wrote:
> 
> Hi,
> 
> is there a reason that the selection of pages in the print dialog is disabled
> for all "special" devices like pdf and ps output? In KPrintDialog you will
> code like
> 
> void KPrintDialog::enableSpecial(bool on)
> {
>         ...
>         KPrintDialogPage        *copypage = ...
> 
>         if (copypage && m_printer && m_printer->pageSelection() ==
> KPrinter::SystemSide )
>         copypage->setDisabled(on);
> }
> 
> Is this a bug or is there a good reason? Printing only single pages into
> postscript files is quite essential IMHO.

The print framework doesn't process PS by itself. You can view it as a generic
layer between KDE and any underlying print system. So if you want page selection,
either it is made on application side, or on system side, but not by kdeprint.
In the case of a "special" printer, you don't use the underlying print syste, so
page selection can only occur on the application side, but only a few apps 
support page selection (kword).
In the above code, the relevant part is
"m_printer->pageSelection() == KPrinter::SystemSide". In this case page selection
is disabled because the app doesn't support it, kdeprint doesn't process PS
and the PS won't be send to a print system (like CUPS) so you can't rely on it.
That is the reason.

I can see 3 ways to implement a page selection mechanism that would be available
in any cases (whatever the print system, the app and the printer):
- Qt side: add some code to be able to tell QPrinter which pages you want to print.
  This would probably imply something like: print until we get a "newPage()" call,
  check if the page is to be printed, discard it if needed. But I don't think this
  would be possible with the implementation of QPrinter as all PS command are 
  directly sent the "lpr" using a pipe, so you can't go back
- integrate a PS processor in kdeprint, and I'm not really willing to do it
- rely on an external program (psselect) to perform page selection.

Any comment?

Michael.

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul@imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic