Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Components & Controls
Reporting / Printing
Sending data/textbox value to thermal printer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="IanRyder, post: 171073, member: 40986"] Hi, Since there seems to be so little to print here, it seems strange to me why you have focused so much effort on printing individual characters and forcing the printing of additional pages when it seems you do not need to. When it comes to Printing and Graphics of any kind the most important thing is to make sure you keep control of your X and Y Coordinate so that you know where Drawings will Start and End. Here is a small rewrite of how I would start to go about this. See if this helps to get you on track:- [XCODE=vb]'Set Start Margins Dim leftMargin As Integer = 5 Dim topMargin As Integer = 5 Dim pageWidth As Integer = e.PageBounds.Width Dim pageHeight As Integer = e.PageBounds.Height 'Get the Logo and Print It Dim myImage As Image = Image.FromFile("c:\temp\accept_300x300.png") Dim imageRect As New Rectangle(topMargin, leftMargin, myImage.Width, myImage.Height) e.Graphics.DrawImage(myImage, imageRect) 'Get the Queuing Number Dim largeFont As New Font("Times New Roman", 55, FontStyle.Bold) Dim printString As String = "00001" Dim currentXPos As Integer = leftMargin Dim currentYPos As Integer = topMargin + myImage.Height + 5 Dim currentPrintRect As New Rectangle(currentXPos, currentYPos, pageWidth, pageHeight) e.Graphics.DrawString(printString, largeFont, Brushes.Black, currentPrintRect) 'Finally Print the Date and Time Dim smallFont As New Font("Times New Roman", 8, FontStyle.Regular) printString = Now.ToString("ddd, dd MMM yyyy HH:mm:ss") currentPrintRect.Offset(0, CInt(largeFont.GetHeight + 5)) e.Graphics.DrawString(printString, smallFont, Brushes.Black, currentPrintRect)[/XCODE] In this case I keep Control of my X and Y Coordinates by using Rectangles. Hope that helps. Cheers, Ian [/QUOTE]
Insert quotes…
Verification
Post reply
Components & Controls
Reporting / Printing
Sending data/textbox value to thermal printer
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom