Printing

M

Massimo

I need to print from a Windows Forms application on some custom paper
modules.

I have an Image object which contains what I need to print (mainly checks
for some printed checkboxes on the modules), but the image need to be
aligned and sized properly to match what is already printed on the modules.

I need to create a "calibrate printer" dialog to set margins and other
parameters (I think the printer's DPI should also be taken into account...
am I guessing right?) and do some preview printouts; then I need to size,
align and print the main image(s).

Can someone please suggest the best approach for accomplishing this?

I'm quite skilled with Windows Forms, but I know absolutely nothing about
printing on Windows systems.


Thanks


Massimo
 
G

Guest

Hi there!

In .net framework 2 there are lots of nice controls and dialogs to help you
print.

I recommend you look up the following in MSDN in System.Windows.Forms:

PageSetupDialog
PrintDialog
PrintPreviewDialog

In each case MSDN contains sample code, however to give you a quick overview:

1. A PrintDocument object represents what you want to print
2. When its Print function is called events are fired for each page that
needs to be rendered
3. You catch the events and then draw your image or text directly onto the
graphics surface using functions like Graphics.DrawImage
4. The dialogs mentioned above all manipulate this PrintDocument class and
another PageSettings class to allow the user to enter printer and page
preferences.

MSDN is v good on printing and reading through the docs will save you lots
of time so good hunting!
F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top