How to properly save TCanvas title with pdf/png files

Hello

I am having a canvas which I write both in .root and save it also as .pdf - my code looks like

[code] char namee[100];
sprintf(namee,"%s",htest->GetName ());
c1->SetTitle(namee);
gPad->RedrawAxis();
gPad->Modified();
gPad->Update();
tex = new TLatex(6.471403,1.803921e+08,“Some title here”);
tex->SetLineWidth(2);
tex->Draw();

    c1->cd();
    c1->Modified();
    c1->cd();
    c1->Update();

    c1->Write (namee);
       char f[100];
       sprintf(f,"Tau/%s.pdf",namee);
     
       c1->SaveAs (f);

[/code]

my problem is that the Title is shown ok if I open from the .root file, but it is not shown on the save .pdf . What am I missing ?

Thanks

Alex

does the title have a “” ?

No, but can have a space.

can you send a small macro reproducing the issue ?