# Set header of a PostScript file

**URL:** <https://root-forum.cern.ch/t/set-header-of-a-postscript-file/4765>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [May 10, 2007, 1:47pm UTC](https://root-forum.cern.ch/t/set-header-of-a-postscript-file/4765 "2007-05-10T13:47:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbat](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@kbat](https://root-forum.cern.ch/u/kbat)\
**Post date:** [May 10, 2007, 1:47pm UTC](https://root-forum.cern.ch/t/set-header-of-a-postscript-file/4765/1 "2007-05-10T13:47:42Z")

</div>

I just thought this could be useful for others…

I usually print many .ps files created by the ROOT scripts and sometimes I forget when I have created a particular plot.  
Once I thought that it would be a good idea to place a small label with time and date in the corner of each picture. For example, one can do it by the following code in ~/.rootlogon.C

```auto
TDatime *dt4headerps = new TDatime();
gStyle->SetHeaderPS(Form("gsave 0 -20 t 0 r 0 0 m /Helvetica findfont 25 sf 0 0 m ( %s %s ) show gr",
                    dt4headerps->AsString(),
                    gSystem->GetUserInfo(gSystem->GetUid())->fUser.Data()));
delete dt4headerps; dt4headerps = 0;
```

Whenever you create a .ps file by the ROOT script you will see a label in the left bottom corner of the first sheet of your file.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 10, 2007, 2:29pm UTC](https://root-forum.cern.ch/t/set-header-of-a-postscript-file/4765/2 "2007-05-10T14:29:21Z")

</div>

That’s nice. Note also that gStyle-\>SetOptDate(1) does something very similar.

---

<div class="post-metadata">

**Author:** ![kbat](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@kbat](https://root-forum.cern.ch/u/kbat)\
**Post date:** [May 10, 2007, 4:12pm UTC](https://root-forum.cern.ch/t/set-header-of-a-postscript-file/4765/3 "2007-05-10T16:12:07Z")

</div>

> [@](#):
>
> Note also that gStyle-\>SetOptDate(1) does something very similar.

That is really useful! That would also be great to have a method which prints the script name somewhere in the corner of the canvas.
