[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get page size for PRINTER device?
Phillip David (email@example.com) writes:
> So let me see if I understand correctly. Are you saying that the
> printable edges of the paper differ between the left and right sides?
> Or perhaps between the top and bottom? If not, why not just calculate
> things to center them on the PRINTABLE page? Wouldn't that also center
> them on the physical page?
> Or perhaps I'm just not getting it.
Oh, I hate these public arguments that expose
my ignorance. :-(
Yes, I think you are right. Here is a program that
will center a square plot on the printer page:
xsize = 10
ysize = 10
thisDevice = !D.Name
xprintArea = pseudoPageSize / !D.X_PX_CM
yprintArea = pseudoPageSize / !D.Y_PX_CM
xoff = (xprintArea - xsize) / 2.0
yoff = (yprintArea - ysize) / 2.0
Device, XSize=xsize, YSize=ysize, XOffset=xoff, YOffset=yoff
PlotS, [0,1,1,0, 0], [0, 0, 1, 1,0], /Normal
Sheesh. Back to the programming grind...
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: firstname.lastname@example.org
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155