473,387 Members | 1,603 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,387 software developers and data experts.

printing - problem with margins

ool
Hello,

How can I get physical margins of printer??
When I do it in this way :
public void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
...
iLeftMargin = ev.MarginBounds.X ; // is always 100 = 1inch
iPageWidth = ev.MarginBounds.Width // is always 2 inches smaler than
ev.PageBounds.Width
}
I would like get the same values which I get using GetDeviceCaps(hdc,
PHYSICALOFFSETY); in Visual C++
Thomas
Nov 15 '05 #1
2 1449
Thomas,
You will have to PInvoke on GetDeviceCaps in a call to print a document.
Just do the same calculations as before wrapped in the PInvoked method and
change the result to 1/100ths of an inch.

Ron Allen
"ool" <so***@no.spam> wrote in message
news:bk**********@atlantis.news.tpi.pl...
Hello,

How can I get physical margins of printer??
When I do it in this way :
public void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
...
iLeftMargin = ev.MarginBounds.X ; // is always 100 = 1inch
iPageWidth = ev.MarginBounds.Width // is always 2 inches smaler than ev.PageBounds.Width
}
I would like get the same values which I get using GetDeviceCaps(hdc,
PHYSICALOFFSETY); in Visual C++
Thomas

Nov 15 '05 #2
Thomas,
You will have to PInvoke on GetDeviceCaps in a call to print a document.
Just do the same calculations as before wrapped in the PInvoked method and
change the result to 1/100ths of an inch.

Ron Allen
"ool" <so***@no.spam> wrote in message
news:bk**********@atlantis.news.tpi.pl...
Hello,

How can I get physical margins of printer??
When I do it in this way :
public void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
...
iLeftMargin = ev.MarginBounds.X ; // is always 100 = 1inch
iPageWidth = ev.MarginBounds.Width // is always 2 inches smaler than ev.PageBounds.Width
}
I would like get the same values which I get using GetDeviceCaps(hdc,
PHYSICALOFFSETY); in Visual C++
Thomas

Nov 15 '05 #3

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
5
by: Mr. B | last post by:
This is driving me NUTZ!!! I've been screwing around on this for a week now. And I have tried to find examples similar to what I have (nada). Got lots of streaming a TXT file... bah! I am...
2
by: qumpus | last post by:
My program right now generates USPS style shipping label using System.Drawing.Graphics. It works fine except that the printer prints really slowly. I want to make my program take advantage of true...
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...
4
by: iwdu15 | last post by:
can anybody help me print from a rich text box? i tried the way they showed on the MSDN web page, but it did not work. I am using VB.net 2003...any help would be appreciated
7
by: DazedAndConfused | last post by:
I have a 8.5 x 11 landscape document with about 1/4 inch of space on the left and right where there is no print. The document displays perfect in print preview, but when I print it, about 1/2 inch...
7
by: tm | last post by:
I am trying to print a form using the following code, everything works fine but the margins are not acted upon. What I am I doing wrong? Private Sub CaptureScreen() Dim myGraphics As...
8
by: Frank Rizzo | last post by:
I am trying to print huge images (much bigger than target paper). I try and use e.PageSettings.HardMarginX and e.PageSettings.HardMarginY in the PrintDocument's PrintPage event to try and...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.