Virtual PDF Printer: Difference between revisions

From SambaWiki
m (→‎Setup: corrected external link to HP)
m (→‎Setup: corrected external link to HP, really this time)
Line 40: Line 40:
* Reload Samba
* Reload Samba


* If you want to use automatic Point'n'Print driver installation, [[Samba_as_a_print_server#Uploading_printer_drivers_for_Point.27n.27Print_driver_installation|upload a PostScript driver to your Samba server]]. You can use any PostScript driver, like the [http://www.hp.com/go/upd|HP Universal Print Driver PostScript].
* If you want to use automatic Point'n'Print driver installation, [[Samba_as_a_print_server#Uploading_printer_drivers_for_Point.27n.27Print_driver_installation|upload a PostScript driver to your Samba server]]. You can use any PostScript driver, like the [http://www.hp.com/go/upd HP Universal Print Driver PostScript].


* If you don't want to use Point'n'Print driver installation, add the following line to the printer configuration:
* If you don't want to use Point'n'Print driver installation, add the following line to the printer configuration:

Revision as of 08:42, 29 June 2015

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