Solved

How do I Print on a pre formatted sheet of paper?

Posted on 2006-07-03
2
323 Views
Last Modified: 2012-06-22
Is it possible to print to an exact part of a piece of paper?

I would like to write a program to fill out several different pre-printed forms. is there an easy way to program coordinates in for where the program should print what?

I am using Visual Basic 2005.

Any help would be greatly appreciated.

Thank you!`
0
Comment
Question by:OsirisJa
2 Comments
 
LVL 9

Accepted Solution

by:
jrscherer earned 500 total points
ID: 17035214
Hi OsirisJa

Here is a very simplistic example. Before you run it make sure you have a default printer hooked up.
Create a form and place a Button and a PrintDocument on it. Run it and push Button1.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
           PrintDocument1.Print()
    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        e.Graphics.DrawString("Some Text", New Font("Arial", 10, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.Black, 250, 300)
    End Sub

This will print the text "Some Text" 2.5" to the right and 3.0" down from the top left margin corner.
Jack.net

0
 

Author Comment

by:OsirisJa
ID: 17041489
Thank you very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now