We utilise pyROOT-based scripts to provide plots for our analysis. We have noticed a peculiar behaviour of some of our scripts, namely sometimes SaveAs seems to add the full output path as meta-data to a PDF file, sometimes not. This is an unwanted feature, given the PDF files are published online and a full eos path will be visible when a PDF file is opened. Reproducing the issue is difficult, as some plots produced with the script have this problem, some not.
I think yes, this is exactly what I am talking about. I guess I feel confused as some files keep this title information as a header when I rename and publish these plots, some don’t. Why does the outcome vary? While I would love to have all the fame for making the plots for one of the analysis of a big collaboration, I guess sharing my EOS paths publicly is not how one would hope it to happen.
I would like to send you an example to an existing plot privately if that is OK?
I examined the details. The file name you provide to the SaveAs or Print methods is used as the global Title for the PDF file, and there is no way to change it. If you provide a full path name to the SaveAs or Print methods, the entire path will appear in the PDF file’s Title metadata. To avoid this, generate the PDF file in the current working directory and then move it to your preferred folder.
Create the file ChangePDFTitle.sh containing the above lines and make it executable with:
$ chmod +x ChangePDFTitle.sh
Then, if you place it in a directory that is part of your $PATH , you can execute the following command to change the Title metadata of any PDF file generated by ROOT: