473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

graphics.drawstring question

Hi,
Im writing a C# .Net application to print in zebra 2030 thermal receipt printer (Uses 80 mm wide paper). I'm using the windows Graphics object for printing. string text = "Line1\n Line2\n\n\n\n";
e.Graphics.DrawString(text, new Font("Courier New", 12), Brushes.Black, 0, 0);
The problem is Drawstring is not printing 3 blank lines after printing Line2. The receipt is cut after the text Line2.
Any help is greatly appreciated
Jul 29 '09 #1
3 3422
tlhintoq
3,525 Expert 2GB
Take a look at an ASCII table for the exact numbers.
I think you will have better luck sending a true ASCII LineFeed. (LF)
Jul 30 '09 #2
Plater
7,872 Expert 4TB
Well \n IS the LF character 0x0A or 12 on the ascii table.
Are you sure your bounding rectangle for drawstring is big enough? And that its set to "wrap" correctly?
What happens if you send the 0x0C character (form feed/new page) does your printer shuffle down?

What if you made your string:
string text = "Line1\n Line2\n \n \n \n"; //adding in extra spaces
Any difference?
How about:
string text = "Line1\n Line2\n\r\n\r\n\r\n"; //adding in carriage returns
Jul 30 '09 #3
Are you sure you're not missing the carriage return key?
Aug 1 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: twostepted | last post by:
Hello, This is a bit of a long post (sorry) but here is the jist of it: I've developed a Windows forms User Control marquee (auto-scrolling text like a readerboard). I'm trying to optimize it...
5
by: Charles A. Lackman | last post by:
Hello, I have created a complete PrintDocument and need to create an image from it. How is this done? e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality...
7
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
7
by: billsahiker | last post by:
I am using the Microsoft Press training kit for the Framework 2.0 exam. It has the following example for putting text into a font and drawing it. I created a new Windows Application. But where do...
2
by: Tony Johansson | last post by:
Hello! If I use the DrawString below with object of StringFormat as the last object it works good. If I instead remove object StringFormat below as the last object of DrawString I get some rows...
6
vekipeki
by: vekipeki | last post by:
I am having a problem with basic drawing of unicode characters in Windows 2000 and XP. I have written a simplest possible C# WinForms program to test it (just create a new Windows Forms C#...
6
by: Dilip | last post by:
Howdy Folks I have a display where the Graphics.DrawString function is called to display something. Since the text seems to be larger than its bounding rectangle, the call basically splits the...
10
by: anuking | last post by:
Hi, I made a tool that compares the texts from 2 richtextboxes and then marks the characters that are different in red. An option needs me to overlap these 2 text data to show the exact...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.