Extract pictures from postscript

hi everybody

I have a set of ps files (bout 100 files), which are formated 3x2 on page.
I would like to have it displayed as gif/jpg/etc. on a html page 16x100.
16 pictures on a line. 100 lines correspond to 100 files.
all files are completely identical.

the problem i see is in extrcting plots from ps file. after spending some time for reding and investigting i did not find any solution for this. it looks like Root can onlye save file in ps format but is not able to read it.

any ideas?
many thanks
Igor

Hi Igor,

You can import any kind of files in the ROOT canvas (gif, png, pdf, ps, eps…)
For example

root > TASImage *img = new TASImage; root > img->ReadImage("myfile.ps"); root > TCanvas c; root > c.Divide(2,1); root > c.cd(2); root > img->Draw("x")

then you can point to the image in the pad and via the TASImage context menu transform the image (eg rotate it, etc)

Rene

thanks Rene
your approach is the only one that worked for me untill now.
I have still few problems:

  1. I can read only first page of my ps file
  2. one page looks like one image, although it has 6 plots on it.

do u have any other magic for this?
many thanks

[quote=“brun”]Hi Igor,

You can import any kind of files in the ROOT canvas (gif, png, pdf, ps, eps…)
For example

root > TASImage *img = new TASImage; root > img->ReadImage("myfile.ps"); root > TCanvas c; root > c.Divide(2,1); root > c.cd(2); root > img->Draw("x")

then you can point to the image in the pad and via the TASImage context menu transform the image (eg rotate it, etc)

Rene[/quote]

Hi Igor,

Can you send me your PS file ? I would like to play with it a bit to understand better what’s going on.

Thanks, Olivier

[quote=“couet”]Hi Igor,

Can you send me your PS file ? I would like to play with it a bit to understand better what’s going on.

Thanks, Olivier[/quote]

hi Oliver
the file is attached
thanks
Igor

I see what you mean now. (Your file has been generated by HIGZ/PAW.) Your file has 16 pages each of them being divided in 2x3 by the PAW command ZONE (many zone are empty by the way).

In ROOT when you do:

          img->ReadImage("061403.ps");

The first page in the PS file is used and the 15 remaining are ignored. But what else can it do ? ReadImage() fills the image “img”, which, by construction, is a “single page”. The only way I see to work around this problem is to split your PS file in 16 differents files. I never did that but with google I found there is tools doing this kind of “PS file splitting”:
ncl.ucar.edu/Document/Tools/psplit.shtml

An other way would be also to direclty generate 16 separated files from PAW if you still have the macro which produced this 16 pages file.

Finnally the unix command “psnup” may also help (I did not try). The help says:
"Psnup puts multiple logical pages onto each physical sheet of paper."

So that would be the reverse of the above recipe.