[Samba] pdf printer

Matthew Western
Tue, 03 Jun 2003 02:52:58 -0000

i'd use cups myself, but...

problem your print command.  according to the man page (i've got a full
printout on my desk.  :) )

<quote> The print command MUST contain at least one occurance of %s or %f
-
the ...  <end quote>

i suggest you search google for samba pdf for just samba.  or use the
following for a cups (better) back end.

---------------
>1. Get a un*x box with CUPS and ghostscript set up on it.
>
>2. Go here: http://printing.kde.org/downloads/ and download
>this backend
>script: http://printing.kde.org/downloads/pdfdistiller
>
>3. Log in as root, put it in /usr/lib/cups/backend or wherever
>cups/backend lives.
>
>4. 'chmod +x' the file (should be 755: rwxr-xr-x).
>
>5. Restart CUPS ('service cups restart' or appropriate).
>
>6. To check if CUPS recognizes it as a usable backend, let root run:
>      'lpinfo -v | grep pdf'
>    should output "direct pdf"
>
>7. Test the pdfdistiller backend:
>     a. '/usr/lib/cups/backend/pdf'
>     	should output 'direct pdf "Unknown" "PDF
Writing"'
>     b. "/usr/lib/cups/backend/pdf 1 2 a b"
>       should output: "Usage: pdf job-id user title copies
>options [file]"
>
>8. Test existence of Ghostscript's ps2pdf with 'which ps2pdf'.
Output
>should be a path like "/usr/bin/ps2pdf" or similar
>
>9. Download a PPD file for cups to print with. An Adobe
>Distiller PPD is
>a great choice. I used the one from this page:
>
>http://www.pentondigitalads.com/PentonDigitalAds/creating_posts
cript_files.h
tm
("Acrobat Distiller PPD for Windows")
     If this link is dead, search Google/web for "distiller ppd" and
find a suitable file.

10. Put the PPD file in /usr/share/cups/model or wherever your CUPS
model PPDs are stored.

11. Restart CUPS.

12. Add the printer to CUPS with the command:
     'lpadmin -p <Chosen Name> -E -v pdf:<out folder> -m
<ppd-file>'
      i.e.:
     'lpadmin -p PDFprinter -E -v pdf:/pub/pdf_out -m distiller.ppd'

13. Test the PDF output by manually printing to the new printer:
     'lpr -P PDFprinter test.txt'

Troubleshooting each step:

1. If you're stuck on #1, find a more appropriate howto.

2. If that file is missing, beg someone for a copy.

7. I got stuck on this one. without renaming it "pdf", it didn't
work at
all. No clue why. Try copying the file "pdfdistiller" the file to
"pdf"
in the same folder. ('cp pdfdistiller pdf'). If these aren't
working, go
no further. Make sure CUPS is installed properly and work on this first.

8. If this doesn't work, you'll need to install the latest "ESP
Ghostscript". It's available at:
	http://www.cups.org/software.php

9. Adobe doesn't distribute this file, so it could be tricky to find.

10. Same as #3. PPD files made for Macintosh and Windows computers will
need to be re-saved in un*x format.

11. There should be a number of PPD files in that folder already. Search
for "laserjet.ppd" if you have no idea where to find them.

12. If this fails, make sure you're specifying a valid PPD file from the
model folder in the "-m" part. Alternatively, you may use '-P
<ppd>'
instead of '-m', but you must specify the entire path.

13. No go? Time to start logging everything. After the first line of
your backend file (pdf or pdfdistiller), add the line "set -x". Edit
your cupsd.conf and set "LogLevel debug". Restart CUPS and peruse the
information in /var/log/cups/error_log for good debugging info.

Enjoy!

Thanks to Kurt Pfeifle [kpfeifle (at) danka (dot) de] for all the help,
comments and editing this mini-howto with me.

--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba
--------------------


-----Original Message-----
From: samba-bounces@lists.samba.org
[mailto:samba-bounces@lists.samba.org]On Behalf Of Daniel Wittenberg
Sent: Tuesday, June 03, 2003 5:25 AM
To: samba@lists.samba.org
Subject: Re: [Samba] pdf printer


Since you've been talking about this I decided I should get around to
trying it.  I used the Apple Color LaserWrite PS driver (and several
others), but I don't get any output on the Linux side.  I used:

[smbpdf]
  comment = PDF Generator
  path = /var/spool/samba
  printable = Yes
  public = yes
  print command = cat - > /tmp/test.ps

I tried making the print command as simple as possible, and what I get
is an empty file.  Any ideas why it wouldn't be sending the data?  I
used log level 4 and didn't see any errors or unsual events...

Dan

