LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-07-2013, 11:29 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
How do I send a plain ASCII file to the printer?


Hi: I run a GNU linux operating system (Slackware 14.0). The problem consists in using the parallel port to get into the Centronics connector of my dot matrix printer and print a plain ASCII file in the printer. But we could make the problem simpler: output redirection to the parallel printer port.

I know this: with an old linux O.S. I did
Code:
$ ls > /dev/lp0
and I got printer output. That's all I needed. But there is no /dev/lp0 device on my O.S.! What are the parallel printer devices in linux now?

As the printer is programmable, I could make a file with the appropriate control characters and then
Code:
cat control_chars_file > /dev/<printer_device>
A more comfortable scenario would be to write a C program and send the control characters and text to the printer via suitable output instructions. But here I would need to know the proper output instructions, which I do not know.

[I know: I would use the int fprintf(FILE *stream, const char *format, ...) instruction after having associated some output stream with the printer device.]

Last edited by stf92; 12-07-2013 at 11:33 PM.
 
Old 12-08-2013, 12:07 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,525

Rep: Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812
If you have the printer configured in CUPS, then
Code:
lpr -P <printer_name> <ASCII_filename>
 
Old 12-08-2013, 12:24 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Oh, but I would much rather prefer to get a more straightforward connection to the printer, without queues and all that. I only need the name of the device.
 
Old 12-08-2013, 02:21 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,525

Rep: Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812Reputation: 2812
Perhaps 'dmesg | grep lp' will help.
 
1 members found this post helpful.
Old 12-08-2013, 04:18 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
Have you looked into pdq -Print Don't Queue?
 
Old 12-08-2013, 05:26 AM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I have just remembered this machine lacks a parallel port connector. The manufacturer of the machine or of the relevant chipset must have thought a parallel port had no object in a world where everything is USB. By the same criteria, sure enough, he did not provide a serial RS232 port. So udev did not create the corresponding device, despite the fact that the driver is there:
Code:
ppdev: user-space parallel port driver
lp: driver loaded but no devices found
(from dmesg output)

Code:
lp                      9787  0 
parport                31427  3 parport_pc,ppdev,lp
(from lsmod output)

What the manufacturer does not considered is that parallel and serial (UART) ports are infinitely simpler than USB devices, and make the life of some persons much simpler. That is, USB appeared as an attempt to simplify the life of the housewife and the butcher and the architect that is, keeping in mind the innumerable types of people who at present use a computer. The computer should be usable by a three-year old kid. A pity, in this way they fabulously complicated mine. udev is another of those smart inventions aimed at easing the life of the end user at the cost of infinitely complicating computers themselves.

What I forgot is that I use another computer to test (mostly homebrew) parallel devices and was using this only to see how the /dev/lp thing was done. Sorry to have bothered you, guys.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file command sees regular ASCII text file as ASCII Java program text bbraml Linux - Software 6 08-30-2013 09:52 AM
LXer: How to transform (almost) plain ASCII text to Lulu-ready PDF files LXer Syndicated Linux News 0 10-19-2010 06:40 PM
Create openoffice style for plain ascii text section linuxqueric Linux - Software 4 05-21-2009 09:19 AM
Converting ISO-8859-1 to plain ASCII hsocasnavarro Linux - Software 9 12-18-2007 12:49 AM
No plain ascii editor? sunlion Mandriva 4 01-03-2006 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration