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

Home » Public Forums » archive » How to get page size for PRINTER device?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to get page size for PRINTER device? [message #22871 is a reply to message #22731] Wed, 06 December 2000 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Phillip David (phillip_david@xontech.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:

PRO center_plot
xsize = 10
ysize = 10
thisDevice = !D.Name
Set_Plot, 'Printer'
Device, Get_Page_Size=pseudoPageSize
xprintArea = pseudoPageSize[0] / !D.X_PX_CM
yprintArea = pseudoPageSize[1] / !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
Device, /Close_Document
Set_Plot, thisDevice
END

Sheesh. Back to the programming grind...

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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: underscore bug?
Next Topic: Zooming in Object Graphics

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

Current Time: Sun Oct 12 03:04:00 PDT 2025

Total time taken to generate the page: 2.80031 seconds