ok, now that it's implemented, let me reflect on the process and my
experience with this:
first off, the perl script that was given me by Mikkel Fischer (thanks
Mikkel!) works good for workstations sporting some sort of lpd capable
OS. however, all the windows users in the building have problems,
here's why:
when a windows user (winuser) sends a print job to Samba, the Samba %u
variable (winuser) is still intact. however, when Samba hands the job
over to LPRng, LPRng thinks the job is now owned by whatever user Samba
is running as (in my case, root). therefore, the perl script would
attempt to email the PDF file back to root!
so, here's a dirty little trick i set up in smb.conf that works, albeit
dirty:
#smb.conf
[PDF]
path = /tmp
public = yes
printable = Yes
print command = mv %s %s.ps; /usr/bin/ps2pdf %s.ps %s.pdf; rm -f
%s.ps; mv %s.pdf %m.$$.pdf; /usr/bin/metasend -b -f %m.$$.pdf -m
application/pdf -s PDF -S 4000000 -F [EMAIL PROTECTED] -t
%U\@mydomain.com; rm -f %m.$$.pdf
printer = pdf
ooh yuck, i know, but it works well!
so, i want to thank everyone for their help on this!
Ron McKown
[EMAIL PROTECTED]
On Wed, 2002-01-30 at 10:53, Robert Fausey wrote:
> On Fri, 25 Jan 2002, Joel Hammer wrote:
>
> I just set up this exact same thing. I created a perl script to convert
> the source file to postscript and the ran ghostscript to convert the file
> to PDF, then email the file to the user as an attachment. All the
> conversions and Email attachments are done within the perl script.
>
> > What you want to learn about is printer queues and print filters. I am
> > not going to try to tell you about print queues. You really don't need
> > a print queue to do what you want to do, since you do not need to spool
> > anything to a printer.
> >
> > What OS are you using? In linux, most applications send a postscript
> > file. Some jobs are in ascii. To convert, the following command might
> > work:
> >
> > cat file | enscript -Z -B -o - | gs -q -sDEVICE=pdfwrite -sOutputFile=- - >
>/tmp/junk.pdf
> >
> > should create your pdf file for you. Mailing it is a bit tricky. I guess
> > you need to mail is as an attachment, no? This command, without the word
> > "file", would likely work just fine invoked from netscape. That is because
> > cat will assume input from standard input without a file name handy.
> >
> > My mail program doesn't have a way to attach anything, but mutt does. So,
> > I would try:
> >
> > echo Here is your pdf file | mutt -s Your_PDF_File -a /tmp/junk.pdf addressee
> >
> > Both these command work on my machine.
> >
> > Read man gs, man enscript and man ps2pdf to get more of a flavor of your options.
> >
> > Now, all of this can go into a print filter and can be invoked with a
> > simple lpr -Ppdf command (if you call your queue pdf). For a good basic
> > discussion of print filters, I suggest this site and read my basic guide
> > to printer filters. Search the site for hammer filters
> >
> > http://linux.nf/stepbystep.html
> >
> > If you eschew a black box approach, by the time you are done with this,
> > you will know a lot about printing.
> >
> > Joel
> >
> >
> > On Fri, Jan 25, 2002 at 03:28:40PM -0800, Ron McKown wrote:
> > > hello everyone,
> > > i'm new to lprng, and have a question that i'm sure some of you could
> > > shed some light on.
> > >
> > > i'm trying to setup a spool that takes a print job, converts to pdf and
> > > emails the .pdf file to the sender.
> > >
> > > to be honest, i don't even know where to start. or there might already
> > > be a script that someone has developed that does just that.
> > > otherwise, i would find it helpful if someone could just point me where
> > > i should start.
> > >
> > > would this be something that would be better to do in CUPS?
> > >
> > > Ron McKown
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > -----------------------------------------------------------------------------
> > > YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> > > The address you post from MUST be your subscription address
> > >
> > > If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> > > or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> > > to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> > > with: | example:
> > > subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> > > unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
> > >
> > > If you have major problems, send email to [EMAIL PROTECTED] with the word
> > > LPRNGLIST in the SUBJECT line.
> > > -----------------------------------------------------------------------------
> >
> > -----------------------------------------------------------------------------
> > YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> > The address you post from MUST be your subscription address
> >
> > If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> > or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> > to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> > with: | example:
> > subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> > unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
> >
> > If you have major problems, send email to [EMAIL PROTECTED] with the word
> > LPRNGLIST in the SUBJECT line.
> > -----------------------------------------------------------------------------
> >
>
>
> Rob Fausey.
>
> These are not the droids you're looking for. Move along. Move along.
>
>
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> with: | example:
> subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
>
> If you have major problems, send email to [EMAIL PROTECTED] with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------