Friday, October 9, 2009

Printing active Topspin window works...now

TS2.1 PL4 was not playing well with RHEL v5.3, when it came to printing an active spectrum window onto the default printer.  The workaround was to use the XWINPLOT equivalent, which is invoked by 'plot' on the command line.

I confess that, although I sing the praise of XWINPLOT's virtues to new users, which  the software does deserve, after I started using the window dump feature of Topspin for a Q&D (i.e. quick and dirty) hard copy output, I find XWINPLOT to be a bit heavy.

I was getting a 'null attribute' error when I tried to dump the active window using ctrl+P and Brukerland asked me to check if I defined the default printer correctly. Yes I did, indeed, but to no avail.

What worked finally was this.
  • Install the latest jre i.e. jre-1.6.0-sun, to be precise, at the time of writing.
  • Soft link the same i.e. /usr/bin/java, again to be precise, to /opt/topspin/jre/bin/
  • Hold it ! Before you go gung-ho, backup the java binary under the topspin tree to something recognizable like java.original and then do the above. Sure, I did not do this the first time around. The soft link did not fire up TS and I realized too late that the orignal java binary is gone.  I had to reinstall TS because of this. Although this is only a precaution, you can save the effort of finding the TS DVD and installing it, in case something goes wrong. See next bullet.
  • By the way,  don't be over-zealous and go and link up the binary of the installed jre, which resides as : /usr/lib/jvm/jre-1.6.0-sun/bin/java. (Obviously, I tried this and screwed things up).   If you query for whereis java, you get the answer as :  /usr/bin/java.  Although /usr/bin/java is a link to another symlink that eventually points to the binary, you simply link /usr/bin/java to $TSHOME/jre/bin/ 
  • Everything should work fine after this. I am able to do a screen dump without issues. 
Problem solved...