[Kde-print-devel] Problem configuring specific printer options

Cristian Tibirna tibirna at kde.org
Tue Jul 24 05:15:51 CEST 2007


Hello

Let's use the kde-print-devel mailing list for this. I advise you to 
subscribe.

On 21 July 2007 17:07, Hernán Rajchert wrote:
> Hi, im making an utility to print cd/dvd in kde code in python using the
> PyQt4 and hopefully PyKde4 bindings. I got some problems and asking in
> #kde-devel they told me that you may got some advice for me.
>
> Ive manage to print in the cd by just creating a QPrinter, executing a
> dialog and setting specific ppd options within the properties dialog. The
> app should not rely on the user to manually set those options so i want to
> make it programatically. The problem is that this isn't a common task
> because 99% of the printers doesn't allow printing on a cd, so as I
> expected the weren't any API to do so.
>
> Because the options I need to change where in the properties dialog I
> thought it should be at least a way to talk directly to CUPS and set the
> options myself. This presented a new problem, different printers drivers
> could have different names for the same options, so i have to define a
> common class for get/set-ting  the options and derive from it with the
> specific names.
>
> The options I'm trying to change are (at least for my printer):
>    Media Source -> It indicates where to print, I should set it to "Print
> to CD"
>    Print Quality -> Perhaps there is an option to change this already
>    Cd Size -> Outer circle diameter
>    Cd Hub Size -> Inner circle diameter
>    Cd Horizontal Fine Adjustment
>    Cd Vertical Fine Adjustment
>
> the last 4 options have a list of posible values that i like to present to
> the user (in other way than printer options), for the size there is the new
> Label option and for the Adjustment there will be a wizard.

KDEPrint is a very well thought out technology, thanks to his creators 
(especially Michael Goffioul). It is possible for applications to extend the 
KDEPrint dialog with custom options (that appear in application-defined tabs) 
and also to manipulate printer options, i.e. setting the values of the 
already available PPD options etc.

> Without any luck getting those properties within the qt/kde API I found
> myself using lpoptions program (just for testing, I know is a horrible
> solution), but even doing so i found myself a new problem, how can i get
> the name of the printer that is available?. If i create a QPrinter and do a
> printerName() call it gives me an empty string, but if i call the dialog
> with the printer, and then put print, the printerName() nows return
> correctly. I couldn't find any option to list the available printers.
>

I'm not sure I catch all the details of what you want to do, but it all sounds 
like standard techniques, for which there already exist solutions.

I advise you to look at the KDEPrint development tutorial:

http://printing.kde.org/developer/tutorial/

and at code from applications that already use these techniques, like Kate, 
gwenview etc.

Thanks a lot for your interest.
-- 
Cristian Tibirna
KDE developer .. tibirna at kde.org .. http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-print-devel/attachments/20070723/95ce0534/attachment.pgp 


More information about the Kde-print-devel mailing list