Printer for printing to files
Hi
after searching in all direction I ask it here. Is there a "printerdriver" for printing to plain text files that get saved on disk. I can hardly imagine being the first that needs this but on the internet I cannot find a solution. Regards, Jan |
Look at the print dialog box in your GUI text editor. There should be a print to file option in the printer list where you can save the output to one of several outputs like PDF. If this does not work then we need some additional information.
|
Thanks for the fast reply!
Ok I found that I could define a printerque "raw" but that is no longer there, neither in Kubuntu 12.04 nor in 16.04. What I would like is a printerque that I can print to but which saves plain textfiles without overwriting the old ones like the PDF-printer does. (some name with date/time would do) I know a lot is possible with lpr but did hope someone already did this. kind regards, Jan |
There should be a text box in the printer dialog where you can enter the filename of your choice.
What do you mean by saves plain text files. It seems like a bit of a paradox that you want to print to file a text file that saves as plain text. |
You are right,
I want to print output from a programm to plain textfiles to produce csv-files that can be imported in another programm because there is no functioning interface between the two. I have made several bash-scripts already to build a temporarily solution. We are working on the interface but that will take some time. Some 20 years ago I did similar things with vaxvms, now openvms, but even linux on the desktop runs so you do hardly need a command line anymore, one gets rusty . . . . Kind regards, Jan |
Quote:
http://git.net/ml/printing.cups.deve.../msg00007.html There is also CUPS-PDF, which will shovel it into a PDF...from there, you could use pdf2txt (intermediate step, yes, but it could work at least) http://www.cups-pdf.de/ OR, you could write your own printer in Perl: Code:
#!/usr/bin/perl |
Thanks T-Bone
That was what I was looking for! Now I have something to do, I like the perlscript. Just added a rawprinter in cups and searching for the spooled files but the rst is for tommorow. Kind regards, Jan |
Here is some additional information about cups filters.
https://en.opensuse.org/SDB:Using_Yo...rint_with_CUPS In addition I have also setup a samba printer using LPRNG that you can add to cups. The basic code is: Code:
[myprinter] |
Almost there, the perlscript is perfect
Just, I need to get plain text instead of postscript and I cannot grasp where to put the right parameters. sudo lpadmin -p tofile -E -v socket://localhost:12000 -m raw gives a postscriptfile sudo lpadmin -o document-format=text/plain -p tofile -E -v socket://localhost:12000 -m raw gives a postscript file I added -i, took away -p but no luck so far, what am i overseeing? Knd regards, Jan |
The -p is the name of the printer queue and the -i would be the name of the filter script.
The perl script does not alter the incoming print stream so your application is actually outputting Postscript? |
I printed a textfile from Kate and if I choose "tofile" as a printer then this "printer" should use a PPD-file when appropriate doen't it?
Why it uses postscript I cannot see. At least is that what I understand from "man lpadmin". Kind regards, Jan |
If I print from the application it als sends a postscriptfile.
Kind regards, Jan |
Your tofile printer will only use a PPD if specified one when it was created i.e. -P option.
It depends on the application / version / distribution but in the past the default file print format was postscript. |
Thanks michaelk,
I know that and therefore I wonder that postscript is used. This is Ubuntu 12.04 with KDE on top but that does not matter much. Main thing is, I get a plain text file. what comes out as a ps-file is a perfect printout. This hard to find in internet. Kind regards, Jan |
You can print from the command line using lpr which will use plain text or if you have to use kate add a PS to text conversion.
|
All times are GMT -5. The time now is 09:00 PM. |