Glpr: simple graphical interface for lpr (in cups-bsd package)
using bash, zenity and gxmessage.


ENGLISH

lpr allows to print despite the serius 
bug (Debian Bug report logs - #583738) present
in the 8.71~dfsg2-6 version of the ghostscript
package installed on Debian Squeeze.

Valid formats are the follows: 
.pdf .gif .png .jpg .JPG .jpeg 
.tiff .ps .txt .pbm .pnm .ppm 
and text files without extension. 
File paths with points other then extension separator 
(like hidden files, or files in hidden folders) are not valid. 

CAUTION!!! Even if lpr exits correctly there may be printing 
problems: it's possible to check this visiting the URL 
http://localhost:631/jobs/ (if no item is present cups have 
encountered no problems).

Select for all parameters valid values, otherwise the script
will try to identify the wrong item and  to replace it with 
the standard value; in case of failure of the check lpr will 
report an error message.

To specify printing parameters the file lpr-par has to be 
readable and has to be placed in the right folders
( /home/utente/.glpr/ or /etc/glpr/ ) and has to be in 
the right format:
it is necessary to specify at least the name of an aviable 
printer (up to 3), at least a print quality related to a 
supported resolution (up to 6), at least a color model 
(up to 3); it is necessary to specify the first item 
(if they are made of more than one word between ""), 
leave others eventually blank;
it is possible to specify a folder in user's home 
directory too from wich to start file search.
To learn possible parameters value run in a shell
lpoptions -p <PrinterName> -l | grep <parameter>

lpr-par has to be in the following format:

# --------------------------------------- 
#
# printer1=printerName1 
#
printer1=printerName1 
printer2=printerName2 
printer3=printerName3 
#
#
# qual1=quality1
#
qual1=quality1
qual2=quality2
qual3=quality3 
qual4=quality4
qual5=quality5
qual6=quality6 
#
#
# Resolution1=resolution1
#
Resolution1=resolution1 
Resolution2=resolution2 
Resolution3=resolution3
Resolution4=resolution4 
Resolution5=resolution5
Resolution6=resolution6 
#
# (resolution1=720x360dpi for example)
#
#
# ColorModel1=colormodel1
#
ColorModel1=colormodel1
ColorModel2=colormodel2
ColorModel3=colormodel3
#
#
# direct=directoryName
#
direct=directoryName
#
# ---------------------------------------

#
# *      Copyright 2010 Francesco Cappelli
# *      
# *      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., 51 Franklin Street, Fifth Floor, Boston,
# *      MA 02110-1301, USA.
# *
#


ITALIANO

Glpr: semplice interfaccia grafica per lpr (presente 
nel pacchetto cups-bsd) implementata tramite bash, zenity 
e gxmessage.

lpr consente di stampare aggirando 
il bug (Debian Bug report logs - #583738) presente 
nella versione 8.71~dfsg2-6 del pacchetto ghostscript 
installata su Debian Squeeze.

I formati che lpr è in grado di interpretare sono: 
.pdf .gif .png .jpg .JPG .jpeg 
.tiff .ps .txt .pbm .pnm .ppm 
oltre che i file di testo senza estensione.
I percorsi di file che contengono punti diversi dal separatore 
di estensione (come i file nascosti o i file contenuti in 
cartelle nascoste) non sono riconosciuti.

ATTENZIONE!!! Anche se lpr esce con uno status positivo non è 
detto che la stampa sia avvenuta correttamente: è sempre 
necessario controllare; è possibile verificare se le 
istruzioni siano state inviate correttamente al server di 
stampa visitando l'indirizzo http://localhost:631/jobs/ 
(se non è presente alcuna voce la trasmissione è avvenuta 
correttamente). 

Selezionare per tutti i parametri un valore valido: in caso 
contrario il programma cercherà di individuare la voce erronea 
e di sostituirla con il valore di default; nel caso in cui la 
voce sfuggisse ai controlli lpr genererà un messaggio d'errore.

Per poter specificare i parametri di stampa il file lpr-par 
deve avere il permesso di lettura, deve essere collocato nelle 
aposite cartelle ( /home/utente/.glpr/ oppure /etc/glpr/ ) 
e deve essere nel formato corretto: 
è necessario specificare almeno una stampante disponibile 
(fino a 3), almeno una qualità di stampa connessa con una 
risoluzione supportata (fino a 6), nonchè almeno un modello di 
colore (fino a 3); è necessario specificare il primo valore 
(se sono formati da più di una parola metterli fra ""), 
lasciare eventualmente vuoti gli altri campi; 
è inoltre possibile specificare una cartella all'interno della 
home utende da dove far partire la ricerca del file. 
Per conoscere i valori possibili per i parametri lanciare da 
terminale il seguente comando: 
lpoptions -p <nomePrintnte> -l | grep <parametro> 

Il file deve essere nella forma seguente: 

# --------------------------------------- 
#
# printer1=nomeStampante1
#
printer1=nomeStampante1
printer2=nomeStampante2
printer3=nomeStampante3
#
#
# qual1=qualità1
#
qual1=qualità1
qual2=qualità2
qual3=qualità3
qual4=qualità4
qual5=qualità5
qual6=qualità6
#
#
# Resolution1=risoluzione1
#
Resolution1=risoluzione1
Resolution2=risoluzione2
Resolution3=risoluzione3
Resolution4=risoluzione4
Resolution5=risoluzione5
Resolution6=risoluzione6
#
# (resolution1=720x360dpi per esempio)
#
#
# ColorModel1=modelloColore1
#
ColorModel1=modelloColore1
ColorModel2=modelloColore2
ColorModel3=modelloColore3
#
#
# direct=cartellaFile
#
direct=cartellaFile
#
# ---------------------------------------

