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');

That's it! It's one thing for a ghost to scare my children, but it's another to play my theremin!
  - Homer Simpson

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