# Root2ps

**URL:** <https://root-forum.cern.ch/t/root2ps/4542>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [March 19, 2007, 10:20am UTC](https://root-forum.cern.ch/t/root2ps/4542 "2007-03-19T10:20:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bspruck](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bspruck](https://root-forum.cern.ch/u/bspruck)\
**Post date:** [March 19, 2007, 10:20am UTC](https://root-forum.cern.ch/t/root2ps/4542/1 "2007-03-19T10:20:22Z")

</div>

A simple but useful utility.

It reads a rootfile and prints out all TCanvas, TH1 and TH2 ojects into a postscript file, each object on one page.

Can be compiled as standalone or within root utilities.

Code is based on hadd.  
Standalone compiling environment/manual copied from roo2h.

Comments welcome.

Tschau,

Bjoern  
[root2ps.tar.gz](https://root-forum.cern.ch/uploads/default/original/2X/c/c777f2d3edf1e7960bf1db6fb025267f8c294ee5.gz) (2.97 KB)

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [March 21, 2007, 12:02pm UTC](https://root-forum.cern.ch/t/root2ps/4542/2 "2007-03-21T12:02:22Z")

</div>

Hi Bjoern,

I looked at your tool. This could become a useful utility. It still requires some work to make it a bit more general. I have the following suggestions;  
-adapt the tool such that sub-directories are automatically processed, like in hadd.  
-give the possibility to divide the canvas into nxm pads  
-name of ps file optional, ie  
root2ps myfile.root  
will produce automatically [myfile.ps](http://myfile.ps)  
-in addition to ps, give the possibility to produce  
-a pdf file; root2ps myfile.root myfile.pdf  
-animated gif file : root2ps myfile.root myfile.gif  
-may be find a simple way to specify additional directives like  
-style  
-default options to draw TH1, TH2, TGraph, etc

Rene

---

<div class="post-metadata">

**Author:** ![bspruck](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bspruck](https://root-forum.cern.ch/u/bspruck)\
**Post date:** [March 21, 2007, 12:50pm UTC](https://root-forum.cern.ch/t/root2ps/4542/3 "2007-03-21T12:50:26Z")

</div>

Hi Rene!

Thanks for the response.

> [@brun](#):
>
> -adapt the tool such that sub-directories are automatically processed, like in hadd.

Recursive directories is already done.  
Optional ps name is easy to do in a few minutess.  
Parameter processing is as always… hm … work.

I will post a modified version when finished.

Tschau,

Bjoern

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [March 21, 2007, 1:06pm UTC](https://root-forum.cern.ch/t/root2ps/4542/4 "2007-03-21T13:06:34Z")

</div>

Bjoern,

I did not succeed with files having sub-directories and I had no time to investigate why :🙂

Rene

---

<div class="post-metadata">

**Author:** ![bspruck](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bspruck](https://root-forum.cern.ch/u/bspruck)\
**Post date:** [March 21, 2007, 4:20pm UTC](https://root-forum.cern.ch/t/root2ps/4542/5 "2007-03-21T16:20:47Z")

</div>

> [@brun](#):
>
> I did not succeed with files having sub-directories and I had no time to investigate why :🙂

Maybe because I did not post the newest code version yet. sorry.  
Here it is.

about pdf output:  
Why is the this Print(“filename.ps[”) opening scheme not supported for pdfs but only for ps?

Tschau,

```
Bjoern

```

[root2ps.cxx](https://root-forum.cern.ch/uploads/default/original/2X/3/3132ccedb57d67ec4b3576dcbe79a0e7ad78fad6.cxx) (2.34 KB)

---

<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:** [March 21, 2007, 5:30pm UTC](https://root-forum.cern.ch/t/root2ps/4542/6 "2007-03-21T17:30:11Z")

</div>

Cumulating images using () or [] in an output file is implemented for PS and EPS outputs only. It is much more complex to do it for PDF due to the internal structure of the PDF files. To be done.

---

<div class="post-metadata">

**Author:** ![bspruck](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bspruck](https://root-forum.cern.ch/u/bspruck)\
**Post date:** [April 28, 2008, 1:04pm UTC](https://root-forum.cern.ch/t/root2ps/4542/7 "2008-04-28T13:04:39Z")

</div>

Hi!

An updated version of root2ps.

Added some things quiet some while ago.  
Even so not all requested feature are added I think ist time to share it.

Tschau,

Bjoern  
[root2ps.tar.gz](https://root-forum.cern.ch/uploads/default/original/2X/c/c31cc2511c662291b021e97348327d407d634726.gz) (3.9 KB)

---

<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:** [April 28, 2008, 1:30pm UTC](https://root-forum.cern.ch/t/root2ps/4542/8 "2008-04-28T13:30:01Z")

</div>

Hi Bjoern,

Thanks for your update. I will look at it in view to include it in the ROOT distribution. Also I’ll try to see if we can do the same for PDF files. I’ll let you know.

Cheers, Olivier

---

<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:** [April 28, 2008, 3:28pm UTC](https://root-forum.cern.ch/t/root2ps/4542/9 "2008-04-28T15:28:13Z")

</div>

Hi Bjoern,

When I run your root2ps program it says:

> [@](#):
>
> Things to know:  
> ~/.root2ps/rootlogon.C will be executed before doing anything.

Is that something we really want ? Other applications like h2root do not have a such startup file. What is/are the reason(s) why we would like to have a such startup file ? Moreover, calling it rootlogon.C, even if it sits in a special hidden directory, might be confusing with the real rootlogon.C.  
What do you think ?

Cheers, Olivier

---

<div class="post-metadata">

**Author:** ![bspruck](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bspruck](https://root-forum.cern.ch/u/bspruck)\
**Post date:** [May 28, 2008, 8:38am UTC](https://root-forum.cern.ch/t/root2ps/4542/10 "2008-05-28T08:38:56Z")

</div>

[quote=“couet”]Hi Bjoern,

When I run your root2ps program it says:

> [@](#):
>
> Things to know:  
> ~/.root2ps/rootlogon.C will be executed before doing anything.

Is that something we really want ? Other applications like h2root do not have a such startup file. What is/are the reason(s) why we would like to have a such startup file ? Moreover, calling it rootlogon.C, even if it sits in a special hidden directory, might be confusing with the real rootlogon.C.  
What do you think ?  
[/quote]

The idea behind was that you can define colors, styles, etc seperatly without having the trouble to parse this by command line.  
Using the “global” file might be a better solution. But I would like to set it seperatly. Anyway, if the file is not existing, it does not matter.

Using the standard rootlogon.C has another disadvantage. You never know where it is. For example, it could be always in “.”. In that case, root2ps will behave differntly depending on where it was executed. This would be a very surprising behaviour.

Any ideas?

Tschau,

Bjoern

---

<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:** [November 6, 2015, 12:08pm UTC](https://root-forum.cern.ch/t/root2ps/4542/11 "2015-11-06T12:08:46Z")

</div>

see [rootprint](https://root.cern.ch/how/how-quickly-inspect-content-file).
