postscript

brouwers roland lx roland at cat.be
Tue Apr 25 11:21:50 UTC 2006


On Fri, 2006-04-21 at 14:55 -0500, Mike Klinke wrote:
> On Friday 21 April 2006 14:45, brouwers roland lx wrote:
> > Hello,
> >
> > What do I want to do?
> > Print a worddoc(Microsoft or openoffice) to a printer that will
> > produce a ps, which has to be transformed to a pdf file, which
> > will be send by email, as an attachment.
> >
> > I am searching the internet for days now, to find a way to
> > produce a postscript file, without printing to a printer. This
> > file can be transformed to pdf with ps2pdf.
> >
> > Or is there another way?
> 
> It's been a couple of years now since I did this but here are some 
> notes for a "network pdf printer" using samba if you want to set 
> one up for your own network.  
> 
> This printer will convert the document you wish to print to a "PDF" 
> file.  All you should have to do is to install a new printer on your 
> machine:
> 
> Network Printer:
> 
> \\Sambashare\pdf
> 
> 
> Printer Type:
> 
> HP Color LaserJet 5/5M PS (Postscript)
> ( This is the printer driver to select that creates the PS file )
> 
> and when you print to it, the resulting PDF file will be stored on 
> the shared drive at:
> 
> \\Sambashare\pdfdocs
> 
> The file will be named according to the date and time you issued the 
> print command. For example the file:
> 
> May03-142120.pdf
> 
> 
> ============= smb.conf =================
>  
> [PDFDocs]
>         comment = SambaOne PDF Printer Documents
>         path = /mnt/pdfdocs
>         writeable = yes
>         guest ok = yes
> 
> ; Set up our PDF-creation print service
> [pdf]
>    path = /tmp
>    printable = yes
>    guest ok = yes
>    print command = /usr/bin/printpdf %s 
>    lpq command =
>    lprm command =
> 
> =============== /usr/bin/printpdf ================
> (Scarfed from a fellow by the name of John Bright seen below...)
> 
> #!/bin/sh
> # 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 at winfordeng.com
> # create the pdf into a temporary file based on current date and 
> time.
> # After we are finished, rename it 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/pdfdocs
> 
> ps2pdf $1 $OUTDIR/$DATE.temp
> 
> mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
> 
> rm $1
> 
I tried this but it does not works:
I did the following
smb.conf------------------------------->
[pdfshare]
        writeable = yes
        path = /pdfshare
        browseable = yes
        guest ok = yes
        force user = nobody
[pdf]
   path = /tmp
   printable = yes
   guest ok = yes
   print command = /usr/bin/printpdf %s
---------------------------------------<
printpdf------------------------------->
DATE=`date +%b%d-%H%M%S`
OUTDIR=/pdfshare/pdfdropbox
ps2pdf $1 $OUTDIR/$DATE.temp
mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
rm $1
---------------------------------------<
I restarted smb
I created a printer in windowXP
LPD printer
IP 192.168.100.253 of the sambaserver
queue name : pdf
I did not create the printer in the printmanager of gnome.

I just wonder, could there not be a logging problem? 
I tried to find a logfile to see some loggings, but did not find one.
/var/log/samba

If you had any idea, this would be great, because I have to demonstrate this tonight.
Thanks

Roland Brouwers
C.A.T. bvba
Antwerp-Belgium
roland at cat.be




More information about the users mailing list