On Sat, 2003-05-31 at 16:05, Tom McKellips wrote:
> Yep I have set up mine so that when I print to my Samba PDF printer from
> windows it creates the PDF then puts it in my home directory for me to
use.
>
> On Sat, 31 May 2003 08:50:34 -0400, Joel Hammer wrote
> > I must agree with the simplicity of doing this.
> >
> > Most linux apps will print a postscript document to a file when asked
> > to print to a file. Then, just run ps2pdf. Setting up a print queue
> > to do this would be easy, at least in lprng, since linux apps
routinely
> > generate postscript files when asked to print.
> >
> > If coming from a windows client, just choose a postscript driver and
> > do the same thing.
> >
> > Joel
> >
> > On Sat, May 31, 2003 at 02:51:58AM -0800, Tom McKellips wrote:
> > > Making a PDF printer with samba is easy. I use an Apple Color
laserwriter
> PS
> > > driver on my Windows boxes and a call to ghostscript on Linux.
The
> article
> > > that got me started out good is at http://www.linux-mag.com/2003-
> > > 01/guru_01.html It sounds like this may help you also.
> > >
> > > On Sat, 31 May 2003 11:50:40 +0200, Kurt Pfeifle wrote
> > > > > Norman Zhang nzhang at arkon-group.com
> > > > > Fri May 30 16:34:25 GMT 2003
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > Thank you for your reply.
> > > > >
> > > > >> Please use this little HOWTO:
> > > > >>
> > > > >>
http://lists.samba.org/pipermail/samba/2003-March/093504.html
> > > > >>
> > > > >> The "color" all depends on the PPD you
are using. If you use a
B/W
> > > Laerprinter
> > > > >> PPD for this, your PDF will be B/W too. The
suggested
distiller.ppd
> > > should
> > > > >> be alright. Do you get B/W or Color PDFs from
Linux/UNIX/CUPS?
> > > > >
> > > > > I followed the exact procedure as per above URL, except
I grabbed
the
> > > > > adist5.ppd from the Adobe Universal PostScript
Installer 1.0.6. Is
> that
> > > > > okay?
> > > >
> > > > Yes.
> > > >
> > > > But this only covers the
"Install-PDF-Printer-on-CUPS" part.
> > > >
> > > > The other part is the
"Install-PDF-Printer-on-Windows". Here you
have
> > > > several options. My recommendation is the
"Use-the-CUPS-PostScript-
> > > > Drivers-
for-Windows-NT/2K/XP"-and-export-with-the-help-of-
> > > > cupsaddsmb" one.
> > > >
> > > > > CUPS seems to able to read it. I got color PDF when I
installed an
> > > > > arbitrary color laser printer (HP Color LaserJet 8500
PS.
> > > >
> > > > You mean if you install that printer on a Windows client and
connect
> > > > it to the PDF printer?
> > > >
> > > > That's OK if it works. "The proof of the pudding
lies in the
eating.".
> > > >
> > > > But it won't work with *aribitrary" color laser
printers:
> > > >
> > > >   * the driver *must* be a PostScript driver (won't work
with PCL).
This
> > > >     is probably obvious to most readers
> > > >
> > > >   * even some PostScript drivers won't work. (If they
rely heavily
> > > > on PJL    and write a native PJL header to the PostScript
file they
> > > > generate,    CUPS won't be able to filter the file
properly as
> > > > intended. The "CUPS    PS Driver for Windows
NT/2K/XP" works around
> > > > this.)
> > > >
> > > > > I thought I can
> > > > > get different paper size with this model)
> > > >
> > > > This should work with any PPD containing descriptions for
different
> paper
> > > > sizes.
> > > >
> > > > > and B/W with a B/W laser printer
> > > > > (HP LaserJet 2200 PS). Do you have a recommendation for
a
particular
> > > model?
> > > > >
> > > > >> > I have another question, do I need to add a
Color Laser Printer
> Driver
> > > > >> > in W2K to the PDF share to generate color PDF
in Windows?
> > > > >>
> > > > >> If you read the suggested HOWTO, you'll see
that the driver
> installation
> > > > >> first takes place on CUPS. Then you have a CUPS PDF
printer (also
> > > > >> accessible to native CUPS clients).
> > > > >
> > > > > I have setup CUPS to use PDF printing.
> > > >
> > > > Ah, I see.
> > > >
> > > > > I guess I just need to add printer
> > > > > drivers to the queue?
> > > >
> > > > Yes.
> > > >
> > > > > I was adding the drivers from W2K using HP's
printer
> > > > > drivers. I know it is better to use CUPS drivers, but I
don't know
> which
> > > > > model is good
> > > >
> > > > The one which works on CUPS (determined by the PPD) is good
for Win
> clients
> > > > too. cupsaddsmb installs exactly that PPD, plus the Windows
> > > > PostScript driver you choose (the Adobe or the CUPS
version).
> > > >
> > > > > and it seems to be difficult to use cupsaddsmb.
> > > >
> > > > cupsaddsmb is extremely simple to use. (It is more difficult
to
> understand
> > > > how it works. How it works is discussed in the new HOWTO.)
If it
doesn't
> > > > work, it is mostly because of an error in the
"preparation" of the
> command.
> > > > See "man cupsaddsmb" for that preparation. Common
errors are
> > > > discussed in the new HOWTO.
> > > >
> > > > >> To install it on W2K, simply download the CUPS
driver. Before you
> > > download
> > > > >> it, you need to run cupsaddsmb. Before you run
cupsaddsmb, you
> should
> > > read
> > > > >> "man cupsaddsmb". Even more info about it
is here:
> > > > >>
> > > > >>
http://www.linuxprinting.org/kpfeifle/SambaPrintHOWTO/
> > > > >
> > > > > I have been reading your document for the last 2 days
(excellent
> document
> > > > > BTW). I guess I will read it again 8)
> > > > >
> > > > > Regards,
> > > > > Norman
> > > > >
> > > >
> > > > Cheers,
> > > > Kurt
> > > >
> > > > --
> > > > To unsubscribe from this list go to the following URL and
read the
> > > > instructions:  http://lists.samba.org/mailman/listinfo/samba
> > >
> > >
> > > --
> > > Internet Service Provided By Abyss Communications
> > > Internet Service only $10 a month
> > > 1-866-842-2977
> > > --
> > > To unsubscribe from this list go to the following URL and read
the
> > > instructions:  http://lists.samba.org/mailman/listinfo/samba
>
>
> --
> Internet Service Provided By Abyss Communications
> Internet Service only $10 a month
> 1-866-842-2977

--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba