Hallo Leute! Ich weiss, das kam vor kurzem, aber ich glaube da ist keine anbliessende Lösung aufgetaucht. Daher neue Frage: - Ich moechte auf meinem Drucksever einen PDF-Drucker einrichten - SuSE hat standardmaessig einen "pdf"-printer in der smb.conf drinnen -> aber da passiert nichts. Es wird ein temp-file in /var/tmp angelegt und dann verschwindet es wieder. CUPS findet den Drucker nicht. - Ich habe beim googlen eine menge tips gefunden wie man in CUPS einen PDF Drucker einrichtet. Ich bin jedesmal bis zum "add printer -> continue -> select PDF" gekommen, weil dieser Anschluss bei mir nicht exisitert. Wie kann ich CUPS beibringen eine PDF Ausgabedatei im Heimatverzeichnis des Benutzers anzulegen bzw. alternativ SAMBA? Mein System: SUSE 9.1 Pro Danke T
Hallo Thorsten, ich bin die Sache damals anders angegangen: Ich habe das script unter /home/samba/scripte mit dem Namen pdfscript abgelegt. Das folgendes Script erstellt das PDF: #!/bin/bash # Generate PDF's via Samba # # 1: find the file name FILE=$(egrep "^%%Title:" "$1" | head -n 2 | sed -e 's/^%%Title: //g' | sed -e 's/^(//g' | sed -e 's/\(.*\)\..*$/\1/g' | tr -d "\r\n") FILE=`echo -n -e $FILE` # 2: Remove crap from the beginning and the end of the ps file POS_S=`egrep -n "^%\!PS-Adobe" "$1" | cut -d : -f 1 ` POS_E=`egrep -n "^%%EOF" "$1" | cut -d : -f 1` sed 1,$[$POS_S - 1]d "$1" | head -n $[$POS_E - $POS_S + 1] > "${FILE}.ps" # 3: now we can remove the smb file rm -f "$1" # 4: make a pdf gs -q -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -r1200x1200 -sOutputFile="${FILE}.pdf" -c save pop -f "${FILE}.ps" # 5: remove PostScript file rm -f "${FILE}.ps" In der smb.conf habe ich dann folgendes eingetragen: [pdfprinter] comment = Treiber: Minolta Color PageWorks/Pro PS path = /home/pdfprinter printable = Yes print command = /home/samba/scripte/pdfscript %s lpq command = lprm command = Gruss Dietmar Am Freitag, 1. Oktober 2004 09:51 schrieb Dr. Thorsten Brandau:
Hallo Leute!
Ich weiss, das kam vor kurzem, aber ich glaube da ist keine anbliessende Lösung aufgetaucht.
Daher neue Frage:
- Ich moechte auf meinem Drucksever einen PDF-Drucker einrichten - SuSE hat standardmaessig einen "pdf"-printer in der smb.conf drinnen -> aber da passiert nichts. Es wird ein temp-file in /var/tmp angelegt und dann verschwindet es wieder. CUPS findet den Drucker nicht.
- Ich habe beim googlen eine menge tips gefunden wie man in CUPS einen PDF Drucker einrichtet. Ich bin jedesmal bis zum "add printer -> continue -> select PDF" gekommen, weil dieser Anschluss bei mir nicht exisitert.
Wie kann ich CUPS beibringen eine PDF Ausgabedatei im Heimatverzeichnis des Benutzers anzulegen bzw. alternativ SAMBA?
Mein System: SUSE 9.1 Pro
Danke
T
-- ________________________________________________ Simons IT-Service Dietmar Simons Matthiasstr. 18a 41468 Neuss Germany Phone +49 2131 15 34 98 Fax +49 2131 15 34 99 Mobil +49 172 253 05 23 Email dietmar.simons@simons-it-service.de ________________________________________________
Dr. Thorsten Brandau, Freitag, 1. Oktober 2004 09:51:
Ich weiss, das kam vor kurzem, aber ich glaube da ist keine anbliessende Lösung aufgetaucht.
Doch, läuft hier. In die /etc/cups/printers.conf muß ein Abschnitt rein wie <Printer PDF-Printer> DeviceURI pdf://verzeichnis/der/pdfs State Idle Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 </Printer> In /usr/lib/cups/backend legst Du eine Datei namens pdf an. Die Rechte guckst Du Dir von den anderen Backends ab, die da drin liegen. Die Datei enthält [1]. Dann mußt Du nur noch die smb.conf anpassen, und folgende Sektion hinzufügen: [printers] comment = All Printers path = /var/tmp printable = Yes create mask = 0600 browseable = No Danach die ganzen Daemonen restarten, und dann sollte es tun. Ich hab selbst lange nach diesem Weg gesucht, daher etwas ausführlicher, in der Hoffnung, daß das ein paar anderen hier auch hilft. Andy [1] #!/bin/sh # # This script is intended to be used as a CUPS backend, to create # PDF file on-the-fly. Just create a printer using the device uri # pdf:/path/to/dir/. When printing to this printer, a PDF file # will be generated in the directory specified. The file name will # be either "<jobname>.pdf" or "unknown.pdf", depending wether the # jobname is empty or not. # # To use it, simply copy this script to your backend directory, and # create a printer with the correct URI. That's it. # # Copyright (C) Michael Goffioul (kdeprint <at> swing <dot> be) 2001 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA LOGFILE=/tmp/pdf.log PDFBIN=`which ps2pdf` FILENAME= # this is borrowed from printpdf script for the filename PRINTTIME=`date +%b%d-%H%M%S` echo "Executable: $PDFBIN" > $LOGFILE echo "Arguments: |$1|$2|$3|$4|$5|$6|" >> $LOGFILE echo $# $PRINTTIME >> $LOGFILE # case of no argument, prints available URIs if [ $# -eq 0 ]; then if [ ! -x "$PDFBIN" ]; then exit 0 fi echo "direct pdf \"Unknown\" \"PDF Writing\"" exit 0 fi # case of wrong number of arguments if [ $# -ne 5 -a $# -ne 6 ]; then echo "Usage: pdf job-id user title copies options [file]" exit 1 fi # get PDF directory from device URI, and check write status PDFDIR=${DEVICE_URI#pdf:} if [ ! -d "$PDFDIR" -o ! -w "$PDFDIR" ]; then echo "ERROR: directory $PDFDIR not writable" exit 1 fi echo "PDF directory: $PDFDIR" >> $LOGFILE # generate output filename OUTPUTFILENAME= if [ "$3" = "" ]; then OUTPUTFILENAME="$PDFDIR/unknown.pdf" else # OUTPUTFILENAME="$PDFDIR/${3//[^[:alnum:]]/_}.pdf" # I changed this to user name, and the printtime to track down who # printed the PDF and when, samba printing just uses nobody OUTPUTFILENAME="$PDFDIR/$2-$PRINTTIME.pdf" echo "PDF file: $OUTPUTFILENAME placed in: $PDFDIR" >> $LOGFILE fi echo "Output file name: $OUTPUTFILENAME" >> $LOGFILE # run ghostscript if [ $# -eq 6 ]; then $PDFBIN $6 "$OUTPUTFILENAME" #>& /dev/null else $PDFBIN - "$OUTPUTFILENAME" >& /dev/null fi # modify ownership and permissions on the file # - world readable # - owns to user specified in argument chmod a+r "$OUTPUTFILENAME" if [ "$2" != "" ]; then chown $2 "$OUTPUTFILENAME" fi exit 0 -- Antworten an lists@feile.net werden in /dev/null archiviert! Bitte ggf. lists... durch mail... ersetzen. Andreas Feile www.feile.net
Hallo Andreas, Andreas Feile wrote:
Ich weiss, das kam vor kurzem, aber ich glaube da ist keine anbliessende Lösung aufgetaucht.
In die /etc/cups/printers.conf muß ein Abschnitt rein wie
<Printer PDF-Printer> DeviceURI pdf://verzeichnis/der/pdfs State Idle Accepting Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 </Printer>
[printers] comment = All Printers path = /var/tmp printable = Yes create mask = 0600 browseable = No
habe ich alles gemacht. Bei einem Druckauftrag an den drucker kommt in /var/log/error_log E [03/Oct/2004:15:35:41 +0200] get_printer_attrs: resource name '/printers/pdfprinter' no good! I [03/Oct/2004:15:35:41 +0200] Adding start banner page "none" to job 12. I [03/Oct/2004:15:35:41 +0200] Adding end banner page "none" to job 12. I [03/Oct/2004:15:35:41 +0200] Job 12 queued on 'PDF-Printer' by 'crash'. I [03/Oct/2004:15:35:41 +0200] Started backend /usr/lib/cups/backend/pdf (PID 18319) for job 12. E [03/Oct/2004:15:35:41 +0200] PID 18319 stopped with status 2! I [03/Oct/2004:15:35:41 +0200] Hint: Try setting the LogLevel to "debug" to find out more. I [03/Oct/2004:15:35:41 +0200] Saving printers.conf... E [03/Oct/2004:15:35:42 +0200] get_printer_attrs: resource name '/printers/pdfprinter' no good! und die datei wird nicht erstellt. Ich habe einen Apple ColorLaserwriterPS Treiber eingestellt. Die gleichen Fehler hatte ich bei allen anderen tests auch. Kann es sein, das es irgendwas triviales ganz unten bei Cups ist? Oder hast du noch eine adere idee? Danke T
Okay, ich gebe zu, das war ein echt dummes problem: Beim Kopieren des scriptes auf Andreas' email habe ich vergessen die Zeilenumbrüche zu prüfen. Dies hatte den effekt, das das Script natürlich kommentarlos abstuerzte. Eine Frage evtl. aber noch: Kann ich die PDF-Dateien auch in die jeweiligen Home-verzeichnisse exportieren? Danke T Dr. Thorsten Brandau wrote:
Hallo Andreas,
Andreas Feile wrote:
Ich weiss, das kam vor kurzem, aber ich glaube da ist keine anbliessende Lösung aufgetaucht.
Dr. Thorsten Brandau, Sonntag, 3. Oktober 2004 15:37:
E [03/Oct/2004:15:35:41 +0200] get_printer_attrs: resource name '/printers/pdfprinter' no good!
Woher kommt denn /printers/pdfprinter? Hast Du diesen Namen irgendwo verwendet? -- Antworten an lists@feile.net werden in /dev/null archiviert! Bitte ggf. lists... durch mail... ersetzen. Andreas Feile www.feile.net
participants (3)
-
Andreas Feile
-
Dietmar Simons
-
Dr. Thorsten Brandau