LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2021, 08:06 PM   #1
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Rep: Reputation: Disabled
Text printing as a PDF


Hello,
I'm probably asking an old question, but when I print from a simple Linux text editor like xed to a simple parallel port dot matrix printer, I get all the random seeming output of a PDF. Wherever I search online about this, I only see links to the opposite problem--ways of turning text into PDF. How do I keep text from outputting as a PDF? I want my text RAW, or text. I thank you for your time.
WayCon
 
Old 05-10-2021, 08:25 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
I have never encountered anything like this, so I have no answers, but some questions:

What distro/version are you using? (Your user agent icon says "Ubuntu," but that could be Ubuntu or a derivative.)

What happens when you print a test page via CUPS (http://localhost:631)?

Which text editor(s) have you tested for this? (I doubt it makes a difference, but it would be nice to fill in the picture.)

Would it be possible to post a scan of one of these print-outs to bring to life what the phrase "output of a PDF."
 
Old 05-10-2021, 09:06 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Does the printer work under any condition? Did it ever?
You are not seeing PDF you are seeing wrong printing.


What you see



echo "Y helo thar" > /dev/lp0

Or

more text-file | lp
 
Old 05-10-2021, 09:17 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Maybe, the default print output format from GUI applications is PDF so it depends on how the printer is configured.

How did you setup your printer in cups? What is the make and model number of the printer?

All of the old legacy print drivers are now maintained by Open Printing now days since many distributions do not install them by default anymore nor by Apple (They own cups). http://www.openprinting.org
 
Old 05-10-2021, 09:39 PM   #5
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Click image for larger version

Name:	20210510_220800.jpg
Views:	47
Size:	301.7 KB
ID:	36357
Hello frankbell,
I am trying to attach a poor photo of the print out. It's pretty clearly page description output, or so I believe. The quality is poor because the ribbon is old and dried up. This is what I got when I went to CUPS as you suggested and I hit the print test button.
Thank you,
WayCon
 
Old 05-10-2021, 09:49 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
To expand on jefro's post you can try printing directly to the printer and bypass cups via the command

cat file.name > /dev/lp0
 
Old 05-10-2021, 09:50 PM   #7
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Hello, jefro,
The printer is one of several that I have used on and off for some years with Windows 10, Windows 7, and with other, older machines, so it is working.

Hello, michaelk,
I installed the printer through the print installer on my Mint machine. It did see it as an Epson printer, so I used the driver suggested and also I tried the most absolutely generic set up the print installer offered. I am certainly willing to give you any specific information you want. What would be useful?

I thank you both,

WayCon
 
Old 05-10-2021, 09:53 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
Quote:
Hello frankbell,
I am trying to attach a poor photo of the print out.
Thank you for the effort.

Unfortunately, the photo was so faint that I could not discern anything helpful. But, again, thank you very much for trying.

I will continue to follow this thread, as I want to know what the heck is going on here!

Last edited by frankbell; 05-10-2021 at 09:55 PM.
 
Old 05-10-2021, 09:59 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
"Windows 10, Windows 7, and with other, older machines, so it is working."

I should have included the word Linux. Does it work or ever work in linux on your system under any condition?

Can you print the configuration from only the printer? Usually power on while holding one or two menu keys and it prints the current configuration.

Last edited by jefro; 05-10-2021 at 10:06 PM.
 
Old 05-10-2021, 10:15 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Have you tried my suggestion in post #6?

I'm wondering if you will have to setup your own cups filter to convert PDF back to text.
 
Old 05-10-2021, 10:17 PM   #11
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Hello, all,

And thank you, everybody,

This is what I've done on localhost:631 :

Description: EPSON TM-P2.01
Location: wc-O-Plex-960
Driver: Epson 9-Pin Series (grayscale)
Connection: parallel:/dev/lp0
Defaults: job-sheets=none, none media=na_letter_8.5x11in sides=one-sided

ID Name User Size Pages State
EPSON-TM-P2.01-3-42 Test Page anonymous 1k 1 processing since Mon 10 May 2021 11:09:09 PM EDT "Rendering completed"

It prints out one 40 character line every several minutes.
 
Old 05-10-2021, 10:21 PM   #12
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
The one above was based on a driver that CUPS, I guess, in printer set up found itself.

I get rather similar results if I use the most generic set up I could find:

Description: printer
Location:
Driver: Local Raw Printer (grayscale, 2-sided printing)
Connection: parallel:/dev/lp0
Defaults: job-sheets=none, none media=unknown
 
Old 05-10-2021, 10:24 PM   #13
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
This type of Epson printer I was using, back when I was really running everything on Dos, so I don't think it really needs or, ordinarily, uses drivers. Of course I could be wrong, but I imagine there must be a solution, somewhere.
 
Old 05-10-2021, 11:43 PM   #14
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,818

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by WayCon View Post
Hello,
I'm probably asking an old question, but when I print from a simple Linux text editor like xed to a simple parallel port dot matrix printer, I get all the random seeming output of a PDF. Wherever I search online about this, I only see links to the opposite problem--ways of turning text into PDF. How do I keep text from outputting as a PDF? I want my text RAW, or text. I thank you for your time.
WayCon
I'm not sure what the "random seeming output of a PDF" looks like. I can only assume that it looks like plain old binary characters with some PostScript sprinkled in for good measure.

Aside from the "/dev/lpt0" suggestion mentioned above -- which I haven't tried since the pre-CUPS era -- have you tried something like:
Code:
$ lpr -l plain.txt
This works but... I do have a CUPS-defined printer set up. The file will need to have CR-LF line terminators instead of the standard LF line terminators that UNIX files employ if you're going to bypass the filters that CUPS will use. Emacs provides a simple way to do this: Esc<Esc% ^Q^J[Ret]^Q^M^Q^J[Ret]! (OK... maybe simple to some).

If you're into programming, a simple filter could be written to change all LFs to CR/LFs which would let you issue:
Code:
$ crlffilter < plain.txt | lpr -l -
Ah... after scrolling through the posts again, I see that you've gotten a CUPS printer set up. If it's slow, try bypassing CUPS filters using the "lpr -l" command I showed above.

I'm betting that CUPS doesn't put a lot of effort into optimizing their dot matrix printer support. Q: Where do you find tractor-feed paper and ribbons for those old beasts nowadays? (I was just joking with someone today about "disa-perf" paper. :^D )

HTH...

Last edited by rnturn; 05-10-2021 at 11:45 PM.
 
Old 05-11-2021, 11:30 AM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
In order for cups to print to a text Epson type printer the PDF file needs to be converted via a raster filter and I believe the required filter is rastertoespon. Mint does have the raster filter so something must be amiss with cups somewhere or it is possible the raster filter does not work anymore. I have a Zebra label printer and it no longer "works" with later cups versions due to the raster filter. I have yet to figure it all out but Michael Sweet (The original cups developer) had to create a special spooler program because I think that Apple screwed it up. From what I can tell they had a falling out and he no longer works for Apple.

A raw printer bypasses the filters so that is not going to work with PDF formated output. Printing from the command line would send plain text directly to the printer instead of PDF and was requested as a test.

https://www.cups.org/doc/raster-driver.html
 
  


Reply



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
Download a PDF/web page as "text" PDF (ie. not a picture)? littlebigman Linux - Software 7 01-28-2020 06:35 PM
Unsupported PDF data for Direct Print :1000 when printing a PDF document vishnu14 Linux - Server 5 10-18-2019 06:56 AM
[SOLVED] printing the text from a web page without printing the graphics newbiesforever Linux - General 15 03-21-2018 06:39 AM
[SOLVED] Variables in text file, how to get their values when printing out the text? idaham Linux - General 2 04-14-2010 03:28 AM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:46 PM.

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