[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [seul-edu] Re: File formats and distance learning



Here is what you need in smb.conf - -

[pdf]
path = /tmp
printable = yes
guest ok = yes
postscript = yes
print command = /usr/bin/printpdf %f

Here is the printpdf command - -

#!/bin/sh

# Simple script to convert a specified postscript file into a PDF document
# and place it in a location that is shared by the Samba server.
#
# Arguments:
# 1st - The name of the spool file
#
# John Bright, 2001, jbright@winfordeng.com

# We will create the pdf into a temporary file based upon the current date and time.
# After we are finished, we'll rename it to a file with the same date, but ending
# in .pdf. We do this because if a user tries to open a PDF that is still being written,
# they will get a message that it is corrupt, when it is actually just not done yet.

DATE=`date +%b%d-%H%M%S`

# Directory in which to place the output
# Be sure this directory exists and is writable by the user that Samba
# is running as (for example, the nobody user)
OUTDIR=/mnt/storage/storage/temp_pdf


ps2pdf $1 $OUTDIR/$DATE.temp
mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
rm $1

- - - - -

Then you just need to add a printer to your windows based PC, using any PostScript driver. I usually use either one of the Apple PS drivers or a HP DesignJet PS driver, depending on how big you need the PDFs. Also make sure you make the printpdf command executable, and also if you are having problems getting it to run, try setting the printpdf command suid by issuing the command chmod +s /usr/bin/printpdf.

Cheers.
Mike Petersen
mgpeter@kdsi.net


Cameron Miller wrote:

Les Richardson wrote:

Now my suggestion; Make a "Create PDF" server using samba. You can use samba to create a network printer which accepts
a print job and creates a PDF file. The user then can retreive
their new PDF via a windows share.

What would be the input format (that you are uploading via smb)?
As well, what is the conversion software?

I believe he has a sbm.conf that takes the Postscript from the client printer driver intercepts it in the print queue and uses Ghostscript to convert it to pdf format. I would like to see the relevant portion of the smb.conf as well.

OpenOffice can be set up with a "Convert to PDF" printer device that does the same thing on the local client level.

- cameron