Sponsored Content
Top Forums Shell Programming and Scripting Printer filter - convert to ps then to pdf Post 302320717 by stuaz on Thursday 28th of May 2009 06:05:25 PM
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?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
PS2PDF(1)                                                           Ghostscript                                                          PS2PDF(1)

NAME
ps2pdf - Convert PostScript to PDF using ghostscript ps2pdf12 - Convert PostScript to PDF 1.2 (Acrobat 3-and-later compatible) using ghostscript ps2pdf13 - Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible) using ghostscript SYNOPSIS
ps2pdf [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf12 [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf13 [options...] {input.[e]ps|-} [output.pdf|-] DESCRIPTION
The ps2pdf scripts are work-alikes for nearly all the functionality (but not the user interface) of Adobe's Acrobat(TM) Distiller(TM) prod- uct: they convert PostScript files to Portable Document Format (PDF) files. If the output filename is not specified, the output is placed is a file of the same name with a '.pdf' extension. Either the input filename or the output filename can be '-' to request reading from stdin or writing to stdout, respectively, when used as a filter. The three scripts differ as follows: - ps2pdf12 will always produce PDF 1.2 output (Acrobat 3-and-later compatible). - ps2pdf13 will always produce PDF 1.3 output (Acrobat 4-and-later compatible). - ps2pdf per se currently produces PDF 1.4 output. However, this may change in the future. If you care about the compatibility level of the output, use ps2pdf12 or ps2pdf13, or use the -dCompatibility=1.x switch in the command line. There are some limitations in ps2pdf's conversion. See the HTML documentation for more information. A large number of Adobe Distiller(TM) parameters which can be used to control the conversion are also documented there, including instructions for generating PDF/X and PDF/A documents. OPTIONS
The ps2pdf scripts use the same options as gs(1). EXAMPLES
Converting a figure.ps to figure.pdf: ps2pdf figure.ps A conversion with more specifics: ps2pdf -dPDFSETTINGS=/prepress figure.ps proof.pdf Converting as part of a pipe: make_report.pl -t ps | ps2pdf -dCompatibility=1.3 - - | lpr SEE ALSO
gs(1), ps2pdfwr(1), Ps2pdf.htm in the Ghostscript documentation BUGS
See http://bugs.ghostscript.com/ and the Usenet news group comp.lang.postscript. VERSION
This document was last revised for Ghostscript version 8.70. AUTHOR
Artifex Software, Inc. are the primary maintainers of Ghostscript. This manpage by George Ferguson. 8.70 31 July 2009 PS2PDF(1)
All times are GMT -4. The time now is 07:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy