Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 20/10/2021, à 12:26

Caille

[Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Bonjour,

Je possède un multifonction Brother MFC-L2720DW !
Elle est très bien configuré et installée et fonctionne parfaitement, à l’exception que les scan depuis le bouton ad-hoc de l'appareil ne se font qu'en .tif.
J'ai effectivement réussi non sans mal à configurer le bouton sur l'écran tactile de mon imprimante pour afficher le nom de mon PC qui lance le scan direct.
J'aimerais simplement que mes scan direct depuis l'appareil soient effectués en .pdf et non en .tif, c'est toujours possible depuis le PC, mais je suis curieux d'autres solutions. tongue
J'ai trouvé plusieurs scripts dans le dossier opt concernant l'appareil où est indiqué .tif, bien sûr modifier .tif en .pdf ici ne change que l'extension, le fichier reste toujours le même.

#! /bin/bash
# scantofile
#
mkdir -p ~/brscan
sleep 0.2

if [ -e ~/.brscan-skey/scantofile.config ];then
   source ~/.brscan-skey/scantofile.config
elif [ -e /etc//opt/brother/scanner/brscan-skey/scantofile.config ];then
   source /etc//opt/brother/scanner/brscan-skey/scantofile.config
fi



SCANIMAGE="/opt/brother/scanner/brscan-skey/skey-scanimage"
OUTPUT=~/brscan/brscan_"$(date +%Y-%m-%d-%H-%M-%S)".tif
OPT_OTHER=""



if [ "$resolution" != '' ];then
   OPT_RESO="--resolution $resolution" 
else
   OPT_RESO="--resolution 100" 
fi

if [ "$source" != '' ];then
   OPT_SRC="--source $source" 
else
   OPT_SRC="--source FB" 
fi

if [ "$size" != '' ];then
   OPT_SIZE="--size $size" 
else
   OPT_SIZE="--size A4" 
fi

if [ "$duplex" = 'ON' ];then
   OPT_DUP="--duplex"
   OPT_SRC="--source ADF_C" 
else
   OPT_DUP=""
fi
OPT_FILE="--outputfile  $OUTPUT"

OPT_DEV="--device-name $1"

OPT="$OPT_DEV $OPT_RESO $OPT_SRC $OPT_SIZE $OPT_DUP $OPT_OTHER $OPT_FILE"

if [ "$(echo "$1" | grep net)" != '' ];then
    sleep 1
fi

#echo  "$SCANIMAGE $OPT" 
$SCANIMAGE $OPT

if [ ! -e "$OUTPUT" ];then
   sleep 1
   $SCANIMAGE $OPT
fi

echo "$OUTPUT" is created.

Alors je fais plutôt appel ici aux talents de développeurs de scripts !

Dernière modification par Caille (Le 21/10/2021, à 10:00)

Hors ligne

#2 Le 20/10/2021, à 13:27

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

L'appli de scan, c'est brscan. Il y a aussi brscan-skey qui sert, si je ne m'abuse, à lancer brscan rapidement via un bouton sur le scanner.

Dans le script, brscan-skey utilise un fichier de config situé à ~/.brscan-skey/scantofile.config et, s'il ne le trouve pas, il se rabat sur la config système qui est à /etc//opt/brother/scanner/brscan-skey/scantofile.config.

Dans un premier temps, il faudrait jeter un coup d'œil à ces fichiers de config, il y a peut-être une option qui indique quel format de fichier utiliser par défaut pour le scan. Affiche le contenu du fichier ~/.brscan-skey/scantofile.config (il n'existera peut-être pas) :

cat ~/.brscan-skey/scantofile.config

et celui du système :

cat /etc//opt/brother/scanner/brscan-skey/scantofile.config

Hors ligne

#3 Le 20/10/2021, à 13:55

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Bonjour abelthorne,

brscan-skey sert bien à lancer brscan via ce bouton, j'ai même eu un moment deux choix au niveau du scanner.

- caille
- brscan-skey

Effectivement le premier ne donne rien : Aucun fichier ou dossier de ce type.
Dans le deuxième il y a bien des informations mais il n'y a pas d'option sur le format de sortie, ce doit-être ailleurs.
J'avais même pensé à la possibilité d'avoir l'affichage de xscan pour le lancer directement via le scanner, mais cela ne changerait pas le type de fichier sortant.

$ cat ~/.brscan-skey/scantofile.config
cat: /home/caille/.brscan-skey/scantofile.config: Aucun fichier ou dossier de ce type
caille@caille-N76VB:~$ cat /etc//opt/brother/scanner/brscan-skey/scantofile.config
#[brscan-skey]

# resolution=100,150,200,300,400,600,1200,2400,4800,9600
resolution=100

# source=FB,ADF_L,ADF_C
source=FB

#duplex=OFF,ON
duplex=OFF

#size=MAX,A3,A4,A5,A6,Letter,Legal,${width}x${height} (mm)
size=A4

J'ai essayé de regarder tous les fichiers (scripts exécutables ), mais je n'ai rien trouvé de probant.
Je suis pourtant persuadé que c'est possible !

Hors ligne

#4 Le 20/10/2021, à 14:20

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Il y a des infos potentielles chez Brother : https://support.brother.com/g/b/faqend. … 100611_000 (ce n'est pas forcément pour ton modèle de scanner mais on cherche des infos génériques).
Ne modifie rien, évidemment, je mets le lien comme référence mais il faut déjà comprendre comment tout ce bazar s'emboîte.

Je ne sais pas ce que tu as trouvé comme fichier à la base mais si on part du principe que c'est le script scantofile qui est utilisé dans ton cas, il se trouve apparemment là : /usr/local/Brother/sane/script/scantofile-0.2.0-1.sh
Donne son contenu :

cat /usr/local/Brother/sane/script/scantofile-0.2.0-1.sh

Note : le numéro de version ne sera pas forcément le même de ton côté ; si le fichier n'existe pas, regarde dans /usr/local/Brother/sane/script ce qu'il y a.

En tout cas, je ne trouve pas de doc sur les options utilisables dans le fichier de config mais les solutions aux divers problèmes similaires impliquent de convertir l'image scannée en PDF via des applis diverses, ce qui me fait penser qu'on ne peut pas exporter directement en PDF, il va falloir bidouiller.

Hors ligne

#5 Le 20/10/2021, à 14:36

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Suite...

Voici les différents script:

=========================
Fichier scantoemail.sh
=========================

#! /bin/bash
# scantoemail
#
SENDMAIL="$(which sendmail   2> /dev/null)"
if [ "$SENDMAIL" = '' ];then
    SENDMAIL="/usr/sbin/sendmail"
fi
if [ ! -e $SENDMAIL ];then
    echo "\sendmail is not available."
fi
#-----------------------
debug_log=''
sendmail_disable='no'
sendmail_log='0'
#-----------------------

FILENAME=brscan_skey.tif



mkdir -p ~/brscan
sleep 0.2

if [ -e ~/.brscan-skey/scantoemail.config ];then
   source ~/.brscan-skey/scantoemail.config
elif [ -e /etc//opt/brother/scanner/brscan-skey/scantoemail.config ];then
   source /etc//opt/brother/scanner/brscan-skey/scantoemail.config
fi



SCANIMAGE="/opt/brother/scanner/brscan-skey/skey-scanimage"
OUTPUT=~/brscan/brscan_"$(date +%Y-%m-%d-%H-%M-%S)".tif
OPT_OTHER=""



if [ "$resolution" != '' ];then
   OPT_RESO="--resolution $resolution" 
else
   OPT_RESO="--resolution 100" 
fi

if [ "$source" != '' ];then
   OPT_SRC="--source $source" 
else
   OPT_SRC="--source FB" 
fi

if [ "$size" != '' ];then
   OPT_SIZE="--size $size" 
else
   OPT_SIZE="--size A4" 
fi

if [ "$duplex" = 'ON' ];then
   OPT_DUP="--duplex"
   OPT_SRC="--source ADF_C" 
else
   OPT_DUP=""
fi
OPT_FILE="--outputfile  $OUTPUT"

OPT_DEV="--device-name $1"

OPT="$OPT_DEV $OPT_RESO $OPT_SRC $OPT_SIZE $OPT_DUP $OPT_OTHER $OPT_FILE"

if [ "$(echo "$1" | grep net)" != '' ];then
    sleep 1
fi

#echo  "$SCANIMAGE $OPT" 
$SCANIMAGE $OPT

if [ ! -e "$OUTPUT" ];then
   sleep 1
   $SCANIMAGE $OPT
fi

FLABEL='^FROM'
TLABEL='^TO'
CLABEL='^CC'
BLABEL='^BCC'
MLABEL='^MESSAGE'
SLABEL='^SUBJECT'

CONF=~/.brscan-skey/'brscan_mail.config'
if [ ! -e $CONF ];then
  CONF=/etc//opt/brother/scanner/brscan-skey/'brscan_mail.config'
fi

if [ "$DEBUG" = '' ];then
    DEBUG="$(grep 'DEBUG=1' $CONF)"
fi
if [ "$DEBUG" != '' ];then
  if [ "$sendmail_disable" = 'no' ];then
    sendmail_disable='verbose'
  fi
fi

FADR=$(grep "${FLABEL}="  $CONF | sed s/"${FLABEL}="//g) 
TADR=$(grep "${TLABEL}="  $CONF | sed s/"${TLABEL}="//g) 
CADR=$(grep "${CLABEL}="  $CONF | sed s/"${CLABEL}="//g) 
BADR=$(grep "${BLABEL}="  $CONF | sed s/"${BLABEL}="//g) 
MSGT=$(grep "${MLABEL}="  $CONF | sed s/"${MLABEL}="//g) 

if [ "$MSGT" != '' ];then
    MESG=$MSGT
    if [ ! -e "$MESG" ];then
	MESG=~/.brscan-skey/"$MSGT"
	if [ ! -e "$MESG" ];then
	    MESG=/etc//opt/brother/scanner/brscan-skey/"$MSGT"
	fi
    fi
else
    MESG="''"
fi
SUBJECT="$(grep ${SLABEL}=  $CONF | sed s/${SLABEL}=//g)" 

if [ "$3" != '' ];then
    #TADR="$(echo "$3" | sed -e s/:.*$//)"
    TADR=${3//":.*$"//}
fi


if [ "$TADR" = '' ] || [ ${#TADR} -gt 256 ];then
    echo "E-mail Address Error:"
    echo "   E-mail address setting is not valid."
    echo "   E-mail address is not defined or the setting"
    echo "   might be larger than 256 characters."
    exit 0;
fi

if [ "$FADR" = '' ];then
    FADR=$(whoami | sed s/" .*$"//g)
fi
if [ "$FADR" = '' ];then
    FADR="''"
fi

if [ "$FILENAME" = '' ];then
    FILENAME="''"
fi

command_line="$SENDMAIL -t $TADR"

case "$sendmail_log" in
    "0") email_debug_option='';;
    "1") email_debug_option='--debug-mode L';command_line="cat";;
    "2") email_debug_option='--debug-mode M';command_line="cat";;
    "4") email_debug_option='--debug-mode H';command_line="cat";;
    "5") email_debug_option='--debug-mode l';command_line="cat";;
    "6") email_debug_option='--debug-mode m';command_line="cat";;
    "3") email_debug_option='--debug-mode h';command_line="cat";;
    *  ) email_debug_option='';;
esac

if [ $sendmail_disable = 'yes' ];then
    command_line="head  -6";
elif [ $sendmail_disable = 'verbose' ];then
    command_line="cat";
fi

if [ -e "/opt/brother/scanner/brscan-skey/brscan_scantoemail" ];then
      if [ "$debug_log" != '' ];then
	log=/tmp/brother_brscanskey_scantoemail.log
	echo -----------------------------
	echo /opt/brother/scanner/brscan-skey/brscan_scantoemail \
	    -t "$TADR" \
	    -r "$FADR" \
	    -c "$CADR" \
	    -b "$BADR" \
	    -f "$FILENAME" \
	    -M "$MESG" \
	    -S "$SUBJECT" \
	    "$OUTPUT"  \|  $command_line
	echo "to  : $TADR"
	echo "from: $FADR"
	echo "cc  : $CC"
	echo "bcc : $BCC"
	echo "subject: $SUBJECT"
	echo "name: $FILENAME"
	echo "img : $OUTPUT"
	echo -----------------------------
     fi
     /opt/brother/scanner/brscan-skey/brscan_scantoemail \
	-t "$TADR" \
	-r "$FADR" \
	-c "$CADR" \
	-b "$BADR" \
	-f "$FILENAME" \
	-M "$MESG" \
	-S "$SUBJECT" \
        $email_debug_option \
	"$OUTPUT"    |  $command_line

     if [ "$log" != '' ];then
	touch $log
	echo "-----------------------------" ;\
	echo "to  : $TADR"                  ;\
	echo "from: $FADR"                  ;\
	echo "cc  : $CC"                    ;\
	echo "bcc : $BCC"                   ;\
	echo "subject: $SUBJECT"            ;\
	echo "name: $FILENAME"              ;\
	echo "mesg: $MESG"                  ;\
	echo "img : $OUTPUT"                >> $log
     fi

else
    echo ERROR: /opt/brother/scanner/brscan-skey/brscan_scantoemail \
	-t "$TADR" \
	-r "$FADR" \
	-f "$FILENAME" \
	-M "$MESG" \
	"$OUTPUT"  \| "$command_line"
fi

sleep 2
rm -f "$OUTPUT"

=========================
Fichier scantofile.sh
=========================

#! /bin/bash
# scantofile
#
mkdir -p ~/brscan
sleep 0.2

if [ -e ~/.brscan-skey/scantofile.config ];then
   source ~/.brscan-skey/scantofile.config
elif [ -e /etc//opt/brother/scanner/brscan-skey/scantofile.config ];then
   source /etc//opt/brother/scanner/brscan-skey/scantofile.config
fi



SCANIMAGE="/opt/brother/scanner/brscan-skey/skey-scanimage"
OUTPUT=~/brscan/brscan_"$(date +%Y-%m-%d-%H-%M-%S)".tif
OPT_OTHER=""



if [ "$resolution" != '' ];then
   OPT_RESO="--resolution $resolution" 
else
   OPT_RESO="--resolution 100" 
fi

if [ "$source" != '' ];then
   OPT_SRC="--source $source" 
else
   OPT_SRC="--source FB" 
fi

if [ "$size" != '' ];then
   OPT_SIZE="--size $size" 
else
   OPT_SIZE="--size A4" 
fi

if [ "$duplex" = 'ON' ];then
   OPT_DUP="--duplex"
   OPT_SRC="--source ADF_C" 
else
   OPT_DUP=""
fi
OPT_FILE="--outputfile  $OUTPUT"

OPT_DEV="--device-name $1"

OPT="$OPT_DEV $OPT_RESO $OPT_SRC $OPT_SIZE $OPT_DUP $OPT_OTHER $OPT_FILE"

if [ "$(echo "$1" | grep net)" != '' ];then
    sleep 1
fi

#echo  "$SCANIMAGE $OPT" 
$SCANIMAGE $OPT

if [ ! -e "$OUTPUT" ];then
   sleep 1
   $SCANIMAGE $OPT
fi

echo "$OUTPUT" is created.

=========================
Fichier scantoimage.sh
=========================

#! /bin/bash
# scantoimage
#
mkdir -p ~/brscan
sleep 0.2

if [ -e ~/.brscan-skey/scantoimage.config ];then
   source ~/.brscan-skey/scantoimage.config
elif [ -e /etc//opt/brother/scanner/brscan-skey/scantoimage.config ];then
   source /etc//opt/brother/scanner/brscan-skey/scantoimage.config
fi



SCANIMAGE="/opt/brother/scanner/brscan-skey/skey-scanimage"
OUTPUT=~/brscan/brscan_"$(date +%Y-%m-%d-%H-%M-%S)".tif
OPT_OTHER=""



if [ "$resolution" != '' ];then
   OPT_RESO="--resolution $resolution" 
else
   OPT_RESO="--resolution 100" 
fi

if [ "$source" != '' ];then
   OPT_SRC="--source $source" 
else
   OPT_SRC="--source FB" 
fi

if [ "$size" != '' ];then
   OPT_SIZE="--size $size" 
else
   OPT_SIZE="--size A4" 
fi

if [ "$duplex" = 'ON' ];then
   OPT_DUP="--duplex"
   OPT_SRC="--source ADF_C" 
else
   OPT_DUP=""
fi
OPT_FILE="--outputfile  $OUTPUT"

OPT_DEV="--device-name $1"

OPT="$OPT_DEV $OPT_RESO $OPT_SRC $OPT_SIZE $OPT_DUP $OPT_OTHER $OPT_FILE"

if [ "$(echo "$1" | grep net)" != '' ];then
    sleep 1
fi

#echo  "$SCANIMAGE $OPT" 
$SCANIMAGE $OPT

if [ ! -e "$OUTPUT" ];then
   sleep 1
   $SCANIMAGE $OPT
fi

sleep 1
if [ "$(which evince 2>/dev/null)" != '' ];then
  APL=evince
elif   [ "$(which okular 2>/dev/null)" != '' ];then
  APL=okular
elif   [ "$(which xreader 2>/dev/null)" != '' ];then
  APL=xreader
elif   [ "$(which libreoffice 2>/dev/null)" != '' ];then
  APL=libreoffice
elif   [ "$(which atril 2>/dev/null)" != '' ];then
  APL=atril
elif   [ "$(which eom 2>/dev/null)" != '' ];then
  APL=eom
else
  APL=gimp
fi
echo "$APL $OUTPUT  2>/dev/null" \;sleep 2\;rm -f "$OUTPUT" | bash &

=========================
Fichier scantoocr.sh
=========================

#! /bin/bash
# scantoocr
#
mkdir -p ~/brscan
sleep 0.2

if [ -e ~/.brscan-skey/scantoocr.config ];then
   source ~/.brscan-skey/scantoocr.config
elif [ -e /etc//opt/brother/scanner/brscan-skey/scantoocr.config ];then
   source /etc//opt/brother/scanner/brscan-skey/scantoocr.config
fi



SCANIMAGE="/opt/brother/scanner/brscan-skey/skey-scanimage"
OUTPUT=~/brscan/brscan_"$(date +%Y-%m-%d-%H-%M-%S)".tif
OPT_OTHER=""



if [ "$resolution" != '' ];then
   OPT_RESO="--resolution $resolution" 
else
   OPT_RESO="--resolution 100" 
fi

if [ "$source" != '' ];then
   OPT_SRC="--source $source" 
else
   OPT_SRC="--source FB" 
fi

if [ "$size" != '' ];then
   OPT_SIZE="--size $size" 
else
   OPT_SIZE="--size A4" 
fi

if [ "$duplex" = 'ON' ];then
   OPT_DUP="--duplex"
   OPT_SRC="--source ADF_C" 
else
   OPT_DUP=""
fi
OPT_FILE="--outputfile  $OUTPUT"

OPT_DEV="--device-name $1"

OPT="$OPT_DEV $OPT_RESO $OPT_SRC $OPT_SIZE $OPT_DUP $OPT_OTHER $OPT_FILE"

if [ "$(echo "$1" | grep net)" != '' ];then
    sleep 1
fi

#echo  "$SCANIMAGE $OPT" 
$SCANIMAGE $OPT

if [ ! -e "$OUTPUT" ];then
   sleep 1
   $SCANIMAGE $OPT
fi

#if [ "" != "" ];then
#  cuneiform "" -o  "".txt
#  echo  "".txt is created.
#else
#  echo "cuneiform is required."
#fi

Hors ligne

#6 Le 20/10/2021, à 15:02

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

abelthorne a écrit :

Il y a des infos potentielles chez Brother : https://support.brother.com/g/b/faqend. … 100611_000 (ce n'est pas forcément pour
Je ne sais pas ce que tu as trouvé comme fichier à la base mais si on part du principe que c'est le script scantofile qui est utilisé dans ton cas, il se trouve apparemment là : /usr/local/Brother/sane/script/scantofile-0.2.0-1.sh
Donne son contenu :

cat /usr/local/Brother/sane/script/scantofile-0.2.0-1.sh

Note : le numéro de version ne sera pas forcément le même de ton côté ; si le fichier n'existe pas, regarde dans /usr/local/Brother/sane/script ce qu'il y a.

Il n'y a rien dans /usr/local/Brother/sane/script/scantofile-0.2.0-1.sh, le dossier Brother dans local n'existe même pas !
Après les scripts lancent directement des petites applications d'un trentaine de Ko, qu'il est impossible de modifier sans avoir les sources.
Ce sont probablement dans ces applications qu'est encré dans le marbre le format de sortie, ce serait pourtant si pratique d'avoir un fichier de configuration.
D'un autre côté il est probablement normal que Brother ait choisi le format TIFF pour les numérisations, c'est un format d'images parmi les plus courant non compressé.

abelthorne a écrit :

En tout cas, je ne trouve pas de doc sur les options utilisables dans le fichier de config mais les solutions aux divers problèmes similaires impliquent de convertir l'image scannée en PDF via des applis diverses, ce qui me fait penser qu'on ne peut pas exporter directement en PDF, il va falloir bidouiller.

Mon intention n'est pas de convertir les fichiers après numérisation.
C'est simplement que j'avais aperçu .tif dans le script, qui m'avais fait penser que c'était modifiable, je pense que la messe est dite. tongue
Je continuerais à scanner depuis le PC pour les .pdf, Sous Windows le scan direct depuis le scanner est bien en .pdf

Je n'ai pas très bien compris ce que signifie cette ligne "source" ?

# source=FB,ADF_L,ADF_C
source=FB

C'est configuré actuellement sur "FB" mais il est possible d'indiquer "ADF_L" ou "ADF_C" ?

Merci encore pour ton intervention. wink

Dernière modification par Caille (Le 21/10/2021, à 10:07)

Hors ligne

#7 Le 20/10/2021, à 15:20

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Caille a écrit :

Mon intention n'est pas de convertir les fichiers après numérisation.
C'est simplement que j'avais aperçu .tif dans le script, qui m'avais fait penser que c'était modifiable, je pense que la messe est dite. tongue

Quand tu scannes en PDF avec un autre soft, il y a de toute façon une "conversion". Ou plutôt une encapsulation, le format PDF n'est pas un format d'image. Ton soft scanne un document pour générer un format d'image (vraisemblablement TIFF aussi) mais au lieu de l'enregistrer, il l'encapsule dans un PDF et c'est ce dernier qu'il enregistre.

Et donc, l'idée, ce serait de modifier le script pou qu'il fasse la même chose : au lieu d'enregistrer l'image générée, la mettre dans un PDF et enregistrer celui-ci à la place. Mais ça nécessiterait une appli externe pour le faire (par exemple convert qui fait partie d'ImageMagick et qui est installé par défaut sur Ubuntu il me semble).

Hors ligne

#8 Le 20/10/2021, à 15:51

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

abelthorne a écrit :

Et donc, l'idée, ce serait de modifier le script pour qu'il fasse la même chose : au lieu d'enregistrer l'image générée, la mettre dans un PDF et enregistrer celui-ci à la place. Mais ça nécessiterait une appli externe pour le faire (par exemple convert qui fait partie d'ImageMagick et qui est installé par défaut sur Ubuntu il me semble).

Oui, c'est cela que je cherche à faire !
Mais que le fichier soit automatiquement converti en .PDF, comme ça ce passe directement depuis Windows qui n'enregistre jamais le fichier TIFF !

Hors ligne

#9 Le 20/10/2021, à 16:07

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Essaie d'éditer le script scantofile.sh et d'ajouter la ligne suivante tout à la fin :

convert "$OUTPUT" -compress zip -quality 100 "${OUTPUT%.tif}.pdf"

puis lance un scan.

Je ne suis pas tout à fait sûr de la syntaxe et des options mais :
1) est-ce que ça te génère bien un PDF (en plus du TIFF) ?
2) est-ce qu'il reste dans une taille raisonnable par rapport au TIFF ?

Hors ligne

#10 Le 20/10/2021, à 16:13

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Il y a aussi le fichier scantoimage.sh qui peut--être concerné ?

Hors ligne

#11 Le 20/10/2021, à 16:17

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

abelthorne a écrit :

Essaie d'éditer le script scantofile.sh et d'ajouter la ligne suivante tout à la fin :

convert "$OUTPUT" -compress zip -quality 100 "${OUTPUT%.tif}.pdf"

puis lance un scan.

Je ne suis pas tout à fait sûr de la syntaxe et des options mais :
1) est-ce que ça te génère bien un PDF (en plus du TIFF) ?
2) est-ce qu'il reste dans une taille raisonnable par rapport au TIFF ?

En réponse j'ai un fichier texte vide (zéro octet) avec l'extension .PDF et aussi un fichier TIFF.

Dernière modification par Caille (Le 20/10/2021, à 16:18)

Hors ligne

#12 Le 20/10/2021, à 16:21

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Je ne pense pas que scantoimage soit concerné. D'autant que s'il te génère bien un fichier PDF (même vide), c'est qu'a priori on a le bon script. Maintenant, va falloir trouver pourquoi il génère un fichier vide.

Le fichier .pdf a bien le même nom que le fichier .tif à part l'extension ?
Si tu tapes convert dans un terminal, il te donne bien une liste d'option, il ne te dit pas que la commande est introuvable ?

Le problème, c'est peut-être qu'il lance la commande convert avant que le fichier TIFF soit effectivement généré. Dans ce cas-là, je ne suis pas sûr qu'il y ait vraiment de solution, vu qu'on ne peut pas avoir de retour sur la génération du fichier avant de lancer convert...

Dernière modification par abelthorne (Le 20/10/2021, à 16:22)

Hors ligne

#13 Le 20/10/2021, à 16:24

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Oui il a exactement le même nom, sinon que l'extension est bien .PDF
Tu es probablement sur la bonne voie. wink
1634739790.png

abelthorne a écrit :

Si tu tapes convert dans un terminal, il te donne bien une liste d'option, il ne te dit pas que la commande est introuvable ?

Effectivement, il est bien présent dans mon Ubuntu.

caille@caille-N76VB:~$ convert
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib
Usage: convert-im6.q16 [options ...] file [ [options ...] file ...] [options ...] file

Image Settings:
  -adjoin              join images into a single multi-image file
  -affine matrix       affine transform matrix
  -alpha option        activate, deactivate, reset, or set the alpha channel
  -antialias           remove pixel-aliasing
  -authenticate password
                       decipher image with this password
  -attenuate value     lessen (or intensify) when adding noise to an image
  -background color    background color
  -bias value          add bias when convolving an image
  -black-point-compensation
                       use black point compensation
  -blue-primary point  chromaticity blue primary point
  -bordercolor color   border color
  -caption string      assign a caption to an image
  -channel type        apply option to select image channels
  -clip-mask filename  associate a clip mask with the image
  -colors value        preferred number of colors in the image
  -colorspace type     alternate image colorspace
  -comment string      annotate image with comment
  -compose operator    set image composite operator
  -compress type       type of pixel compression when writing the image
  -define format:option
                       define one or more image format options
  -delay value         display the next image after pausing
  -density geometry    horizontal and vertical density of the image
  -depth value         image depth
  -direction type      render text right-to-left or left-to-right
  -display server      get image or font from this X server
  -dispose method      layer disposal method
  -dither method       apply error diffusion to image
  -encoding type       text encoding type
  -endian type         endianness (MSB or LSB) of the image
  -family name         render text with this font family
  -fill color          color to use when filling a graphic primitive
  -filter type         use this filter when resizing an image
  -font name           render text with this font
  -format "string"     output formatted image characteristics
  -fuzz distance       colors within this distance are considered equal
  -gravity type        horizontal and vertical text placement
  -green-primary point chromaticity green primary point
  -intensity method    method to generate intensity value from pixel
  -intent type         type of rendering intent when managing the image color
  -interlace type      type of image interlacing scheme
  -interline-spacing value
                       set the space between two text lines
  -interpolate method  pixel color interpolation method
  -interword-spacing value
                       set the space between two words
  -kerning value       set the space between two letters
  -label string        assign a label to an image
  -limit type value    pixel cache resource limit
  -loop iterations     add Netscape loop extension to your GIF animation
  -mask filename       associate a mask with the image
  -matte               store matte channel if the image has one
  -mattecolor color    frame color
  -moments             report image moments
  -monitor             monitor progress
  -orient type         image orientation
  -page geometry       size and location of an image canvas (setting)
  -ping                efficiently determine image attributes
  -pointsize value     font point size
  -precision value     maximum number of significant digits to print
  -preview type        image preview type
  -quality value       JPEG/MIFF/PNG compression level
  -quiet               suppress all warning messages
  -red-primary point   chromaticity red primary point
  -regard-warnings     pay attention to warning messages
  -remap filename      transform image colors to match this set of colors
  -repage geometry     size and location of an image canvas
  -respect-parentheses settings remain in effect until parenthesis boundary
  -sampling-factor geometry
                       horizontal and vertical sampling factor
  -scene value         image scene number
  -seed value          seed a new sequence of pseudo-random numbers
  -size geometry       width and height of image
  -stretch type        render text with this font stretch
  -stroke color        graphic primitive stroke color
  -strokewidth value   graphic primitive stroke width
  -style type          render text with this font style
  -support factor      resize support: > 1.0 is blurry, < 1.0 is sharp
  -synchronize         synchronize image to storage device
  -taint               declare the image as modified
  -texture filename    name of texture to tile onto the image background
  -tile-offset geometry
                       tile offset
  -treedepth value     color tree depth
  -transparent-color color
                       transparent color
  -undercolor color    annotation bounding box color
  -units type          the units of image resolution
  -verbose             print detailed information about the image
  -view                FlashPix viewing transforms
  -virtual-pixel method
                       virtual pixel access method
  -weight type         render text with this font weight
  -white-point point   chromaticity white point

Image Operators:
  -adaptive-blur geometry
                       adaptively blur pixels; decrease effect near edges
  -adaptive-resize geometry
                       adaptively resize image using 'mesh' interpolation
  -adaptive-sharpen geometry
                       adaptively sharpen pixels; increase effect near edges
  -alpha option        on, activate, off, deactivate, set, opaque, copy
                       transparent, extract, background, or shape
  -annotate geometry text
                       annotate the image with text
  -auto-gamma          automagically adjust gamma level of image
  -auto-level          automagically adjust color levels of image
  -auto-orient         automagically orient (rotate) image
  -bench iterations    measure performance
  -black-threshold value
                       force all pixels below the threshold into black
  -blue-shift factor   simulate a scene at nighttime in the moonlight
  -blur geometry       reduce image noise and reduce detail levels
  -border geometry     surround image with a border of color
  -bordercolor color   border color
  -brightness-contrast geometry
                       improve brightness / contrast of the image
  -canny geometry      detect edges in the image
  -cdl filename        color correct with a color decision list
  -charcoal radius     simulate a charcoal drawing
  -chop geometry       remove pixels from the image interior
  -clamp               keep pixel values in range (0-QuantumRange)
  -clip                clip along the first path from the 8BIM profile
  -clip-path id        clip along a named path from the 8BIM profile
  -colorize value      colorize the image with the fill color
  -color-matrix matrix apply color correction to the image
  -connected-components connectivity
                       connected-components uniquely labeled
  -contrast            enhance or reduce the image contrast
  -contrast-stretch geometry
                       improve contrast by `stretching' the intensity range
  -convolve coefficients
                       apply a convolution kernel to the image
  -cycle amount        cycle the image colormap
  -decipher filename   convert cipher pixels to plain pixels
  -deskew threshold    straighten an image
  -despeckle           reduce the speckles within an image
  -distort method args
                       distort images according to given method ad args
  -draw string         annotate the image with a graphic primitive
  -edge radius         apply a filter to detect edges in the image
  -encipher filename   convert plain pixels to cipher pixels
  -emboss radius       emboss an image
  -enhance             apply a digital filter to enhance a noisy image
  -equalize            perform histogram equalization to an image
  -evaluate operator value
                       evaluate an arithmetic, relational, or logical expression
  -extent geometry     set the image size
  -extract geometry    extract area from image
  -features distance   analyze image features (e.g. contrast, correlation)
  -fft                 implements the discrete Fourier transform (DFT)
  -flip                flip image vertically
  -floodfill geometry color
                       floodfill the image with color
  -flop                flop image horizontally
  -frame geometry      surround image with an ornamental border
  -function name parameters
                       apply function over image values
  -gamma value         level of gamma correction
  -gaussian-blur geometry
                       reduce image noise and reduce detail levels
  -geometry geometry   preferred size or location of the image
  -grayscale method    convert image to grayscale
  -hough-lines geometry
                       identify lines in the image
  -identify            identify the format and characteristics of the image
  -ift                 implements the inverse discrete Fourier transform (DFT)
  -implode amount      implode image pixels about the center
  -interpolative-resize geometry
                       resize image using 'point sampled' interpolation
  -kuwahara geometry   edge preserving noise reduction filter
  -lat geometry        local adaptive thresholding
  -level value         adjust the level of image contrast
  -level-colors color,color
                       level image with the given colors
  -linear-stretch geometry
                       improve contrast by `stretching with saturation'
  -liquid-rescale geometry
                       rescale image with seam-carving
  -local-contrast geometry
                       enhance local contrast
  -magnify             double the size of the image with pixel art scaling
  -mean-shift geometry delineate arbitrarily shaped clusters in the image
  -median geometry     apply a median filter to the image
  -mode geometry       make each pixel the 'predominant color' of the
                       neighborhood
  -modulate value      vary the brightness, saturation, and hue
  -monochrome          transform image to black and white
  -morphology method kernel
                       apply a morphology method to the image
  -motion-blur geometry
                       simulate motion blur
  -negate              replace every pixel with its complementary color 
  -noise geometry      add or reduce noise in an image
  -normalize           transform image to span the full range of colors
  -opaque color        change this color to the fill color
  -ordered-dither NxN
                       add a noise pattern to the image with specific
                       amplitudes
  -paint radius        simulate an oil painting
  -perceptible epsilon
                       pixel value less than |epsilon| become epsilon or
                       -epsilon
  -polaroid angle      simulate a Polaroid picture
  -posterize levels    reduce the image to a limited number of color levels
  -profile filename    add, delete, or apply an image profile
  -quantize colorspace reduce colors in this colorspace
  -radial-blur angle   radial blur the image (deprecated use -rotational-blur
  -raise value         lighten/darken image edges to create a 3-D effect
  -random-threshold low,high
                       random threshold the image
  -region geometry     apply options to a portion of the image
  -render              render vector graphics
  -resample geometry   change the resolution of an image
  -resize geometry     resize the image
  -roll geometry       roll an image vertically or horizontally
  -rotate degrees      apply Paeth rotation to the image
  -rotational-blur angle
                       rotational blur the image
  -sample geometry     scale image with pixel sampling
  -scale geometry      scale the image
  -segment values      segment an image
  -selective-blur geometry
                       selectively blur pixels within a contrast threshold
  -sepia-tone threshold
                       simulate a sepia-toned photo
  -set property value  set an image property
  -shade degrees       shade the image using a distant light source
  -shadow geometry     simulate an image shadow
  -sharpen geometry    sharpen the image
  -shave geometry      shave pixels from the image edges
  -shear geometry      slide one edge of the image along the X or Y axis
  -sigmoidal-contrast geometry
                       increase the contrast without saturating highlights or
                       shadows
  -sketch geometry     simulate a pencil sketch
  -solarize threshold  negate all pixels above the threshold level
  -sparse-color method args
                       fill in a image based on a few color points
  -splice geometry     splice the background color into the image
  -spread radius       displace image pixels by a random amount
  -statistic type geometry
                       replace each pixel with corresponding statistic from the
                       neighborhood
  -strip               strip image of all profiles and comments
  -swirl degrees       swirl image pixels about the center
  -threshold value     threshold the image
  -thumbnail geometry  create a thumbnail of the image
  -tile filename       tile image when filling a graphic primitive
  -tint value          tint the image with the fill color
  -transform           affine transform image
  -transparent color   make this color transparent within the image
  -transpose           flip image vertically and rotate 90 degrees
  -transverse          flop image horizontally and rotate 270 degrees
  -trim                trim image edges
  -type type           image type
  -unique-colors       discard all but one of any pixel color
  -unsharp geometry    sharpen the image
  -vignette geometry   soften the edges of the image in vignette style
  -wave geometry       alter an image along a sine wave
  -wavelet-denoise threshold
                       removes noise from the image using a wavelet transform
  -white-threshold value
                       force all pixels above the threshold into white

Image Sequence Operators:
  -append              append an image sequence
  -clut                apply a color lookup table to the image
  -coalesce            merge a sequence of images
  -combine             combine a sequence of images
  -compare             mathematically and visually annotate the difference between an image and its reconstruction
  -complex operator    perform complex mathematics on an image sequence
  -composite           composite image
  -copy geometry offset
                       copy pixels from one area of an image to another
  -crop geometry       cut out a rectangular region of the image
  -deconstruct         break down an image sequence into constituent parts
  -evaluate-sequence operator
                       evaluate an arithmetic, relational, or logical expression
  -flatten             flatten a sequence of images
  -fx expression       apply mathematical expression to an image channel(s)
  -hald-clut           apply a Hald color lookup table to the image
  -layers method       optimize, merge, or compare image layers
  -morph value         morph an image sequence
  -mosaic              create a mosaic from an image sequence
  -poly terms          build a polynomial from the image sequence and the corresponding
                       terms (coefficients and degree pairs).
  -print string        interpret string and print to console
  -process arguments   process the image with a custom image filter
  -separate            separate an image channel into a grayscale image
  -smush geometry      smush an image sequence together
  -write filename      write images to this file

Image Stack Operators:
  -clone indexes       clone an image
  -delete indexes      delete the image from the image sequence
  -duplicate count,indexes
                       duplicate an image one or more times
  -insert index        insert last image into the image sequence
  -reverse             reverse image sequence
  -swap indexes        swap two images in the image sequence

Miscellaneous Options:
  -debug events        display copious debugging information
  -distribute-cache port
                       distributed pixel cache spanning one or more servers
  -help                print program options
  -list type           print a list of supported option arguments
  -log format          format of debugging information
  -version             print version information

By default, the image format of `file' is determined by its magic
number.  To specify a particular image format, precede the filename
with an image format name and a colon (i.e. ps:image) or specify the
image type as the filename suffix (i.e. image.ps).  Specify 'file' as
'-' for standard input or output.
caille@caille-N76VB:~$ 

Dernière modification par Caille (Le 21/10/2021, à 09:10)

Hors ligne

#14 Le 20/10/2021, à 16:29

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

On va essayer un truc pour vérifier mon hypothèse. Avant la commande convert, rajoute une ligne avec un temps d'attente :

sleep 30

Ça va lui dire d'attendre 30 secondes avant de lancer convert. Ça devrait être suffisant (espérons) pour qu'il génère le TIFF. Et donc, attends 30 secondes après la fin du scan pour voir s'il génère le fichier PDF.

Si ça fonctionne comme ça, il faudra faire des tests pour baisser le temps d'attente mais je ne vois pas vraiment d'autre possibilité que d'en mettre un.

Hors ligne

#15 Le 20/10/2021, à 16:35

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Le pseudo fichier .PDF est bien arrivé au bout de 30 secondes environ, mais il fait toujours zéro octet.

Hors ligne

#16 Le 20/10/2021, à 16:39

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Le TIFF fait quelle taille ?

Hors ligne

#17 Le 20/10/2021, à 16:44

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Le TIFF a toujours la même taille (poids). 2,8 MB (2803118 octets)

Dernière modification par Caille (Le 20/10/2021, à 16:46)

Hors ligne

#18 Le 20/10/2021, à 16:49

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Ça ne devrait pas lui prendre énormément de temps de générer un fichier de cette taille. Après, je ne sais pas à quel moment le processus de brscan rend la main pour passer à la commande suivante.

Autre possibilité : c'est la compression ZIP qui prend un peu de temps et quand tu vérifies le PDF, il n'a pas encore été complètement généré, d'où la taille de 0. Si tu attends un peu, il reste vide ? Ou en virant la compression ?

convert "$OUTPUT" -quality 100 "${OUTPUT%.tif}.pdf"

Hors ligne

#19 Le 20/10/2021, à 16:56

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Aucun fichier PDF n'augment de poids même après plusieurs minutes.
Rien ne change, j'ai laissé la temporisation.
Petite information peut-être utile, après le scan le multifonction me demande si il y a une autre page à scanner oui ou non, j'ai à chaque fois répondu non.
Si je répond oui, je pense qu'il fera un nouveau TIFF ?

Ah non, il fait un fichier TIFF à plusieurs pages 5,6 MB (5606228 octets).

Dernière modification par Caille (Le 20/10/2021, à 17:04)

Hors ligne

#20 Le 20/10/2021, à 17:09

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Au vu de l'exemple donné sur le site de Brother, je pense que le soft de scan rend la main après avoir généré le TIFF. Du coup, je ne comprends pas bien ce qui coince.

On va essayer des manips pour voir à quel moment ça coince. D'abord, supprime les commandes sleep et convert du script. À la place, essaie d'ouvrir l'image générée avec GIMP (si tu l'as d'installé) :

gimp "$OUTPUT"

Est-ce qu'il l'ouvre correctement ? Si non, qu'est-ce qu'il dit exactement ?

D'autre part, on va essayer de convertir manuellement une image scannée que tu as dans ~/brscan pour voir si ça fonctionne :

cd ~/brscan
convert brscan_2021-10-20-16-15-15.tif -compress zip -quality 100 test.pdf

(Si le nom du fichier TIFF a changé depuis ta capture, adapte la commande.)

Est-ce qu'il génère un fichier test.pdf valide ou tu as une erreur ?

Hors ligne

#21 Le 20/10/2021, à 17:19

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

J'ai donc tapé cette commande dans le terminal ?

caille@caille-N76VB:~$ gimp "$OUTPUT"
Gtk-Message: 17:14:44.850: Failed to load module "canberra-gtk-module"

Gimp c'est ouvert avec une fenêtre d'erreur.
1634743053.png

Dans mon dossier brscan (dossier personnel) j'ai maintenant un fichier "test.pdf" vide ?

La ligne de commande ne c'est toujours pas fermée.

=======================================================

caille@caille-N76VB:~$ cd ~/brscan
caille@caille-N76VB:~/brscan$ convert brscan_2021-10-20-16-15-15.tif -compress zip -quality 100 test.pdf
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
caille@caille-N76VB:~/brscan$

Avec le dernier N° de fichier scanné :
caille@caille-N76VB:~/brscan$ convert brscan_2021-10-20-17-09-51.tif -compress zip -quality 100 test.pdf
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
caille@caille-N76VB:~/brscan$

Dernière modification par Caille (Le 21/10/2021, à 09:14)

Hors ligne

#22 Le 20/10/2021, à 17:27

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Je me suis peut-être mal fait comprendre : la commande gimp "$OUTPUT" serait à mettre dans le script, à la place des sleep et convert qu'on avait rajoutés précédemment. L'idée c'est de voir si à la fin du scan GIMP ouvre automatiquement l'image ou s'il dit qu'elle n'existe pas ou autre.

Il y a de toute façon un problème avec convert qui l'empêche de créer le PDF. C'est apparemment une limitation implémentée à cause d'une vulnérabilité dans GhostScript.
Donne le retour de :

gs --version
cat /etc/ImageMagick-6/policy.xml

Hors ligne

#23 Le 20/10/2021, à 17:28

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Ah autant pour moi. tongue

L'image s'ouvre bien dans Gimp, juste après avoir répondu "Non" pour une autre numérisation (dans le cas de plusieurs pages). wink
Et ceci sans aucune temporisation.

abelthorne a écrit :

Donne le retour de :

gs --version
cat /etc/ImageMagick-6/policy.xml
caille@caille-N76VB:~$ gs --version
9.50
caille@caille-N76VB:~$ cat /etc/ImageMagick-6/policy.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
  <!ELEMENT policymap (policy)+>
  <!ATTLIST policymap xmlns CDATA #FIXED ''>
  <!ELEMENT policy EMPTY>
  <!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
    name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
    stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
]>
<!--
  Configure ImageMagick policies.

  Domains include system, delegate, coder, filter, path, or resource.

  Rights include none, read, write, execute and all.  Use | to combine them,
  for example: "read | write" to permit read from, or write to, a path.

  Use a glob expression as a pattern.

  Suppose we do not want users to process MPEG video images:

    <policy domain="delegate" rights="none" pattern="mpeg:decode" />

  Here we do not want users reading images from HTTP:

    <policy domain="coder" rights="none" pattern="HTTP" />

  The /repository file system is restricted to read only.  We use a glob
  expression to match all paths that start with /repository:

    <policy domain="path" rights="read" pattern="/repository/*" />

  Lets prevent users from executing any image filters:

    <policy domain="filter" rights="none" pattern="*" />

  Any large image is cached to disk rather than memory:

    <policy domain="resource" name="area" value="1GP"/>

  Define arguments for the memory, map, area, width, height and disk resources
  with SI prefixes (.e.g 100MB).  In addition, resource policies are maximums
  for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
  exceeds policy maximum so memory limit is 1GB).

  Rules are processed in order.  Here we want to restrict ImageMagick to only
  read or write a small subset of proven web-safe image types:

    <policy domain="delegate" rights="none" pattern="*" />
    <policy domain="filter" rights="none" pattern="*" />
    <policy domain="coder" rights="none" pattern="*" />
    <policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
-->
<policymap>
  <!-- <policy domain="system" name="shred" value="2"/> -->
  <!-- <policy domain="system" name="precision" value="6"/> -->
  <!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
  <!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
  <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
  <policy domain="resource" name="memory" value="256MiB"/>
  <policy domain="resource" name="map" value="512MiB"/>
  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
  <!-- <policy domain="resource" name="list-length" value="128"/> -->
  <policy domain="resource" name="area" value="128MB"/>
  <policy domain="resource" name="disk" value="1GiB"/>
  <!-- <policy domain="resource" name="file" value="768"/> -->
  <!-- <policy domain="resource" name="thread" value="4"/> -->
  <!-- <policy domain="resource" name="throttle" value="0"/> -->
  <!-- <policy domain="resource" name="time" value="3600"/> -->
  <!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
  <!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
  <!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
  <!-- <policy domain="path" rights="none" pattern="@*" /> -->
  <!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
  <!-- <policy domain="cache" name="synchronize" value="True"/> -->
  <!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
  <!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
  <!-- <policy domain="system" name="shred" value="2"/> -->
  <!-- <policy domain="system" name="precision" value="6"/> -->
  <!-- not needed due to the need to use explicitly by mvg: -->
  <!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
  <!-- use curl -->
  <policy domain="delegate" rights="none" pattern="URL" />
  <policy domain="delegate" rights="none" pattern="HTTPS" />
  <policy domain="delegate" rights="none" pattern="HTTP" />
  <!-- in order to avoid to get image with password text -->
  <policy domain="path" rights="none" pattern="@*"/>
  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="PS2" />
  <policy domain="coder" rights="none" pattern="PS3" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
</policymap>
caille@caille-N76VB:~$ 

Dernière modification par Caille (Le 21/10/2021, à 10:14)

Hors ligne

#24 Le 20/10/2021, à 17:31

abelthorne

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

Sinon, sans passer par ImageMagick, la doc du site mentionne tiff2pdf. On peut faire un test avec, ce sera peut-être plus pratique. Installe libtiff-tools :

sudo apt-get install libtiff-tools

Ensuite, essaie de convertir ton fichier :

cd ~/brscan
tiff2pdf -p A4 -o test.pdf brscan_2021-10-20-16-15-15.tif

Il va faire du format A4, je suppose que c'est celui de ton scanner ?

Hors ligne

#25 Le 20/10/2021, à 17:35

Caille

Re : [Résolu] Scan direct en .pdf avec MFC-L2720DW ?

J'obtiens bien un fichier PDF avec une très petite image (beaucoup de blanc autour) de mon scan. wink

Mon scanner est bien au format A4.

2,8 MB (2804073 octets)

1634744285.png

Dernière modification par Caille (Le 20/10/2021, à 17:40)

Hors ligne