473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Setting Margins

If margins are measured from the paper edge
then I need to know the distance from the paper edge to the printable area
edge
so that I can be sure the user does not set the margin less than that.

If margins are measured from the printable edge
then I need to know the distance from the paper edge to the printable area
edge
so that when the user specifies the margin from the paper edge
I can calculate the margin from the printable area edge.

Anyone know where margins are measured from?

Also, how can I get the distance from the paper edge to the printable edge?
Thanks in advance,
Cal
Nov 20 '05 #1
7 1540
* " active" <ac****@REMOVEa-znet.com> scripsit:
Also, how can I get the distance from the paper edge to the printable edge?


<http://groups.google.com/groups?selm=OQwPH6b6CHA.1868%40TK2MSFTNGP12.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
That's what I did in VB6. Didn't what to use it if there was a managed way.

Thanks
Cal
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bp*************@ID-208219.news.uni-berlin.de...
* " active" <ac****@REMOVEa-znet.com> scripsit:
Also, how can I get the distance from the paper edge to the printable
edge?
<http://groups.google.com/groups?selm...FTNGP12.phx.gb
l>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
* " active" <ac****@REMOVEa-znet.com> scripsit:
That's what I did in VB6. Didn't what to use it if there was a managed way.


If I would know a managed way, I would have posted it.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Cal,
Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual
Basic .NET - Core Reference" from MS Press has a discussion where you can
approximate the area, but to get a precise number you need to use the
GetDeviceCaps that Herfried showed.

VS.NET 2003 (.NET 1.1) includes a new PrintDocument.OriginAtMargins
property, which won't help with finding the number, but does help with
printing.

Hope this helps
Jay
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
If margins are measured from the paper edge
then I need to know the distance from the paper edge to the printable area
edge
so that I can be sure the user does not set the margin less than that.

If margins are measured from the printable edge
then I need to know the distance from the paper edge to the printable area
edge
so that when the user specifies the margin from the paper edge
I can calculate the margin from the printable area edge.

Anyone know where margins are measured from?

Also, how can I get the distance from the paper edge to the printable edge?

Thanks in advance,
Cal

Nov 20 '05 #5
I did this in VB6 but I use Printer.hdc. I can't figure how to get a
printer DC now. I not in any special method when I need it so I can't use a
method argument.
Thanks
Cal

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:OO*************@TK2MSFTNGP10.phx.gbl...
Cal,
Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual Basic .NET - Core Reference" from MS Press has a discussion where you can
approximate the area, but to get a precise number you need to use the
GetDeviceCaps that Herfried showed.

VS.NET 2003 (.NET 1.1) includes a new PrintDocument.OriginAtMargins
property, which won't help with finding the number, but does help with
printing.

Hope this helps
Jay
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
If margins are measured from the paper edge
then I need to know the distance from the paper edge to the printable area edge
so that I can be sure the user does not set the margin less than that.

If margins are measured from the printable edge
then I need to know the distance from the paper edge to the printable area edge
so that when the user specifies the margin from the paper edge
I can calculate the margin from the printable area edge.

Anyone know where margins are measured from?

Also, how can I get the distance from the paper edge to the printable

edge?


Thanks in advance,
Cal


Nov 20 '05 #6
Cal,
You can use CreateMeasurementGraphics on a PrinterSettings object to get
a Graphics. Then call GetHDC() on the Graphics.
Ron Allen
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I did this in VB6 but I use Printer.hdc. I can't figure how to get a
printer DC now. I not in any special method when I need it so I can't use a method argument.
Thanks
Cal

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:OO*************@TK2MSFTNGP10.phx.gbl...
Cal,
Charles Petzold's book "Programming Microsoft Windows with Microsoft

Visual
Basic .NET - Core Reference" from MS Press has a discussion where you can
approximate the area, but to get a precise number you need to use the
GetDeviceCaps that Herfried showed.

VS.NET 2003 (.NET 1.1) includes a new PrintDocument.OriginAtMargins
property, which won't help with finding the number, but does help with
printing.

Hope this helps
Jay
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
If margins are measured from the paper edge
then I need to know the distance from the paper edge to the printable

area edge
so that I can be sure the user does not set the margin less than that.
If margins are measured from the printable edge
then I need to know the distance from the paper edge to the printable area edge
so that when the user specifies the margin from the paper edge
I can calculate the margin from the printable area edge.

Anyone know where margins are measured from?

Also, how can I get the distance from the paper edge to the printable

edge?


Thanks in advance,
Cal



Nov 20 '05 #7
Cal,
Also note that if you set offsets for your PrintPage routine hardwired
to the printer then the PrintPreview with this will be offset up and to the
right by this amount.

Ron Allen
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I did this in VB6 but I use Printer.hdc. I can't figure how to get a
printer DC now. I not in any special method when I need it so I can't use a method argument.
Thanks
Cal

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:OO*************@TK2MSFTNGP10.phx.gbl...
Cal,
Charles Petzold's book "Programming Microsoft Windows with Microsoft

Visual
Basic .NET - Core Reference" from MS Press has a discussion where you can
approximate the area, but to get a precise number you need to use the
GetDeviceCaps that Herfried showed.

VS.NET 2003 (.NET 1.1) includes a new PrintDocument.OriginAtMargins
property, which won't help with finding the number, but does help with
printing.

Hope this helps
Jay
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
If margins are measured from the paper edge
then I need to know the distance from the paper edge to the printable

area edge
so that I can be sure the user does not set the margin less than that.
If margins are measured from the printable edge
then I need to know the distance from the paper edge to the printable area edge
so that when the user specifies the margin from the paper edge
I can calculate the margin from the printable area edge.

Anyone know where margins are measured from?

Also, how can I get the distance from the paper edge to the printable

edge?


Thanks in advance,
Cal



Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pedro Feio | last post by:
Hi, I'm having a weird problem setting up the paper size in a C# Windows Forms Application. The code I'm using is something like this: PrintDocument pd = new PrintDocument(); ...
1
by: Kinetic - Paul G | last post by:
Hi All Hope someone can help out . . . I have a system that worked fine in A97 .and Win 98 with NT server . . . 10 PCs running a front end MDB and usual backend MDB with tables on the server....
1
by: Holly | last post by:
Hi, I am using framework 1.0 to implement a printing method. The page margins I set won't show correctly on my print out. The code is: PageSettings pset=new PageSettings(); pset.Margins =new...
8
by: Tinus | last post by:
Hello all, Because you have been so helpfull the last couple of times, I thought after testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I would ask you again for your...
1
by: Keith | last post by:
I'm trying to set an ASP.NET page so that is has no margins. I'm using Flow Layout mode, and I keep setting all the document's margin properties to zero, but when I pull the page up in Internet...
1
by: Fred Nelson | last post by:
I'm a newby and I'm writing my first VB.NET print program! I need to change the default left and right margins for my printed output "e" is my "System.Drawing.Printing.PrintPageEventArgs By...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
2
by: Steve | last post by:
Hi All Using VB.net 2008, windows forms application on Windows XP SP2 I need to set the paper size when printing to an 80mm Epson docket printer using windows drivers Some customers have...
19
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.