|
|
| (Une version intermédiaire par le même utilisateur non affichée) |
| Ligne 842 : |
Ligne 842 : |
| <syntaxhighlight lang="bash">cat /var/log/syslog | ccze -o html > log.html</syntaxhighlight> | | <syntaxhighlight lang="bash">cat /var/log/syslog | ccze -o html > log.html</syntaxhighlight> |
|
| |
|
| == '''🧰 <code>pdftotext</code> ''' ==
| |
|
| |
| '''<code>pdftotext</code>''' est un outil en ligne de commande issu de la suite **Poppler**
| |
| permettant d’extraire le texte brut contenu dans un fichier PDF.
| |
| Il est très utilisé pour l’analyse, l’indexation, la recherche ou le traitement
| |
| automatisé de documents PDF.
| |
|
| |
| ------------------------------------------------------------------------
| |
|
| |
| === 📦 '''Installation de pdftotext''' ===
| |
| <syntaxhighlight lang="bash">
| |
| sudo apt install poppler-utils
| |
| </syntaxhighlight>
| |
|
| |
| -----
| |
|
| |
| === 🚀 '''Utilisation de base''' ===
| |
|
| |
| <ol style="list-style-type: decimal;">
| |
| <li><p>'''Extraire le texte vers un fichier''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext document.pdf</syntaxhighlight></li>
| |
| <li><p>'''Extraire le texte vers la sortie standard''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext document.pdf -</syntaxhighlight></li>
| |
| <li><p>'''Lire le texte directement avec <code>less</code>''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext document.pdf - | less</syntaxhighlight></li></ol>
| |
|
| |
|
| |
| -----
| |
| === 🔧 '''Options courantes''' ===
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| ! Option
| |
| ! Description
| |
| |-
| |
| | <code>-layout</code>
| |
| | Conserve la mise en page
| |
| |-
| |
| | <code>-raw</code>
| |
| | Extraction brute
| |
| |-
| |
| | <code>-f <n></code>
| |
| | Page de début
| |
| |-
| |
| | <code>-l <n></code>
| |
| | Page de fin
| |
| |-
| |
| | <code>-nopgbrk</code>
| |
| | Supprime les sauts de page
| |
| |-
| |
| | <code>-enc UTF-8</code>
| |
| | Force l’encodage
| |
| |-
| |
| | <code>-help</code>
| |
| | Aide complète
| |
| |}
| |
|
| |
|
| |
| -----
| |
|
| |
| === 💡 '''Exemples pratiques''' ===
| |
|
| |
| <ul>
| |
| <li><p>'''Extraire uniquement les pages 2 à 5''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext -f 2 -l 5 document.pdf</syntaxhighlight></li>
| |
| <li><p>'''Conserver la mise en page''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext -layout document.pdf</syntaxhighlight></li>
| |
| <li><p>'''Recherche rapide dans un PDF''' :</p>
| |
| <syntaxhighlight lang="bash">pdftotext document.pdf - | grep "mot"</syntaxhighlight></li></ul>
| |
|
| |
|
| |
| -----
| |
|
| |
| === 📌 '''Pourquoi utiliser pdftotext ?''' ===
| |
|
| |
| ✅ Extraction rapide du texte ✅ Outil léger et scriptable ✅ Parfait pour OCR / indexation ✅ Intégration facile dans des pipelines shell
| |
|
| |
| -----
| |
| == '''🧰 <code>qpdf</code> ''' ==
| |
|
| |
|
| |
| '''<code>QPDF</code>''' est un outil en ligne de commande permettant de manipuler,
| |
| inspecter et transformer des fichiers PDF.
| |
| Il est couramment utilisé pour le chiffrement, le déchiffrement,
| |
| la réparation et l’optimisation de PDF.
| |
|
| |
| ------------------------------------------------------------------------
| |
|
| |
| === 📦 '''Installation de qpdf''' ===
| |
| <syntaxhighlight lang="bash">
| |
| sudo apt install qpdf
| |
| </syntaxhighlight>
| |
|
| |
| -----
| |
|
| |
| === 🚀 '''Utilisation de base''' ===
| |
|
| |
| <ol style="list-style-type: decimal;">
| |
| <li><p>'''Déchiffrer un PDF protégé par mot de passe''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf --password=secret --decrypt input.pdf output.pdf</syntaxhighlight></li>
| |
| <li><p>'''Fusionner des PDF''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf --empty --pages a.pdf b.pdf -- output.pdf</syntaxhighlight></li>
| |
| <li><p>'''Inspecter la structure d’un PDF''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf --check document.pdf</syntaxhighlight></li></ol>
| |
|
| |
|
| |
| -----
| |
|
| |
| === 🔧 '''Options courantes''' ===
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| ! Option
| |
| ! Description
| |
| |-
| |
| | <code>--decrypt</code>
| |
| | Supprime la protection
| |
| |-
| |
| | <code>--encrypt</code>
| |
| | Chiffre un PDF
| |
| |-
| |
| | <code>--check</code>
| |
| | Vérifie l’intégrité
| |
| |-
| |
| | <code>--pages</code>
| |
| | Sélection de pages
| |
| |-
| |
| | <code>--linearize</code>
| |
| | Optimisation web
| |
| |-
| |
| | <code>--show-npages</code>
| |
| | Nombre de pages
| |
| |-
| |
| | <code>--help</code>
| |
| | Aide complète
| |
| |}
| |
|
| |
|
| |
| -----
| |
|
| |
| === 💡 '''Exemples pratiques''' ===
| |
|
| |
| <ul>
| |
| <li><p>'''Extraire certaines pages''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf input.pdf --pages input.pdf 1-5 -- output.pdf</syntaxhighlight></li>
| |
| <li><p>'''Optimiser un PDF pour le web''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf --linearize input.pdf output.pdf</syntaxhighlight></li>
| |
| <li><p>'''Afficher le nombre de pages''' :</p>
| |
| <syntaxhighlight lang="bash">qpdf --show-npages document.pdf</syntaxhighlight></li></ul>
| |
|
| |
|
| |
| -----
| |
|
| |
| === 📌 '''Pourquoi utiliser QPDF ?''' ===
| |
|
| |
| ✅ Manipulation PDF avancée ✅ Sécurisation et déchiffrement ✅ Très fiable pour l’automatisation ✅ Aucun rendu graphique nécessaire
| |
|
| |
| -----
| |
| == '''🧰 <code>ExifTool</code> ''' == | | == '''🧰 <code>ExifTool</code> ''' == |
|
| |
|
| Ligne 1 074 : |
Ligne 916 : |
|
| |
|
| ----- | | ----- |
|
| |
|
| |
|
| |
|
| [[Catégorie: Terminal Tools]] | | [[Catégorie: Terminal Tools]] |