TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Murugesan Allimuthu
NA
3
1.4k
Printing Doesn't Print at the specified location
Dec 5 2013 2:47 AM
I use the following code to print text "A" at 100,200 (Points), But it prints at 114,180, What is wrong with my code?
Imports System.IO
Imports System.Drawing.Printing
Public Class Form1
Public egraphics As Graphics
Public prnDocument As New System.Drawing.Printing.PrintDocument
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim psize As New Printing.PaperSize("A4", 842, 595)
AddHandler prnDocument.PrintPage, AddressOf PrintPage
prnDocument.DefaultPageSettings.PaperSize = psize
prnDocument.DefaultPageSettings.Margins.Top = 0
prnDocument.DefaultPageSettings.Margins.Left = 0
prnDocument.DefaultPageSettings.Margins.Bottom = 0
prnDocument.DefaultPageSettings.Margins.Right = 0
prnDocument.OriginAtMargins = True
prnDocument.Print()
End Sub
Private Sub PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim fReportFont As System.Drawing.Font
egraphics = e.Graphics
egraphics.PageUnit = GraphicsUnit.Point
fReportFont = New System.Drawing.Font(Trim("Helvetica"), 60, FontStyle.Regular)
egraphics.DrawString("A", fReportFont, New SolidBrush(Color.Black), 100, 200)
End Sub
End Class
Reply
Answers (
1
)
date to int
How to get connection speed of Wifi using c#