Re: Changing default printer of Gnome2::Print::Config



On Jul 28, 2005, at 4:54 PM, ADIS - C.P.D. wrote:

Is there a way to change default printer without using dialog  window of
printers?

I think, maybe, using Gnome2::Print::Config keys.

I want that $job->print method makes a PDF file, not showing the
printers dialog to change the default printer that makes a .PS file  by
default.


It appears that the key you want is 'Settings.Engine.Backend.Driver',  and
the value for the PDF backend is 'gnome-print-pdf'.

But the problem is that $config->set () resolves to Glib::Object::set (),
which doesn't recognize the printconfig keys.

That's because gnome_print_config_set(), the function that sets  string
keys, isn't bound.  I'm not sure why -- all the others are.

I uncommented the declaration of gnome_print_config_set() in
GnomePrintConfig.xs, and reinstalled it, and then this sort of thing
works fine:

   $job->get_config->set ('Settings.Engine.Backend.Driver' => 'gnome-
print-pdf');
   $job->print_to_file ('print.pdf');

Changing 'Settings.Engine.Backend.Driver' doesn't change all keys associated
with printer, I have changed the key Printer from 'GENERIC' to 'PDF' and all
others values were corretly changed.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]