Re: Finding the printable area?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ron Allen (rallen_at__nospam_src-us.com)
Date: 04/13/04


Date: Tue, 13 Apr 2004 08:34:10 -0400

Steve,
    You will need to use PInvoke on GetDeviceCaps to find the exact margins.
In version 1.1 you can set a property in PageSettings to start the origin at
the margins vs. the physical boundary but that doesn't tell you the size of
the physical printable area. Just get your hDC from the graphics and call
GetDeviceCaps to check sizes. If you would like some C# code for this let
me know.

Ron Allen
"Steve Podradchik" <StevePodradchik@hotmail.com> wrote in message
news:uQZi08MIEHA.828@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Our app likes to print data-rich output that fills the page width of the
> printer. Unfortunately, we've found that the printable area of each
printer
> is a little different, making it a bit of a guess to set the left/right
> print margins which seem additive to the printable area start. I don't
> believe that .Net directly supports providing the printable area but I
seem
> to remember someone, > 1 year ago, posting some C code to find the
printable
> area. Any ideas? Or did I miss something in .Net?
>
> Thanks, Steve
>
>



Relevant Pages

  • Re: PrintDocument lines per page calculation
    ... The only way to reliably determine the exact 'hard' margins of any ... printer including all the new ones is to use PInvoke on GetDeviceCaps on the ... of the physical page instead of the printable area. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Accurate positioning of polygon for printer
    ... The GetDeviceCaps function effectively returns the position of the top left corner of the page's printable area. ... Also, both the size and position of the printable area can be different on different printers, which is why we need to use GetDeviceCaps to get those values again if we print to a different printer, or even to the same printer at different user settings. ... There are some printers, and some HP printers that I know of personally, which misreport their unprintable margins, and some which only misreport it under certain specific settings, because HP have not got the driver programmed properly. ...
    (microsoft.public.vb.general.discussion)
  • Re: Change paper size; Word changes to invalid margins
    ... Margins: Top and bottom 1, ... What is the specific printable area in this case? ... If Word determines this from the print driver, ... Then I go back to Control Panel and change back to standard Letter (8.5 x ...
    (microsoft.public.word.newusers)
  • Re: [opensuse] subtle format change in OOo from suse 10.1 to 10.2
    ... found switching print drivers often changes things like margins and the ... printable area of the page. ... I switched to the standard cups printer and the problem is the same. ...
    (SuSE)
  • Word 2003 - Printer margins affecting pagination...
    ... I never mess with the printer's margins; ... is there I set the documents printable area. ... have used several types of printers and all of them print ... This forces the text in those cells to occupy ...
    (microsoft.public.word.newusers)