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"
|
||||
INSTALL_DEPS=false
|
||||
KEEP_PDF=false
|
||||
CONVERT_ONLY=false
|
||||
CONFIG_FILE=""
|
||||
VERBOSE=false
|
||||
LOG_FILE=""
|
||||
@@ -99,6 +100,7 @@ OPTIONS:
|
||||
-d, --duplex MODE Mode recto-verso: none, simplex, duplex (défaut: none)
|
||||
-i, --install-deps Installer les dépendances automatiquement
|
||||
-k, --keep-pdf Conserver le fichier PDF après impression
|
||||
--convert-only, --no-print Conversion uniquement (sans impression)
|
||||
--config FILE Fichier de configuration
|
||||
-v, --verbose Mode verbeux (logging DEBUG)
|
||||
-l, --log FILE Fichier de log
|
||||
@@ -410,6 +412,11 @@ while [[ $# -gt 0 ]]; do
|
||||
KEEP_PDF=true
|
||||
shift
|
||||
;;
|
||||
--convert-only|--no-print)
|
||||
CONVERT_ONLY=true
|
||||
KEEP_PDF=true
|
||||
shift
|
||||
;;
|
||||
--config)
|
||||
if [ -z "${2:-}" ]; then
|
||||
log ERROR "Option --config nécessite un argument"
|
||||
@@ -629,7 +636,8 @@ case "$DUPLEX" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Impression
|
||||
# Impression (sauf si --convert-only)
|
||||
if [ "$CONVERT_ONLY" = false ]; then
|
||||
log INFO "=== Impression ==="
|
||||
log INFO "Options:"
|
||||
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
|
||||
|
||||
log INFO "Impression lancée avec succès!"
|
||||
else
|
||||
log INFO "Mode conversion uniquement (pas d'impression)"
|
||||
fi
|
||||
|
||||
# Gestion du fichier PDF
|
||||
if [ "$KEEP_PDF" = false ]; then
|
||||
|
||||
Reference in New Issue
Block a user