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

Home » Public Forums » archive » Strange PRINTER Coordinates
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
Strange PRINTER Coordinates [message #20914] Sun, 30 July 2000 00:00 Go to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Hi Folks,

I've discovered a strange little thing in the process of trying
to center a graphics display on a page of paper using the
PRINTER device. I was having a devil of a time trying to
get the graphic centered, although the offsets and sizes
were calculated in exactly the same way they are calculated
to center the graphic on a PostScript printer with the PS
device.

In fooling around with it for awhile (I won't tell you
how long I fooled around with it for fear of losing whatever
programming reputation I have), I discovered that the
(0,0) point for calculating page offsets was a quarter
of an inch in from the edge of the paper!

This makes sense, sort of, since a laser printer
(I have a Lexmark Optra S 1250 PostScript Laser printer)
can't print on the outside quarter inch of the page
anyway, but it is not documentable anywhere that I
could find.

The solution I finally ended up with is to subtract
0.25 inches from whatever offset I think I want when
I use the PRINTER device. This gives me perfectly
centered output.

This explains a lot of problems I have been having
with PRINTER output, but have been too lazy to look
into. Does this seem to happen on your printers, too?

Here is a test case for an 8.5 x 11 inch sheet of
paper:

thisDevice = !D.Name
Set_Plot, 'PRINTER'
Device, /Portrait
Device, XSize=6, YSize=6, XOffset=1.25, YOffset=2.5, /Inches
PlotS, [0,1,1,0,0], [0,0,1,1,0], /Normal
Device, /Close_Document
Set_Plot, thisDevice

Is this box centered on your printer? What printer?
What version of IDL? If it is not centered, does
subtracting 0.25 from each offset help?

I also notice that I have to set the PORTRAIT or LANDSCAPE
keyword on a separate command line. If I try to set these
keywords on the same line where I am setting the sizes
and offsets, I get bogus results. Anyone else experiencing
this?

Thanks for your help.

Cheers,

David
--
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
Re: Strange PRINTER Coordinates [message #21042 is a reply to message #20914] Fri, 04 August 2000 00:00 Go to previous message
Eric Vella is currently offline  Eric Vella
Messages: 8
Registered: April 1999
Junior Member
What is really sad is that people have to do trial-and-error tests to
find out how IDL works, or do archaeological research into the source
code. While a fix to this problem might well belong in the top 10,
documentation of the actual IDL behavior seems at least equally
important.

David Fanning wrote:
>
> Hi Folks,
>
> I've discovered a strange little thing in the process of trying
> to center a graphics display on a page of paper using the
> PRINTER device. I was having a devil of a time trying to
> get the graphic centered, although the offsets and sizes
> were calculated in exactly the same way they are calculated
> to center the graphic on a PostScript printer with the PS
> device.
>
> In fooling around with it for awhile (I won't tell you
> how long I fooled around with it for fear of losing whatever
> programming reputation I have), I discovered that the
> (0,0) point for calculating page offsets was a quarter
> of an inch in from the edge of the paper!
>
> This makes sense, sort of, since a laser printer
> (I have a Lexmark Optra S 1250 PostScript Laser printer)
> can't print on the outside quarter inch of the page
> anyway, but it is not documentable anywhere that I
> could find.
>
> The solution I finally ended up with is to subtract
> 0.25 inches from whatever offset I think I want when
> I use the PRINTER device. This gives me perfectly
> centered output.
>
> This explains a lot of problems I have been having
> with PRINTER output, but have been too lazy to look
> into. Does this seem to happen on your printers, too?
>
> Here is a test case for an 8.5 x 11 inch sheet of
> paper:
>
> thisDevice = !D.Name
> Set_Plot, 'PRINTER'
> Device, /Portrait
> Device, XSize=6, YSize=6, XOffset=1.25, YOffset=2.5, /Inches
> PlotS, [0,1,1,0,0], [0,0,1,1,0], /Normal
> Device, /Close_Document
> Set_Plot, thisDevice
>
> Is this box centered on your printer? What printer?
> What version of IDL? If it is not centered, does
> subtracting 0.25 from each offset help?
>
> I also notice that I have to set the PORTRAIT or LANDSCAPE
> keyword on a separate command line. If I try to set these
> keywords on the same line where I am setting the sizes
> and offsets, I get bogus results. Anyone else experiencing
> this?
>
> Thanks for your help.
>
> Cheers,
>
> David
> --
> 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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Inconsistency: "sort" on UNIX <-> Windows
Next Topic: Re: Top 10 IDL Requests ... python

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

Current Time: Sat Oct 11 01:05:44 PDT 2025

Total time taken to generate the page: 0.72230 seconds