print formatted text to the printer


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting print formatted text to the printer
# 1  
Old 11-19-2010
print formatted text to the printer

Hello!!!
I am using shell script that print some formated text on the screen (example)
========
hello I am ...
========

Is it possible to print this information to the printer exactly as I see it on the screen???
# 2  
Old 11-19-2010
How can e answer such question ,since we dont know what the script does!
It helps also to know what OS and version we are dealing with, and in your case what type of spooler is used (network? CUPS? BSD? AIX? etc...)
# 3  
Old 11-19-2010
Code:
echo -e "\033[0;31m===============================\033[0m"
echo -e "\033[1;35mHeader!!!\033[0m"
echo -e "\033[0;31m===============================\033[0m"
echo -e "\033[0;33m HELLO      WORLD\033[0m    "
echo -e "\033[0;31m===============================\033[0m"


Last edited by Scott; 11-19-2010 at 04:18 PM.. Reason: Code tags
# 4  
Old 11-19-2010
Ah, you want to print ANSI color escape sequences? No, it can't, you'll need to convert it somehow.

What languages can your printer understand? Converting that to raw postscript may be difficult since postscript's quite complex. Converting it to HP PCL language, not as hard: PCL uses escape sequences too, albeit totally different ones, to do things like change locations, fonts, styles, and input modes.

If you can print this file raw and see a checkerboard, your printer understands PCL.

See here for a simple introduction.
# 5  
Old 11-19-2010
is it possible to print screen to the printer???
# 6  
Old 11-19-2010
Quote:
Originally Posted by tdev457
is it possible to print screen to the printer???
You can take your screen to the scanner and scan it....
But seriously....... could you elaborate on what you're after....
# 7  
Old 11-19-2010
Quote:
Originally Posted by tdev457
is it possible to print screen to the printer???
What, like a text screenshot?

The answer depends on what your system is. Please explain in detail what terminal, software, and OS you're using.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Tip to remove line endings and spaces on a pre-formatted text file?

Hi, At the moment, using Notepad++ to do a search and replace, manually section by section which is real painful. Yeah, so copying each section of the line of text and putting into a file and then search and replace, need at least 3-operations in Notepad++. Here's hoping I will be able to... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Shell Programming and Scripting

Insert FF (feed form) in text file so that when printing the printer print on a new page accordingly

Hello. First happy new year to everybody. I have a script that generate a text file ( /tmp/part_list.txt for example ). This file can be edited using a kde graphical text editor like kate or kwrite The file can be printed out from command line or within the text editor using the print... (5 Replies)
Discussion started by: jcdole
5 Replies

3. Shell Programming and Scripting

Displaying Formatted Text on Virtual Terminal

Hi, I'm working on a project that requires formatted text to be displayed on the screen plugged into a Linux machine. I want to be able to control this text via a bash script and format it in a particular font and size. Changing the background colour would also be beneficial. Does anyone know... (3 Replies)
Discussion started by: lcoor65
3 Replies

4. UNIX for Dummies Questions & Answers

Print to a network printer on DG/UX

i need to print a file on a network printer with an ip 128.233.1.6 (for example) on a DG/UX (System V) Release 5.4R3.10 so that when telnet from windows client can print on the network printer. (2 Replies)
Discussion started by: kamwa
2 Replies

5. Shell Programming and Scripting

String searching and output to a file in a formatted text

Hi, I'm very new to UNIX scripting and find quite difficult to understand simple UNIX syntax. Really appreciat if somebody could help me to give simple codes for my below problems:- 1) I need to search for a string "TTOH 8031950001" in a files which filename will be "*host*'. For example, the... (3 Replies)
Discussion started by: cuji
3 Replies

6. Shell Programming and Scripting

Script or command: Formatted text to CSV

Hi Everyone, I've been using this site as a great resource to aid me with simple search and replace tasks. I still consider myself a novice and now I've been pulling my hair out over this problem. Any hints or suggestions would be welcome! I have a text file in a format like this name:... (6 Replies)
Discussion started by: regexnub
6 Replies

7. Shell Programming and Scripting

Extracting formatted text and numbers

Hello, I have a file of text and numbers from which I want to extract certain fields and write it to a new file. I would use awk but unfortunately the input data isn't always formatted into the correct columns. I am using tcsh. For example, given the following data I want to extract: and... (3 Replies)
Discussion started by: DFr0st
3 Replies

8. UNIX for Advanced & Expert Users

Mutt - Word Document or Formatted text as a Message

Hi, I am writing a mailing script by using mutt command. I that i have facing a issues. because, i want to send Some Formatted text as the mail message. but, i try to send the Word Document file as the Mail message. it shows some junk characters in the mail. :confused:I think the mutt command is... (1 Reply)
Discussion started by: krsenkumar
1 Replies

9. Shell Programming and Scripting

Convert DATE string to a formatted text

Hi guys, i need your help. I need to convert a date like this one 20071003071023 , to a formated date like 20071003 07:10:23 . Could this be possible ? Regards, Osramos (6 Replies)
Discussion started by: osramos
6 Replies

10. Shell Programming and Scripting

awk - print formatted without knowing no of cols

Hi, i want to print(f) the content of a file, but i don't know how many columns it has (i.e. it changes from each time my script is run). The number of columns is constant throughout the file. Any suggestions? (8 Replies)
Discussion started by: bistru
8 Replies
Login or Register to Ask a Question