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

Re: Strange PRINTER Coordinates

   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

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