Author Topic: eBox 1.4 - PDF Printing Support  (Read 3698 times)

Joao Correia

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Genectiva - Intelligent Systems
eBox 1.4 - PDF Printing Support
« on: April 16, 2010, 07:18:53 pm »
Hello,

This worked for me, I have managed to config a PDF Printer on eBox to all users. I think this could be a possibility on eBox Printer Sharing UI.

Changed /usr/share/ebox/stubs/samba/smb.conf.mas and add:
Code: [Select]
[PDF_Printer]
 comment = PDF Printer
 path  = /var/spool/samba
 printing = lprng
 read only = yes
 printable = yes
 guest ok = yes
 print command = /usr/sbin/pdfprint %s %U %G %m %I %H

Then created /usr/sbin/pdfprint with this content:
Code: [Select]
#!/bin/bash
#convert to pdf
#$1=spool file $2=uid $3=gid $4=machinename $5=ip $6=homedir
FILENAME=pdf-$2-`date +%d%m%H%M%S`.pdf
OUTPUTPATH=$6/PDF
mkdir $OUTPUTPATH
/usr/bin/ps2pdf $1 $OUTPUTPATH/$FILENAME >> $OUTPUTPATH/pdfcreate.log 2>> $OUTPUTPATH/pdfcreate.log
rm $1
rm $OUTPUTPATH/pdfcreate.log

This file must be owned by root and permission must be '755', otherwise it will not work.

The PDF file will be created on the PDF dir on home dir drive.

This script can be changed to send the PDF to user email, eBox team place this as a controlled printer.

On Windows Machines (Tested on XP), configure this with the "HP Color LaserJet 8500 PS Driver" in order to be able to print B&W and COLOR.

Hope this is helpfull.

Best regards from Portugal.
« Last Edit: April 16, 2010, 07:35:17 pm by Joao Correia »
João Correia
Genectiva - Intelligent Systems
http://www.genectiva.com

J. A. Calvo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1986
  • Karma: +67/-3
    • View Profile
    • http://blogs.zentyal.org/jacalvo
Re: eBox 1.4 - PDF Printing Support
« Reply #1 on: April 17, 2010, 06:09:32 am »
Thanks for sharing this!
Zentyal Server Lead Developer

dangerbock

  • Zen Apprentice
  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: eBox 1.4 - PDF Printing Support
« Reply #2 on: April 30, 2010, 10:54:44 am »
tnkx :) ou Obrigado como nós por cá dizemos

pleandro

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • Papaformigas - IS/IT Consulting
Re: eBox 1.4 - PDF Printing Support
« Reply #3 on: May 26, 2010, 01:14:16 pm »
Thanks / Obrigado João.
-----
Paulo Leandro

Marcus

  • Forum Moderator
  • Zen Samurai
  • *****
  • Posts: 395
  • Karma: +12/-0
    • View Profile
    • Professional IT Service
Re: eBox 1.4 - PDF Printing Support
« Reply #4 on: May 31, 2010, 01:24:19 pm »
Thanks a bunch !   :)
« Last Edit: May 31, 2010, 01:28:47 pm by Marcus »