[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get page size for PRINTER device?

Phillip David (phillip_david@xontech.com) writes:
> I do seem to recall a discussion a few months ago about printers in
> which someone indicated that they were unable to position something in a
> printer-independent way.  If they specified the upper-left corner, they
> got the upper-left corner inside the printable area on the page, and
> couldn't position a plot in the center of the page.  I may have the
> details incorrect, but the gist of the message certainly implied that
> the printer object only returns the printable area of the page rather
> than the actual page size.

That's right, it is impossible to center output on the
printer in a device-independent way.

For example, I like to have graphic output with the same
aspect ratio as the window on the display, but as large
as possible, and centered on the page. I use my PSWINDOW
program to calculate the proper size and offset values
to position the "window" on the page. But to get the
graphic exactly in the center of the page, I have to
use a printer-specific "fudge factor" to account for
the unprintable area on the page. On my printer, the
fudge factor is 0.25 inches in both X and Y. So my
code looks like this:

   position = PSWindow(Fudge=0.25, /Printer)
   thisDevice = !D.Name
   Set_Plot, 'PRINTER'
   Device, _Extra=position
   Plot, data, .....
   Device, /Close_Document
   Set_Plot, thisDevice

You can find PSWINDOW on my web page:




David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155