Solved

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

Posted on 2006-07-03
2
331 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 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

729 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