I have a root file including some canvases. Here I attached a code to print these canvas into a ps file according to the instruction of root web page. But a problem I met is: last canvas cannot be printed correctly into the file (just print one part of the canvas). I check the root file, it seems no problem for the last canvas. So I am wondering what’s up for my code here. I also attach my root file here (test.root). My root version is v04.04.
Thanks,
Zhiyi
{
TFile *f;
f = new TFile("test.root","READ");
f->cd();
TList *objlist = gDirectory->GetListOfKeys();
TIterator *can_itr = objlist->MakeIterator();
TKey *k2;
TCanvas *can;
while ( (k2 = static_cast<TKey*>(can_itr->Next())) !=0 )
{
can = (TCanvas*)k2->ReadObj();
can->Print("test.ps(");
}
can->Print("test.ps]");
f->Close();
}
test.root (71.1 KB)