Active Topics

 



Notices


Reply
Thread Tools
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#11
It's connected through a print server dongle, the Edimax PS-1206, which supposedly supports RAW and Postscript. I've been digging through the manual all night for it, and can't find anything about why it'd print like that.
 
Posts: 3,841 | Thanked: 1,080 times | Joined on Nov 2006
#12
Do you have 'perl' installed on your 770? If so then you can easily verify if the printer dongle really needs MS-DOS line endings:

Code:
cat textfile-to-print | perl -ne 'chomp($_); print("$_\r\n");' | lpr
(It replaces every line feed with carriage-return + line feed)

You could also use 'unix2dos' instead of the perl inline-script, but I couldn't immediately see an installable unix2dos for the tablet anywhere.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#13
Well, the perl script did the trick!

So. 2 things...

1, I'm assuming I can put that into a script, and then add it to the printcap file so it will filter all print jobs automatically?

And, 2, how in blazes do I print without opening an xterm?
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#14
I'm curious... what exactly are you trying to print? The tablets don't have any apps by default that produce printable files. Are you creating a text file in an editor and then printing it?
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#15
That's what I'm hoping to (eventually) do. Print quick text files and occasional webpages/logs.

See, I work for a net radio station, and it requires me to sit here at my computer a -lot-. And since I have a family, I'm looking at the 770 as a way to be able to spend more time with them (watching television, talking, board games, the usual family stuff) and still be reachable by the DJs.

Yes, a laptop would work better, but 1, that's expensive, and 2, way more intrusive than I'm wanting.

EDIT: One little bug... Using that perl line, I still have to go to the printer, hit Offline, and Formfeed to get the page to actually print. Is that the printer, or something correctable in the perl?

Last edited by DJ Charlie; 2009-03-18 at 17:38. Reason: Added info.
 
Posts: 3,841 | Thanked: 1,080 times | Joined on Nov 2006
#16
Re. not printing: I once came across a printer that behaved like that.. I added a filter that inserted a ctrl-D character at the end of each file, it did the trick. I just found that filter.. it's a C program but what it basically does is to read from stdin and write to stdout, then write a final ctrl-D (a byte of value 4). A perl script like the below could possibly work, but I have not tested it. My old C program had signal handlers and stuff, I don't remember if that's needed or not.

Code:
#!/usr/bin/perl
while (<>)
{
    print;
}
printf "%c",004;
Or maybe you could combine that with a script that fixes the line endings:
Code:
#!/usr/bin/perl
while (<>)
{
    chomp($_);
    print("$_\r\n");
}
printf "%c",004;
In the printcap file insert something like:
Code:
  :if=/path/to/that/script:\
and remember to make it executable: chmod a+rx /path/to/that/script

1) The above is entirely untested.
2) If it works, it will probably _only_ work for plain text files. If you also want to print postscript files you can add that as another printcap entry with a different printer name (e.g. ps instead of lp, access them with 'lpr -P ps', or 'lpr -P lp'), and leave out the filter (or use another filter which only adds the final ctrl-D - the perl script _could_ get you into trouble though because depending on the line lenghts it could eat a lot of memory).
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 

The Following User Says Thank You to TA-t3 For This Useful Post:
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#17
No joy....

Added that, and now I get 5 lines of this:

jobstart '-H-' '-nroot' '-Plp' '-b93' '-t2009-03-19-18:20:41.000' '-CA'
 
Posts: 3,841 | Thanked: 1,080 times | Joined on Nov 2006
#18
I have no idea where that stuff comes from.. very strange. I'll see if I get time to do some testing on my own setup -- I may build an OS2007 version of my old, definitely working final-form-feed filter.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#19
That would be greatly appreciated.

I've emptied everything out of /var/spool/lpd, and restarted the daemon, and the first time, the text file prints fine (albeit, with the leading blanks), but any other printing gives what looks like a job queue.
 
Posts: 11 | Thanked: 0 times | Joined on Mar 2009
#20
Quick update...

Removing the :if= line stops it from printing wonky.

Could the script (copy/pasted from above) be the culprit?
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:01.