Utilizzo del Driver Postcript CUPS per Windows

From RVM Wiki
Jump to navigation Jump to search

Se l'installazione del driver Windows di una stampante Postscript non funziona, ed è disponibile un PPD, è possibile usarlo unitamente al driver Windows di CUPS.

Prerequisiti

  • Cups deve essere installato e funzionate sul server samba
  • La coda di stampa deve essere configurata con il PPD corretto, e quindi stampare correttamente la pagina di prova da CUPS


Vedere questa procedura per driver 32 e 64 bit:

http://blog.realcomputerguy.com/2011/10/cups-samba-64bit-driver-installation.html
 CUPS Samba 64bit automatic driver download
The same ease of using Samba hosting for automatic download of the CUPS/Windows Postscript drivers for 32 bit clients can be implemented for 64 bit clients as well.


Brief overview of stuff you already need to know how to do:

    Your printer needs to be added to CUPS
        generally consists of placing proper PPD files - many available at http://cups.org/ppd.php - in /usr/share/cups/model/ and following the CUPS documentation.
    Set Samba up properly for CUPS
        See: http://samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html
        Samba usually needs to be reloaded after adding printers to CUPS



OK, let's dive in and do it.


We need the drivers. Some from CUPS, some from your Windows system.
The 32 bit CUPS drivers are available from: http://svn.easysw.com/public/windows/trunk/i386/
The 64 bit CUPS drivers are available from: http://svn.easysw.com/public/windows/trunk/x64/

The Windows drivers are on the client systems. We need these files:

    ps5ui.dll
    pscript.hlp
    pscript.ntf
    pscript5.dll

Extract the 32 bit ones from  (a 32 bit system):

    \Windows\System32\spool\drivers\W32X86\PCC\ntprint.inf_<random-stuff>.cab

Extract the 64 bit ones from (a 64 bit system):

    \Windows\System32\spool\drivers\x64\PCC\ntprint.inf_<random-stuff>.cab

Prepare the drivers that we have downloaded.

    They all need to be lower case! You may need to rename the ones from the Windows clients.
    The 64 bit cups6.inf file is not properly "decorated" - see: http://support.microsoft.com/kb/888728 we need to fix this:
        http://realcomputerguy.com/files/cups6.inf.x64.patch makes it simple.

Prepare/populate the directories.

    The 32 bit drivers that we have obtained and prepared need to be copied to:
        /usr/share/cups/drivers/
    The 64 bit drivers that we have obtained and prepared need to be copied to:
        /usr/share/cups/drivers/x64/
    Due to cupsaddsmb quirk (lower case "x"), check and "fix", if necessary, the Samba x64 directory:
        ls /var/lib/samba/printers/
            if your distro/installation created an X64 (upper case) instead of an x64 directory symlink to it:
                cd /var/lib/samba/printers
                ln -s X64 x64

Add the printer drivers to Samba.


Now we use cupsaddsmb, which handles all the rpcclient calls, to add the printers to our Samba installation. Simplest is:

    cupsaddsmb -v -a

Read "man cupsaddsmb" for more options.

Installazione del driver CUPS sul server

  • Installazione pacchetto utility (comando cups-config):
Per Debian Squeeze:
sudo apt-get install libcupsys2-dev
Per Debian Wheezy:
sudo apt-get install libcups2-dev
  • Prelevare il driver ed installarlo:
cd /tmp
wget http://support.rvmgroup.it/download/cups-windows-6.0-source.tar.bz2
tar xvjf cups-windows-6.0-source.tar.bz2
cd cups-windows-6.0/
sudo make install
Il driver sarà qui:
ls /usr/share/cups/drivers/cups*
-rw-r--r-- 1 root root   803 2009-05-05 12:02 /usr/share/cups/drivers/cups6.inf
-rw-r--r-- 1 root root    72 2009-05-05 12:02 /usr/share/cups/drivers/cups6.ini
-rw-r--r-- 1 root root 12568 2009-05-05 12:02 /usr/share/cups/drivers/cupsps6.dll
-rw-r--r-- 1 root root 13672 2009-05-05 12:02 /usr/share/cups/drivers/cupsui6.dll
  • Copiare i files del driver Postscript di Windows. Questo driver si trova in
%WINDIR%\system32\spool\drivers\w32x86
Copiare questi files:
ps5ui.dll
pscript5.dll
pscript.hlp
pscript.ntf
In
/usr/share/cups/drivers
Eventualmente, rinominarli in minuscolo, e sistemare le permission:
cd /usr/share/cups/drivers
sudo mv PS5UI.DLL ps5ui.dll
sudo chmod -x ps5ui.dll
sudo mv PSCRIPT5.DLL pscript5.dll
sudo chmod -x pscript5.dll
sudo mv PSCRIPT.HLP pscript.hlp
sudo chmod -x pscript.hlp
sudo chmod -x pscript.ntf
Alla fine dovranno essetrci i seguenti files:
ls /usr/share/cups/drivers
total 1440
drwxr-xr-x  2 root root   4096 2009-05-05 12:16 .
drwxr-xr-x 11 root root   4096 2009-05-05 09:26 ..
-rw-r--r--  1 root root    803 2009-05-05 12:02 cups6.inf
-rw-r--r--  1 root root     72 2009-05-05 12:02 cups6.ini
-rw-r--r--  1 root root  12568 2009-05-05 12:02 cupsps6.dll
-rw-r--r--  1 root root  13672 2009-05-05 12:02 cupsui6.dll
-rw-r--r--  1 root root 129024 2009-05-05 12:15 ps5ui.dll
-rw-r--r--  1 root root 455168 2009-05-05 12:15 pscript5.dll
-rw-r--r--  1 root root  26038 2009-05-05 12:15 pscript.hlp
-rw-r--r--  1 root root 792644 2009-05-05 12:15 pscript.ntf

