Ajout option --convert-only pour conversion sans impression
- Ajout flag --convert-only / --no-print - Permet conversion PDF sans impression automatique - Utile pour intégration bureau et workflows batch
This commit is contained in:
@@ -40,6 +40,7 @@ COLOR=false
|
|||||||
DUPLEX="none"
|
DUPLEX="none"
|
||||||
INSTALL_DEPS=false
|
INSTALL_DEPS=false
|
||||||
KEEP_PDF=false
|
KEEP_PDF=false
|
||||||
|
CONVERT_ONLY=false
|
||||||
CONFIG_FILE=""
|
CONFIG_FILE=""
|
||||||
VERBOSE=false
|
VERBOSE=false
|
||||||
LOG_FILE=""
|
LOG_FILE=""
|
||||||
@@ -99,6 +100,7 @@ OPTIONS:
|
|||||||
-d, --duplex MODE Mode recto-verso: none, simplex, duplex (défaut: none)
|
-d, --duplex MODE Mode recto-verso: none, simplex, duplex (défaut: none)
|
||||||
-i, --install-deps Installer les dépendances automatiquement
|
-i, --install-deps Installer les dépendances automatiquement
|
||||||
-k, --keep-pdf Conserver le fichier PDF après impression
|
-k, --keep-pdf Conserver le fichier PDF après impression
|
||||||
|
--convert-only, --no-print Conversion uniquement (sans impression)
|
||||||
--config FILE Fichier de configuration
|
--config FILE Fichier de configuration
|
||||||
-v, --verbose Mode verbeux (logging DEBUG)
|
-v, --verbose Mode verbeux (logging DEBUG)
|
||||||
-l, --log FILE Fichier de log
|
-l, --log FILE Fichier de log
|
||||||
@@ -410,6 +412,11 @@ while [[ $# -gt 0 ]]; do
|
|||||||
KEEP_PDF=true
|
KEEP_PDF=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--convert-only|--no-print)
|
||||||
|
CONVERT_ONLY=true
|
||||||
|
KEEP_PDF=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--config)
|
--config)
|
||||||
if [ -z "${2:-}" ]; then
|
if [ -z "${2:-}" ]; then
|
||||||
log ERROR "Option --config nécessite un argument"
|
log ERROR "Option --config nécessite un argument"
|
||||||
@@ -629,7 +636,8 @@ case "$DUPLEX" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Impression
|
# Impression (sauf si --convert-only)
|
||||||
|
if [ "$CONVERT_ONLY" = false ]; then
|
||||||
log INFO "=== Impression ==="
|
log INFO "=== Impression ==="
|
||||||
log INFO "Options:"
|
log INFO "Options:"
|
||||||
log INFO " - Copies: $COPIES"
|
log INFO " - Copies: $COPIES"
|
||||||
@@ -650,6 +658,9 @@ if ! lp "${LP_OPTS[@]}" "$PDF_FILE" 2>&1 | while IFS= read -r line; do log DEBUG
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log INFO "Impression lancée avec succès!"
|
log INFO "Impression lancée avec succès!"
|
||||||
|
else
|
||||||
|
log INFO "Mode conversion uniquement (pas d'impression)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Gestion du fichier PDF
|
# Gestion du fichier PDF
|
||||||
if [ "$KEEP_PDF" = false ]; then
|
if [ "$KEEP_PDF" = false ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user