Virtual PDF Printer

From SambaWiki
Jump to: navigation, search

Beside the various PDF printer programs, which require an installation on clients, it might be useful, to have a virtual Samba printer. This enables users to create and automatically store PDF files on the server, as simple as printing. No additional software installation is required on the clients, if your Samba Print Server provides Point'n'Print support.



Requirements



Setup

  • Rename the script to „Pdfprint.sh“ and place it in /usr/local/bin/
  • Make the script executable
# chmod 755 /usr/local/bin/Pdfprint.sh
  • Add the following configuration to your smb.conf (adjust the spool path and print command, if necessary):
[PDFprinter]
        comment = Samba Virtual PDF Printer
        path = /var/spool/samba
        printable = Yes
        lpq command =
        lprm command =
        print command = /usr/local/bin/Pdfprint.sh -s /var/spool/samba/%s \
                        -d /home/%U -o %U -m 600
For a complete list of all usable variables, see the smb.conf manpage ("Variable substitution", "print command")
  • Check out the scripts help for other parameters, that might be useful
# /usr/local/bin/Pdfprint.sh -h
  • Reload Samba
  • If you don't want to use Point'n'Print driver installation, add the following line to the printer configuration:
use client driver = yes

Using the virtual PDF printer

  • Connect the printer on your client.
  • Simply send a print job to the PDFprinter and the PDF is stored in the configured path with the defined permissions.



Solving problems

If the PDF isn't stored in its destination, enable the logging option of the script.

[PDFprinter]
        .....
        print command = /usr/local/bin/Pdfprint.sh ..... -l /var/log/samba/Pdfprint.log