Installazione della Coda di Stampa CUPS

ATTENZIONE: SEMBRA CHE SE SI LASCI IL PPD ATTIVO SULLA CODA CUPS DOPO CHE È STATA CREATA LA CODA WINDOWS ED ASSEGNATIGLI I DRIVERS, NON SIA POSSIBILE SOVRASCRIVERE LE OPZIONI IMPOSTATE IN CUPS STESSO. SE COSÌ FOSSE, OCCORRE RIDEFINIORE VIA WEB LA CODA CUPS COME RAW, E LASCIARE INALTERATA LA CODA WINDOWS, CHE MANTERRÀ IL PPD.

Creare la coda di stampa CUPS tramite l'interfaccia WEB, avendo cura di installare il PPD corretto.

Se si impostano già le opzioni del PPD, queste saranno ereditate dalla coda Windows che si creerà dopo.

Esempio di coda:

sudoedit /etc/cups/printers.conf
...
<Printer MEN501_Heading>
Info Xerox WorkCentre 7242 Postscript - Heading Paper
Location Mendrisio, 5th Floor, QA Office
DeviceURI socket://cromenjd03:9100
State Idle
StateTime 1241529196
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>

Questa coda avrà anche il file PPD in:

ls /etc/cups/ppd/MEN501_Heading.ppd
-rw-r--r-- 1 root root 66869 2009-05-05 12:45 /etc/cups/ppd/MEN501_Heading.ppd

Testare la stampa di pagina di prova dall'interfaccia WEB di CUPS.

Si avrà quindi una coda di Stampa SAMBA senza driver Windows.

Assegnazione del driver CUPS alla coda Windows

Ora si assegnerà il driver di stampa CUPS alla coda di stampa Windows, utilizzando il PPD associato alla coda.

In pratica il driver CUPS è un driver postscript generico, che utlizza il PPD configurato per la coda linux:

sudo cupsaddsmb -H localhost -U administrator -v MEN601_Recycled

Inserire la password di administrator:

Password for administrator required to access localhost via SAMBA: 

Vengono copiati i files nella share print$:

Running command: smbclient //localhost/print$ -N -A /var/spool/cups/tmp/4a005bacd45ca -c 'mkdir W32X86;put /var/spool/cups/tmp/4a005ba85430e W32X86/MEN601_Recycled.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put /usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
Domain=[CROMEN] OS=[Unix] Server=[Samba 3.0.24]
NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
putting file /var/spool/cups/tmp/4a005ba85430e as \W32X86/MEN601_Recycled.ppd (2104.9 kb/s) (average 2104.9 kb/s)
putting file /usr/share/cups/drivers/ps5ui.dll as \W32X86/ps5ui.dll (1575.0 kb/s) (average 1868.1 kb/s)
putting file /usr/share/cups/drivers/pscript.hlp as \W32X86/pscript.hlp (1338.3 kb/s) (average 1817.2 kb/s)
putting file /usr/share/cups/drivers/pscript.ntf as \W32X86/pscript.ntf (12901.1 kb/s) (average 4394.9 kb/s)
putting file /usr/share/cups/drivers/pscript5.dll as \W32X86/pscript5.dll (14338.7 kb/s) (average 5461.5 kb/s)

Running command: smbclient //localhost/print$ -N -A /var/spool/cups/tmp/4a005bacd45ca -c 'put /usr/share/cups/drivers/cups6.ini W32X86/cups6.ini;put /usr/share/cups/drivers/cupsps6.dll W32X86/cupsps6.dll;put /usr/share/cups/drivers/cupsui6.dll W32X86/cupsui6.dll'
Domain=[CROMEN] OS=[Unix] Server=[Samba 3.0.24]
putting file /usr/share/cups/drivers/cups6.ini as \W32X86/cups6.ini (3.9 kb/s) (average 3.9 kb/s)
putting file /usr/share/cups/drivers/cupsps6.dll as \W32X86/cupsps6.dll (1534.2 kb/s) (average 474.8 kb/s)
putting file /usr/share/cups/drivers/cupsui6.dll as \W32X86/cupsui6.dll (136720000.0 kb/s) (average 988.3 kb/s)

Viene aggiunto il driver appena caricato:

Running command: rpcclient localhost -N -A /var/spool/cups/tmp/4a005bacd45ca -c 'adddriver "Windows NT x86" "MEN501_Heading:pscript5.dll:MEN501_Heading.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript5.dll,MEN501_Heading.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,cups6.ini,cupsps6.dll,cupsui6.dll"'

L'operazione ha avuto successo:

Printer Driver MEN501_Heading successfully installed.

Viene assegnato il driver appena caricato alla coda:

Running command: rpcclient localhost -N -A /var/spool/cups/tmp/4a005bacd45ca -c 'setdriver MEN601_Recycled MEN601_Recycled'

L'operazione ha avuto successo:

Succesfully set MEN601_Recycled to driver MEN601_Recycled.

Ora le code SAMBA saranno già associate al driver con il PPD, e si potrannos elezionare i cassetti e tutto quanto disponibile nelle opzioni del PPD.

Riferimenti