LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 07:12 PM   #1
floppy_stuttgart
Member
 
Registered: Nov 2010
Location: Stuttgart, Germany
Distribution: Debian like
Posts: 710
Blog Entries: 2

Rep: Reputation: 68
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, 07: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: 332Reputation: 332Reputation: 332Reputation: 332
a2pdf should work.
http://perl.jonallen.info/projects/a2pdf

http://freshmeat.net/projects/a2pdf

Last edited by stress_junkie; 01-22-2011 at 07:39 PM.
 
Old 01-22-2011, 10:18 PM   #3
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,430

Rep: Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350
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, 10:05 AM   #4
floppy_stuttgart
Member
 
Registered: Nov 2010
Location: Stuttgart, Germany
Distribution: Debian like
Posts: 710
Blog Entries: 2

Original Poster
Rep: Reputation: 68
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, 08:04 PM   #5
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,430

Rep: Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350
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, 04:58 PM   #6
floppy_stuttgart
Member
 
Registered: Nov 2010
Location: Stuttgart, Germany
Distribution: Debian like
Posts: 710
Blog Entries: 2

Original Poster
Rep: Reputation: 68
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


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
Searching .txt file for (specific) strings and printing them to new file Hb_Kai Linux - General 7 02-18-2010 10:09 AM
Batch images to pdf / pdf to txt geeeeky.girl Linux - Software 10 12-24-2009 02: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 06:11 PM
Convert pdf to html or txt or remaster the pdf? jago25_98 Linux - Software 1 12-13-2005 02:11 AM
SAMBA share txt file editing questions LinuxRam Linux - Software 14 09-10-2004 09:37 AM


All times are GMT -5. The time now is 09:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration