TPaveText not drawn in .png but drawn in .pdf

Hello,

I am drawing several TPaveText objects on a TCanvas which I then save (canvas.SaveAs()) in both pdf and png formats. However, these objects are only drawn in the pdf version. Does anyone know why it might be the case?

Thank you very much for your help!


ROOT Version:_ 6.12/07
Platform: Not Provided
Compiler: Not Provided


Hi @jsdancu,
welcome to the ROOT forum!
This sounds like a bug ( @couet, our graphics expert, can confirm), but I see you are using a ROOT version that is quite old.
Could you try to update to ROOT v6.20 or v6.22 and see if the problem is still there?
If yes, please provide a small reproducer and I will open a bug report (or you can directly open a bug report at https://sft.its.cern.ch/jira/ ).

Cheers,
Enrico

I just tried to reproduce your problem with:

   TPaveText *pt = new TPaveText(.3,.6,.7,.8,"br");
   pt->AddText("Hello");
   pt->Draw();
   gPad->SaveAs("c1.png");
   gPad->SaveAs("c1.pdf");

It works for me. Both files are correct. I am using the latest ROOT version on Mac but this should work with any ROOT version (that’s something very basic). Can you post an example reproducing your problem ?