VB.NET PRINTING beginner questions 
Author Message
 VB.NET PRINTING beginner questions

In what unit is the printing done ?
How do I set the margins for printing ?
Are the margins automatically added when I print something ?
    for example: e.Grapthis.DrawLine(new Pen(color.Black),0,0,100,100)

- Wich units are the hundreds in ?
- Will the (0,0) co?rdinate refer to the top left of my page, or the top
left defined the margings ?
- How can I set these margins ?



Sun, 02 Jan 2005 14:59:54 GMT  
 VB.NET PRINTING beginner questions
Tom,

Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwi...
html/printwinforms.asp
for a great tutorial on .NET Report printing.

Cheers,
Rusty


Quote:
> In what unit is the printing done ?
> How do I set the margins for printing ?
> Are the margins automatically added when I print something ?
>     for example: e.Grapthis.DrawLine(new Pen(color.Black),0,0,100,100)

> - Wich units are the hundreds in ?
> - Will the (0,0) co?rdinate refer to the top left of my page, or the top
> left defined the margings ?
> - How can I set these margins ?



Sun, 02 Jan 2005 15:42:27 GMT  
 VB.NET PRINTING beginner questions
Tom,
    1) Units by default are 1/100ths of an inch.
    2) (0, 0) is the top left of the printable area (hard margin) for a
printer or just top/left of page for print preview.
    3) You have to enforce your own margins in your drawing code.  The
printer will enforce it's own margin area by not drawing/printing in them.

    You need to use GetDeviceCaps via PInvoke to retrieve the actual
top/left of the printer's area and adjust for these margins in your drawing
code.

    Your drawing code will go from top/left to 1"/1" on print preview and
from the top/left hard margin to 1" offset from them on a printer.

    Petzold's Programming Windows with C# has a good chapter on printing and
he uses it throughout the book.

    If/when you get to the part about hard margins, I have some code (in C#)
already working that gets them if you'd like a copy.

Ron Allen

Quote:
> In what unit is the printing done ?
> How do I set the margins for printing ?
> Are the margins automatically added when I print something ?
>     for example: e.Grapthis.DrawLine(new Pen(color.Black),0,0,100,100)

> - Wich units are the hundreds in ?
> - Will the (0,0) co?rdinate refer to the top left of my page, or the top
> left defined the margings ?
> - How can I set these margins ?



Sun, 02 Jan 2005 21:44:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB.NEt Beginner: Creating a COM+ Object in VB.net

2. Beginner's Question About ScrollBars in VB .NET

3. Beginner question about MS Office objects and VB .NET

4. Beginners ADO.NET Question

5. Database printing question from a beginner.

6. messageBox while printing (beginner question)

7. VB.NET Beginner notes

8. vb.net / ado.net design question

9. Newbie question (ado.net / vb.net)

10. Date problems with XML in ASP.NET / VB.NET- newbie question

11. VB.NET system.net.sockets question

12. Yet another book question ... a beginners book on VB.NET and the VS.NET IDE

 

 
Powered by phpBB® Forum Software