@@ -5124,6 +5124,9 @@ void TPad::Print(const char *filename, Option_t *option)
5124
5124
TString opt = !option ? opt_default : option;
5125
5125
Bool_t image = kFALSE ;
5126
5126
5127
+ Bool_t title = kFALSE ;
5128
+ if (strstr (opt," Title:" )) title = kTRUE ;
5129
+
5127
5130
if (!fs1.Length ()) {
5128
5131
psname = GetName ();
5129
5132
psname += opt;
@@ -5141,25 +5144,25 @@ void TPad::Print(const char *filename, Option_t *option)
5141
5144
5142
5145
// Save pad/canvas in alternative formats
5143
5146
TImage::EImageFileTypes gtype = TImage::kUnknown ;
5144
- if (strstr (opt, " gif+" )) {
5147
+ if (!title && strstr (opt, " gif+" )) {
5145
5148
gtype = TImage::kAnimGif ;
5146
5149
image = kTRUE ;
5147
- } else if (strstr (opt, " gif" )) {
5150
+ } else if (!title && strstr (opt, " gif" )) {
5148
5151
gtype = TImage::kGif ;
5149
5152
image = kTRUE ;
5150
- } else if (strstr (opt, " png" )) {
5153
+ } else if (!title && strstr (opt, " png" )) {
5151
5154
gtype = TImage::kPng ;
5152
5155
image = kTRUE ;
5153
- } else if (strstr (opt, " jpg" )) {
5156
+ } else if (!title && strstr (opt, " jpg" )) {
5154
5157
gtype = TImage::kJpeg ;
5155
5158
image = kTRUE ;
5156
- } else if (strstr (opt, " tiff" )) {
5159
+ } else if (!title && strstr (opt, " tiff" )) {
5157
5160
gtype = TImage::kTiff ;
5158
5161
image = kTRUE ;
5159
- } else if (strstr (opt, " xpm" )) {
5162
+ } else if (!title && strstr (opt, " xpm" )) {
5160
5163
gtype = TImage::kXpm ;
5161
5164
image = kTRUE ;
5162
- } else if (strstr (opt, " bmp" )) {
5165
+ } else if (!title && strstr (opt, " bmp" )) {
5163
5166
gtype = TImage::kBmp ;
5164
5167
image = kTRUE ;
5165
5168
}
@@ -5210,32 +5213,32 @@ void TPad::Print(const char *filename, Option_t *option)
5210
5213
}
5211
5214
5212
5215
// ==============Save pad/canvas as a C++ script==============================
5213
- if (strstr (opt," cxx" )) {
5216
+ if (!title && strstr (opt," cxx" )) {
5214
5217
GetCanvas ()->SaveSource (psname, " " );
5215
5218
return ;
5216
5219
}
5217
5220
5218
5221
// ==============Save pad/canvas as a root file===============================
5219
- if (strstr (opt," root" )) {
5222
+ if (!title && strstr (opt," root" )) {
5220
5223
if (gDirectory ) gDirectory ->SaveObjectAs (this ,psname.Data ()," " );
5221
5224
return ;
5222
5225
}
5223
5226
5224
5227
// ==============Save pad/canvas as a XML file================================
5225
- if (strstr (opt," xml" )) {
5228
+ if (!title && strstr (opt," xml" )) {
5226
5229
// Plugin XML driver
5227
5230
if (gDirectory ) gDirectory ->SaveObjectAs (this ,psname.Data ()," " );
5228
5231
return ;
5229
5232
}
5230
5233
5231
5234
// ==============Save pad/canvas as a JSON file================================
5232
- if (strstr (opt," json" )) {
5235
+ if (!title && strstr (opt," json" )) {
5233
5236
if (gDirectory ) gDirectory ->SaveObjectAs (this ,psname.Data ()," " );
5234
5237
return ;
5235
5238
}
5236
5239
5237
5240
// ==============Save pad/canvas as a SVG file================================
5238
- if (strstr (opt," svg" )) {
5241
+ if (!title && strstr (opt," svg" )) {
5239
5242
gVirtualPS = (TVirtualPS*)gROOT ->GetListOfSpecials ()->FindObject (psname);
5240
5243
5241
5244
Bool_t noScreen = kFALSE ;
@@ -5276,7 +5279,7 @@ void TPad::Print(const char *filename, Option_t *option)
5276
5279
}
5277
5280
5278
5281
// ==============Save pad/canvas as a TeX file================================
5279
- if (strstr (opt," tex" ) || strstr (opt," Standalone" )) {
5282
+ if (!title && ( strstr (opt," tex" ) || strstr (opt," Standalone" ) )) {
5280
5283
gVirtualPS = (TVirtualPS*)gROOT ->GetListOfSpecials ()->FindObject (psname);
5281
5284
5282
5285
Bool_t noScreen = kFALSE ;
@@ -5364,7 +5367,7 @@ void TPad::Print(const char *filename, Option_t *option)
5364
5367
if (!gVirtualPS || mustOpen) {
5365
5368
5366
5369
const char *pluginName = " ps" ; // Plugin Postscript driver
5367
- if (strstr (opt," pdf" ) || strstr (opt, " Title: " ) || strstr (opt," EmbedFonts" ))
5370
+ if (strstr (opt," pdf" ) || title || strstr (opt," EmbedFonts" ))
5368
5371
pluginName = " pdf" ;
5369
5372
else if (image)
5370
5373
pluginName = " image" ; // Plugin TImageDump driver
0 commit comments