Solved

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

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open a link in vb.net 2 26
VB.net Duplicating a table - primary key not created 3 38
VB.Net creating Contact in Outlook 1 57
ModalPopup  question 22 38
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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