Re: Work around Postcript size,was PS Range

Rene Brun (Rene.Brun@cern.ch)
Thu, 20 Feb 1997 18:27:20 +0100


> My mail again concerns the size of Postscript files. If the >constructor does set the initial size, and the Range function doesn't >touches this size afterwords, then one could (as a work around) just >build an additional constructor for the Postscript file, which takes the >size as an arguement.
>
> I looked on the root-homepage but I couldn't find the sourcecode for >the the whole root class library (LINUX version). I mean, there are the
> include files but not the source files for the libraries. Where if
> possible - do I get the whole - not precompiled - source code ? Or did >I overlook something ?
>
> I would like to do the compiling (adding the constructor) on my own,
> cause I like PS-files which don't have to be resized when used in >papers or similar things.
> any help (or pointers to the right location) is appreciated.
> Mats

Many apologies. I realized only now that we introduced a change
in the TPostScript class on January 23 in an intermediate version
stamped 0.90/13. This change (2 lines) was to initialize correctly
the paper size in the Range function. Obviously, my current version
works.

If you have the courage to compile the following small class
derived from TPostScript, I believe it solves the problem for version
0.90/12.

#ifndef ROOT_TPostScriptOK
#define ROOT_TPostScriptOK

#ifndef ROOT_TPostScript
#include "TPostScript.h"
#endif

class TPostScriptOK : public TPostScript {
public:
TPostScriptOK() {;}
TPostScriptOK(Text_t *filename, Int_t type=-111)
{TPostScript(filename,type);}
virtual ~TPostScriptOK() {;}
void RangeOK(Float_t xrange, Float_t yrange) {
fXsize = xrange;
fYsize = yrange;
Range(xrange,yrange)};
#endif

Now instead of doing
TPostScript myps("file.ps")
myps.Range(8,8);
do
TPostScriptOK myps("file.ps");
myps.RangeOK(8,8);

To do that, you do not need the source file of the TPostScript class.
Source was not included in the distribution kit for version 0.9.
It will be in version 1.0

Rene Brun