Printer filter - convert to ps then to pdf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Printer filter - convert to ps then to pdf
# 1  
Old 05-28-2009
Printer filter - convert to ps then to pdf

Hi,

I currently have a driver located in /etc/cups/interfaces that does the following:

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

but not sure how I can include that information in the file. I also don't want it to print the file (cat "$filename")

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?
# 2  
Old 05-29-2009
There are txt2pdf utilities available that would skip doing the postscript step.

Under Sun Solaris mp(1) (Magic Print) will do a text to postscript conversion for you with header footer, page numbering, etc for you.

HTH
# 3  
Old 05-30-2009
Quote:
Originally Posted by TonyFullerMalv
There are txt2pdf utilities available that would skip doing the postscript step.

Under Sun Solaris mp(1) (Magic Print) will do a text to postscript conversion for you with header footer, page numbering, etc for you.

HTH
Hi,

Yes I have found similar:

enscript
ps2pdf

Which will convert the text to a postscript file then convert it to a PDF.

Now I am building the script to go with this.

I am sent a string of options which will be seperated by spaces in a variable.

What I need to do is search that variable for certian words and execute commands based on if i find that word.

For example:

The string might hold 'foo tipple'

I would want to may execute a certain command if I find 'foo' in the variable.

But also if I find 'foo' and 'tipple' I would want to execute a different command.

Basically I want to separate the initial string into multiple variables.

Maybe the awk command? NEver used it though.

Make sense?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Print to Windows PDF printer from AIX

Hopefully this is the correct place to post this, if not please let me know. I am trying to find a way to print from AIX directly to a windows PDF printer. I don't really care if it is paid or freeware, I am just trying to get it to work. I did see a product called BullZip and I am going to... (3 Replies)
Discussion started by: DerangedNick
3 Replies

2. Shell Programming and Scripting

Using CSH and need to convert html to PDF

Hi, I am currently using the below code and it throws an error saying badly placed ()'s. I am not sure if this right way to convert html to PDF, please help..I am using C-shell script system ("../html2doc pdf 1000 portrait html$prnfile.html $prnfile.pdf ") print "Content-type:application/pdf... (7 Replies)
Discussion started by: lakers646
7 Replies

3. Shell Programming and Scripting

convert solaris file to pdf

Hi Guys, How to convert a unix text file into pdf? Please Help!!!!!!!!!!!!!!!!!! Thanks (2 Replies)
Discussion started by: Phuti
2 Replies

4. AIX

Create pdf printer queu

I need to create a print queue in AIX to be able to print directly to pdf (or a network based printer) from a informix based application (Genero/FourJ). I have a AIX 5.3 a I canīt find any documentation for this. If possible I would not like to use any thirth party software. Can someone help me on... (2 Replies)
Discussion started by: marques_rmc
2 Replies

5. Shell Programming and Scripting

Perl - Convert html to pdf - PDF::FromHTML

Hi, I am trying to convert html to pdf using perl module PDF::FromHTML, am getting the error as given below. not well-formed (invalid token) at line 2, column 17, byte 56 at C:/Perl/lib/XML/Parser.pm line 187 at C:/Perl/site/lib/PDF/FromHTML.pm line 140 The perl code is as given... (2 Replies)
Discussion started by: DILEEP410
2 Replies

6. Windows & DOS: Issues & Discussions

convert pdf's to word

Does anyone know any good tools to convert a pdf to word, I can usually cut & paste without a hitch but I have a pdf that doesn't like that and surrounds text with lines as though a table or prints tables in miniscule text. It's only one pdf file so I'm reluctant to buy a product. (3 Replies)
Discussion started by: gefa
3 Replies

7. UNIX for Dummies Questions & Answers

printcap printer -> email account script/filter help

the basics: Tru64 unix 5.1b on alpha have nail(now mailx), mail, and mailx(old version) available. I'm trying to make a print filter to take a file that is printed to a specific printer in my printcap file and email it. I put this in my printcap: emailprinter:\ ... (0 Replies)
Discussion started by: syadnom
0 Replies

8. UNIX Desktop Questions & Answers

printer/filter setup

trying to get my laserjet to print under FC5. Got APSFILTER; what to answer to question 'parallel or serial printer port when it is USB? Do I need an updated filter software? I tried 'parallel', get 'permission denied when I try lp or lpr command- thanks- Marshall (2 Replies)
Discussion started by: blann
2 Replies

9. HP-UX

Convert PCL to PDF

We're looking for a program that can convert Text and PCL formats into a PDF. We're not looking to spend a fortune so my search so far has come up empty handed as everyone wants an arm and a leg. I found txt2pdf, but that doesn't support PCL formats. Any help would be appreciated. TIA (2 Replies)
Discussion started by: Randle2I
2 Replies

10. AIX

AIX printer filter

I am trying to setup remote printer queues on a AIX 5.2 system that sends all print requests through a filter by default. The application that is running on the LPar is coded to call the lp command to produce a print. Ideally I would like a single queue per remote printer to pass the data... (4 Replies)
Discussion started by: blacksm
4 Replies
Login or Register to Ask a Question