Re: PRINT TO PS



On Wed, 2003-11-26 at 18:38, Andreas J. Guelzow wrote:
Now, if you want to work at that level so that the users still think
they can select a printer but you afterwards sidetrack the output (and
ensure that the users don't file bugs or make derogatory comments about
gnumeric),  then the right place to insert a few commands would be:

in src/print.c at about lines 1292 or so:

---------------------------------------------------------
      if (default_range == PRINT_SHEET_RANGE) {
              pj->start_page = first-1;
              pj->end_page = end-1;
      }

additional code goes here!

      gpm = gnome_print_job_new (print_config);
      pj->print_context = gnome_print_job_get_context (gpm);
      pj->range = default_range;
      if (default_range == PRINT_SHEET_RANGE) {
              pj->start_page = first-1;
              pj->end_page = end-1;
      }

---------------------------------------------------------

Essentially you want to change the print_config to select print to file:

to change the file name (one should suffice but this way at least the
file name also changes in the print dialog):

      gpa_node_set_path_value (print_config, 
                               "Settings.Output.Job.FileName", 
                               "/tmp/output.ps");
      gpa_node_set_path_value (print_config, 
                               "Settings.Transport.Backend.FileName", 
                               "/tmp/output.ps");

you still need to set the printer and the transport to `FILE'. Check out
the code in libgnomeprintui/gpaui/*.c on pointers how to do that. I am
too busy in the moment to figure out those details. Sorry.

Curiosity killed the cat: It should suffice if you also add:
gnome_print_config_set (job->config, "Settings.Transport.Backend",
"file");

Andreas
-- 
Andreas J. Guelzow
Taliesin Software, Shelties, Pyrsheps
and Shetland Sheep

Attachment: signature.asc
Description: This is a digitally signed message part



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