?
Solved

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

Posted on 2006-07-03
2
Medium Priority
?
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
jrscherer earned 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

719 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