LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-28-2009, 04:22 PM   #1
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Rep: Reputation: 15
Convert text to Postscript/PDF


Hello,

I will explain my current setup:
Currently I have a printer driver setup in /etc/cups/interfaces

Which does certain things to the print job before it sends.

I wish to convert that same job to a post script file and then convert to a PDF.

This is my driver (very basic stuff):

Code:
job="$1"
user="$2"
title="$3"
numcopies="$4"
options="$5"
filename="$6"

# Set up printer default modes

echo -e "\033E\c"
echo -e "\033)0B\c"

cat "$filename"
So then I want to do something like the command enscript does.

Code:
enscript -p temp.ps file.txt
Then do ps2pdf
Code:
p2pdf temp.ps output.pdf


Basically I want to end up with a print driver that when I send text and certain options it will ether:

convert to postscript then to pdf
or
convert to postsctipt then to pdf then email out the file.
or just print to a normal printer.

so i would do something like at the command line:

lp -dprinter -email /etc/hosts

Which would convert the hosts file to postscript then to pdf then email out to an address.

Is it possible?

Last edited by stuaz; 05-28-2009 at 05:00 PM.
 
Old 05-29-2009, 10:38 AM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Its possible, but it is a very convoluted and non-intuitative way to email a file.
 
Old 05-30-2009, 02:44 PM   #3
stuaz
Member
 
Registered: Dec 2008
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fpmurphy View Post
Its possible, but it is a very convoluted and non-intuitative way to email a file.
Its ok I have worked a way of doing it using enscript and ps2pdf commands.

What I now need to do is seperate the string that i am sent. which will be something like:

'foo tipple'


What I will want to do is seperate the bits and execute commands on what I find.

I may also want to execute a command if I find two or more string examples in the variable I am sent.

Make sense?
 
  


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
cmmand line to convert pdf to text ufmale Linux - Software 1 09-13-2008 12:48 AM
Removing Background From PDF or Postscript Files btbx Linux - Software 1 04-11-2008 12:41 PM
Convert .chm to .pdf or text? Randux Slackware 10 03-12-2006 06:30 PM
acroread convert to postscript to always shrinks pdf? chaos215bar2 Linux - Software 2 06-01-2005 10:04 PM
Best PDF and PostScript viewers R00ts Linux - Software 13 09-03-2004 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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