comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » "hyper" PS_FORM
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
"hyper" PS_FORM [message #10709] Tue, 13 January 1998 00:00 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
The sample programs provided by David Fanning at

http://www.dfanning.com/documents/programs.html

contain a wealth of good ideas. In fact, I use XWINDOW, TVIMAGE and
PS_FORM daily to do most of my graphics output. Thanks David!

One thing I had always wished for was a version of the PS_FORM
function that could be customized with different plot layouts and
paper sizes. I found myself wanting to make a series of plots with
the same margins and layout. I also suspect that many European IDL
users would like a PS_FORM that understands metric paper sizes. So, I
set to work to update PS_FORM.

I am pleased to announce my own version of PS_FORM, available from the
web, which I am distributing with David Fanning's permission. My
version was designed for use with IDL 4, but it has been tested
cursorily on IDL 5 by Fanning. You will find it at

http://astrog.physics.wisc.edu/~craigm/idl/idl.html

Although it retains its ancestral ties to PS_FORM, much of the program
is new, and David Fanning can't be responsible for it. This is pretty
much my own work here. Please let me know if it helps you out.

Craig

From the web page:
------------------
PS_FORM.PRO

Originally by David Fanning, this function creates a printer setup
dialog that can be used when sending output to a Postscript
printer. The user interactively selects the desired attributes of the
Postscript output, such as color and size. The return value of the
function is a structure which can be sent to the DEVICE command. David
Fanning's other superb graphics programs use this function to set up
Postscript printers.

This version is significantly enhanced from Fanning's original, but is
still a drop-in replacement. New features:

* Selection of paper size, including A4 and a myriad of other eurometric
paper dimensions. Please test this for me, since our printers are
exclusively US Letter size here.

* Custom plot layouts, selectable by dropbox. This is a great way to
ensure that every plot comes out with standard margins. Several of my
favorite layouts are included as the default, but you can include your
own by declaring a common block. The technique is documented under
"COMMON BLOCKS" at the head of the program file.

* Streamlined internal operations. The program file is quite a bit
shorter than the original.


--
------------------------------------
Craig Markwardt, Ph.D.
EMAIL: craigm@lheamail.gsfc.nasa.gov
------------------------------------
Re: "hyper" PS_FORM [message #10760 is a reply to message #10709] Mon, 19 January 1998 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
hahn@hrz.tu-darmstadt.de (Norbert Hahn) writes:
> European users should add the /isolatin1 to the parameter list of device.
> This simplifies the use of national characters.

I can try to put this into PS_FORM as well.

> [snip]
>> * Selection of paper size, including A4 and a myriad of other eurometric
>> paper dimensions. Please test this for me, since our printers are
>> exclusively US Letter size here.
>
>
> ... A more modern procedure should be able to read the PPD
> of the printer and find out the imageable area. The user may then shrink the
> imageable area to suit his purposes.
>
> Maybe I've overlooked it: How does ps_form center the printable area?

Neither my nor Fanning's version of PS_FORM will intelligently select
the print area. In my version, you can specify a default margin, but
that does not address the more general problem. Indeed, I am not sure
that the general problem can be solved to everybody's satisfaction.

My version of PS_FORM does support custom page layouts. You may
supply a list of "named" configurations to PS_FORM which appear as
predefined page layouts in the dialog box. I have used this to define
a "portrait", "landscape", etc. You could do the same for your
special purpose printers, enterring the specific margins for each.
You could enter this as a common block in your startup file and thus
have the same printer setups available in each IDL session. It's not
perfect, but it can work.

As for the use of common blocks, I understand Fanning's trepidation.
I chose to use them because they provide named, persistent, and global
storage between calls to PS_FORM. I didn't see any other facilities
in IDL to do this. If you are a stickler, you can call PS_FORM with
the NOCOMMON keyword and then the common is not declared or accessed.
I'm open to suggestions.

Craig

P.S. For those who are coming late, you can find my revised PS_FORM,
an IDL widget dialog box for configuring your PS printer, at

http://astrog.physics.wisc.edu/~craigm/idl/idl.html

It is originally based on David Fanning's IDL procedure of the same
name, but heavily modified. More documentation is on the web page.

--
------------------------------------
Craig Markwardt, Ph.D.
EMAIL: craigm@lheamail.gsfc.nasa.gov
------------------------------------
Re: "hyper" PS_FORM [message #10762 is a reply to message #10709] Mon, 19 January 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Norbert Hahn (hahn@hrz.tu-darmstadt.de) writes:

> Maybe I've overlooked it: How does ps_form center the printable area?

Poorly. :-(

PS_Form was one of the first really "useful" IDL widget
programs I ever wrote. I shamelessly copied it from a similar
version that I first saw in ENVI. Unlike the ENVI version
(I suspect, since I never saw the code) my version is terrible.
It is one of the worst widget programs I ever wrote. It is
a continual embarrassment to me that it is also one of the
most widely used. The worst thing about it is that everything
in it is hardcoded, especially the printable area.

I guess you could say that everything I know today about writing
modular widget programs that can be easily extended and maintained
I learned in response to this ill-tempered program. Maybe one of
the reasons I never find the time to re-write it correctly is that
I secretly like to have it around to remind me where I came from. :-)

I've been thinking about re-writing it for a long time to
incorporate other page sizes, but whenever I get some
free time other, higher priority tasks push their way into my
consciousness. Craig Markwardt finally got tired of me dragging
my heels and asked me if he could publish his solution. I'm
grateful for his help, but his use of a Common block gets
in the way of my wholehearted endorsement. :-)

Anyway, I have a number of ideas of how it "ought" to be
written. (And, frankly, it "ought" to be written as an
object.) One of these days I am going to have another go
at writing it correctly.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: "hyper" PS_FORM [message #10763 is a reply to message #10709] Mon, 19 January 1998 00:00 Go to previous message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
Craig Markwardt <craigm@cow.physics.wisc.edu> wrote:

> The sample programs provided by David Fanning at

[snip]
> I also suspect that many European IDL
> users would like a PS_FORM that understands metric paper sizes. So, I
> set to work to update PS_FORM.

European users should add the /isolatin1 to the parameter list of device.
This simplifies the use of national characters.

[snip]
> * Selection of paper size, including A4 and a myriad of other eurometric
> paper dimensions. Please test this for me, since our printers are
> exclusively US Letter size here.

A couple of plotters will be quite happy with this procedure. However, some
devices with cut paper may show a problem: The printable area is smaller
than the paper size: We have 6 special purpose PS printers, all support A4,
some printers support a couple of other paper sizes as well. I checked
the PPDs of some ouf our printers and found it a horrible task to process
a PPD with IDL.

A long time ago there was a procedure called phaser.pro (which now resides
in the obsolete directory) that handles the printable area of some Tektronix
Phaser printers... A more modern procedure should be able to read the PPD
of the printer and find out the imageable area. The user may then shrink the
imageable area to suit his purposes.

Maybe I've overlooked it: How does ps_form center the printable area?

... just a couple of thoughts

Norbert
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL-Beginner
Next Topic: NEDIT Language-Mode 2nd Try...

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:05:26 PDT 2025

Total time taken to generate the page: 0.00798 seconds