Re: [ROOT] Printing

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Aug 14 2001 - 16:33:08 MEST


You cannot print directly to the hardware from a canvas menu.
However, it is straightforward to print the current canvas.
One possibility is to add in your rootlogon.C file a small function (or more
than one if you have several printers), to print the current canvas.
Example of rootlogon.C file

void rootlogon() {
  printf("\nWELCOME to my ROOT work directory\n\n");
  //TFile *file = new TFile("hsimple.root");
}

void laser() {
   //print current canvas to a printer
   if (!gPad) {
      printf("Sorry laser invoked with no canvas\n");
      return;
   }
   gPad->GetCanvas()->Print("laser.ps");
   //call system with teh command to print a file
   //customize this line to your environment
   gSystem->Exec("xprint -P 892-2-cor laser.ps");
}   

To print the current canvas, just do:
  root > laser()

Rene Brun

Chris Milne wrote:
> 
> Hi there,
> 
> can anyone tell me if it's possible to print directly to hardware, I have tried
> without luck and am having to create .ps files and then print them manually.
> 
> If it is possible please give an example
> 
> thanks
> Chris Milne



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET