LinuxQuestions.org
Help answer threads with 0 replies.
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 01-22-2011, 06:12 PM   #1
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Which application for printing a pdf out of a txt file (without editing it)


Hello,
I would like to use "midnight commander" (="MC") as editor. But I dont know how to print a pdf out of MC (in Word, Leafpad .. are menu with print.. output, but not in MC).
So, the idea would be to use a line command print programm out of MC like
"printtxt2pdfprogram myfiletobeprinted.txt"
and the output would be myfiletobeprinted.pdf
Has somebody an Idea which programm is available?.
Thanks
 
Old 01-22-2011, 06:38 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
a2pdf should work.
http://perl.jonallen.info/projects/a2pdf

http://freshmeat.net/projects/a2pdf

Last edited by stress_junkie; 01-22-2011 at 06:39 PM.
 
Old 01-22-2011, 09:18 PM   #3
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
You could also create a virtual PDF printer using CUPS-PDF and then print to that printer. http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
 
Old 01-23-2011, 09:05 AM   #4
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by allend View Post
You could also create a virtual PDF printer using CUPS-PDF and then print to that printer. http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
Thanks.
Midnight Commander has no "print" menu where cups-pdf could be started.
Now: can cups-pdf be used as a command line?
like "print -p cups-pdf filetobeprinted.txt output" ?
 
Old 01-23-2011, 07:04 PM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
If you want to print a text file to a pdf file from within Midnight Commander, select the file and do Command -> User menu -> @ (Do something on the current file) and enter the command 'lpr -P <cups-pdf-printer-name>'.

You may find this little script useful.
Code:
#!/bin/sh

# Script to watch for creation of .pdf files by CUPS-PDF in spool directory
#  and move to users directory prepending the creation date and time.
#
# This script should never exit

SPOOL_DIR=/var/spool/cups-pdf/<USERNAME>/
USERS_DIR=/home/<USERNAME>/Desktop/PDF_Files/

inotifywait  -mq --timefmt '%Y%m%d %H%M%S' --format '%T %f' \
  -e close_write $SPOOL_DIR \
  | while read date time file; do
      mv $SPOOL_DIR${file} $USERS_DIR${date}${time}_${file} 
    done
 
Old 01-24-2011, 03:58 PM   #6
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by allend View Post
If you want to print a text file to a pdf file from within Midnight Commander, select the file and do Command -> User menu -> @ (Do something on the current file) and enter the command 'lpr -P <cups-pdf-printer-name>'.

You may find this little script useful.
Code:
#!/bin/sh

# Script to watch for creation of .pdf files by CUPS-PDF in spool directory
#  and move to users directory prepending the creation date and time.
#
# This script should never exit

SPOOL_DIR=/var/spool/cups-pdf/<USERNAME>/
USERS_DIR=/home/<USERNAME>/Desktop/PDF_Files/

inotifywait  -mq --timefmt '%Y%m%d %H%M%S' --format '%T %f' \
  -e close_write $SPOOL_DIR \
  | while read date time file; do
      mv $SPOOL_DIR${file} $USERS_DIR${date}${time}_${file} 
    done
thanks. exactly what i need. the line command dont work in TinyCoreLinux with the extension cups-pdf.. but i am working on it in the TCL forum. Thanks!
 
  


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
Searching .txt file for (specific) strings and printing them to new file Hb_Kai Linux - General 7 02-18-2010 09:09 AM
Batch images to pdf / pdf to txt geeeeky.girl Linux - Software 10 12-24-2009 01:40 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
Convert pdf to html or txt or remaster the pdf? jago25_98 Linux - Software 1 12-13-2005 01:11 AM
SAMBA share txt file editing questions LinuxRam Linux - Software 14 09-10-2004 08:37 AM

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

All times are GMT -5. The time now is 04:57 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