Copyright © 2003-2005 Linbox / Free & ALter Soft
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
Historique des versions | ||
---|---|---|
Version 0.1 | 13/01/2003 | CD |
Première version | ||
Version 0.2 | 22/04/2003 | JyB |
Message d'erreur pour fichiers avec mot de passe | ||
Version 0.3.1 | 16/05/2003 | JyB |
Note sur l'option nombre de pages, ajout de la doc sur la configuration des imprimantes qui a changé. | ||
Version 0.3.2 | 19/04/2004 | CD |
Ajout des nouveaux codes d'erreurs du client. | ||
Version 0.4 | 06/07/2004 | CD |
Suppression des parties obsolètes de l'installation, ajout des dernières fonctionnalités du serveur. | ||
Version 0.4.1 | 04/10/2004 | DC |
Mise à jour doc avant publication, corrections typo, ajout des autres versions Windows testées. | ||
Version 0.4.2 | 27/12/2004 | CD |
Installation et utilisation de la partie cliente sous Windows. | ||
Version 0.4.3 | 08/02/2005 | DC |
Précisions mineures, correction typo. |
Table des matières
Table des matières
Linbox-Converter est un serveur de conversion de documents Microsoft Office conçu pour des clients Windows ou UNIX/Linux qui ne disposent pas des applications requises pour les lire.
Ces clients demandent au serveur Linbox-Converter de convertir des fichiers MS-Word, Excel et PowerPoint dans des formats qu'ils peuvent lire nativement: PDF, PostScript, HTML, Text, TIFF ou RTF.
Linbox-Converter permet d'effectuer des traitements automatiques sur des fichiers MS-Office tels que leur conversion automatique en PDF avant publication sur Intranet/Internet ou pour archivage dans un format ouvert pérenne.
Linbox/Free&ALter Soft est une Société de Service en Logiciels Libres (SSLL) pionnière. Depuis sa création en 1996, la raison d'être de Linbox/FAS réside dans sa capacité à intégrer à des systèmes informatiques hétérogènes, les solutions libres les plus standardisées comme les plus pointues. Les prestations proposées sont conseil, développement, portage (GNU/Linux, Irix, HP-UX, Solaris), intégration, formation, support, maintenance.
Le système est constitué de 2 parties :
un logiciel client installé sur les stations de travail,
un logiciel serveur sur un PC sous Windows NT, Windows 2000 ou Windows XP.
Le logiciel sur le client assure :
la transmission au serveur du fichier original,
la réception du fichier converti,
l'affichage par le visionneur adéquat du fichier ou le stockage dans un fichier (PDF, HTML, texte, RTF ou TIFF).
Ce logiciel est écrit en Python et fonctionne donc sur tous les systèmes d'exploitation où Python a été porté.
Le logiciel sur le serveur assure :
la réception des fichiers à convertir,
l'ouverture du fichier à convertir dans l'application MS-Office correspondante,
l'impression du fichier MS-Office dans un fichier postscript,
la transformation du postscript en PDF (ou en texte, HTML, TIFF, RTF),
l'envoi du fichier PDF (ou texte, HTML, TIFF, RTF) vers la station ayant envoyé le fichier original.
Ce logiciel est lui aussi écrit en Python. Les fonctions de conversion sont multithreadées, c'est-à-dire que le serveur peut convertir plusieurs fichiers en même temps. Le contrôle des applications MS-Office se fait via des appels COM (toujours en Python). La conversion entre PostScript et PDF se fait via la commande ps2pdf de Ghostscript.
Le serveur peut être installé sur Windows NT/2000/XP. MS-Office 2000 version Premium est recommandé. La conversion des fichiers MS-Word et Powerpoint fonctionne aussi avec MS-Office XP et MS-Office 2003, mais la conversion de fichiers Excel n'est pas supportée sur ces versions.
Voici un schéma résumant les différentes parties du Linbox-Converter ainsi que leurs rôles.
Principe du Linbox-Converter
Table des matières
Voici les pré-requis minimum pour le serveur :
Système d'exploitation : Windows NT 4.0 avec le Service Pack 5, ou Windows 2000/XP de base,
Mémoire vive : 256 Mo,
Processeur : 500 MHz,
Espace sur le disque dur : 1 Go. La conversion de fichiers dans certains formats (le TIFF par exemple) peut nécessiter la création de fichiers temporaires très volumineux,
Suite Microsoft Office : Microsoft Office 2000 Premium. Word, Excel et Powerpoint doivent être installés. La conversion des fichiers MS-Word et Powerpoint fonctionne aussi avec MS-Office XP et MS-Office 2003, mais la conversion de fichiers Excel n'est pas supportée sur ces versions.
On notera aussi que le serveur Linbox-Converter doit être lancé lors d'une session d'un utilisateur Windows. En effet, le pilotage des applications Microsoft Office semble nécessiter l'affichage de certaines fenêtres à l'écran.
Nous supposons installé le système d'exploitation et les logiciels de la suite Microsoft Office indiqués dans le pré-requis. Nous allons maintenant effectuer les manipulations suivantes :
Installation de Python,
Installation des scripts d'exécution du Linbox-Converter,
Installation de GNU GhostScript,
Installation des imprimantes PostScript,
Modification des fichiers de configuration du Linbox-Converter.
Voici la marche à suivre :
Installer Python à partir de l'installeur situé à l'URL suivante : http://www.python.org/ftp/python/2.3.3/Python-2.3.3.exe. Prendre toujours les chemins d'installations proposés par défaut, cocher "Yes, make backups", et sélectionner au moins dans la liste des composants à installer : "Python interpreter and libraries" et "Tcl/Tk (TKinter, IDLE, pydoc)",
Installer les extensions Windows pour Python à partir de l'installeur situé à l'URL suivante : http://aleron.dl.sourceforge.net/sourceforge/pywin32/pywin32-201.win32-py2.3.exe. Prendre toujours les chemins d'installation proposés par défaut. Cocher "Install Pythonwin as default editor for Python source".
Il faut maintenant générer quelques fichiers nécessaires au pilotage des applications Microsoft Office par Linbox-Converter :
Lancer PythonWin. Cette utilitaire est disponible dans le menu "Démarrer", rubriques "Programmes" puis "Python 2.3",
Dans le menu "Tools", cliquer sur "COM Makepy utility",
Une liste déroulante ayant pour titre "Select Library" s'affiche. Sélectionnez "Microsoft Excel Object 9.0 Object Library".
Cliquer sur "OK". La génération des fichiers va alors commencer et prendre quelques minutes.
Recommencer l'opération en sélectionnant "Microsoft PowerPoint Object 9.0 Object Library", puis "Microsoft Word Object 9.0 Object Library".
Linbox-Converter utilise des appels de l'API PDH (Performance Data Helper) pour surveiller l'activité des processus qu'il exécute. Uniquement sous Windows NT, la DLL fournie par défaut pour mettre en oeuvre cette API est instable, et il faut donc la mettre à jour.
Une mise à jour est disponible à cette URL: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q284996. Il suffit juste d'installer le fichier pdh.dll dans le répertoire d'installation de Python. Par exemple, si vous avez installé Python avec les liens indiqués dans la section précédente, il faut copier ce fichier dans le répertoire C:\Python23.
Créer un répertoire sur le serveur (par exemple C:\Converter), et copier tous les fichiers du répertoire linbox-converter/server des sources dans ce nouveau répertoire.
L'installeur est disponible à cette URL : http://prdownloads.sourceforge.net/ghostscript/gs706w32.exe. Il faut utiliser les choix d'installation par défaut.
Une version plus récente de GNU GhostScript peut être utilisée sans problème. Nous proposons ici la version 7.06.
L'impression en PostScript nécessite l'installation d'une imprimante PostScript couleur. Nous proposons l'utilisation du pilote générique Adobe pour ajouter une imprimante "LBX Conv".
Pour l'impression noir et blanc, il est recommandé d'avoir une autre imprimante "LBX Conv" configurée pour l'impression noir et blanc. On peut ainsi avoir une imprimante "LBX Conv" et une autre "LBX Conv NB", par exemple.
Pour le port de communication avec l'imprimante, il faut utiliser "FILE:".
Nous recommandons d'utiliser les pilotes universels Adobe. Leur installation se déroule en plusieurs parties.
Il faut télécharger le pilote universel postscript Adobe ainsi que les fichiers PPD additionnels Adobe. Tous ces fichiers se trouvent sur le site Adobe, à l'adresse suivante http://www.adobe.com/support/downloads/. Le produit à télécharger est le "Adobe Universal Postscript Windows Driver Installer 1.0.6 French" disponible en suivant les liens Postscript Printer Drivers sur la page. Vous devriez ainsi obtenir un fichier nommé winstfre.exe.
Ensuite, exécuter ce fichier winstfre.exe. Ce programme est l'installeur d'imprimante Adobe. Dans l'assistant qui s'exécute, spécifier que l'imprimante est locale (connexion directe à l'ordinateur) puis choisir le port FILE: pour la connexion. Dans la boîte de sélection de modèle d'imprimante, cliquer sur "Parcourir ..." et visiter le répertoire créé précédemment dans lequel vous avez copié les sources du serveur. Cliquer OK et sélectionner l'imprimante "LBX Conv". En continuant de dérouler l'assistant, spécifier que l'imprimante ne doit pas être partagée, lui donner un nom et refuser d'imprimer une page de test ou de la configurer de suite.
L'opération peut être renouvellée autant de fois que nécessaire (pour par exemple avoir une imprimante configurée en noir et blanc et l'autre en couleur).
Il faut modifier les propriétés des imprimantes afin d'avoir une meilleure qualité de sortie. Les copies d'écran suivantes sont issues de Windows 2000. Dans la fenêtre des propriétés de l'imprimante, il faut aller modifier les options comme suit :
Il faut ici aller modifier des options dans l'onglet "Avancé" et dans la fenêtre ouverte par le bouton "Options d'impression".
Dans l'onglet avancé, il faut activer "Imprimer d'abord les documents spoulés" et aller modifier les options de la fenêtre ouverte par le bouton "Impression par défaut".
Il faut modifier les options des deux fenêtres ouvertes avec les boutons "Options d'impression" et "Impression par défaut" de manière similaire à l'exemple donné ci-dessus.
Avant de lancer le serveur, quelques paramètres peuvent être modifiés. Ces paramètres sont décrits en Section 2, « Fichiers de configuration ».
Les fichiers de configuration sont au format INI. C'est-à-dire qu'ils sont composés de sections (notées entre crochets "[NOMSECTION]"), et que chaque section contient une liste de paires nom de l'option / valeur de l'option (notées "option = valeur").
Ce fichier contient les paramètres globaux du serveur Linbox-Converter. Il n'a qu'une seule section appelée linbox-converter. Voici les options disponibles :
port : le port TCP sur lequel le serveur attend la connexion des clients,
gs : le chemin complet de l'exécutable GhostScript gswin32c.exe,
tempdir : le répertoire de travail du serveur Linbox-Converter. Ce répertoire est effacé et recréé à chaque démarrage du serveur,
logdir : le répertoire de stockage des fichiers de logs de Linbox-Converter (voir Section 4, « Journaux »). Ce répertoire est créé automatiquement s'il n'existe pas au démarrage du serveur,
logerror : le fichier contenant les messages d'erreurs du serveur,
logaccess : le fichier contenant les messages d'accès des clients au serveur,
logmax : la taille maximum en Mega octets des fichiers de logs avant leur rotation,
logdays : le nombre de jours entre la première entrée des fichiers de log et leurs rotations.
Voici un fichier de configuration utilisable si l'installation a été faite comme décrite en Section 1, « Installation » :
[linbox-converter] port = 5007 gs = C:\gs\gs7.06\bin\gswin32c.exe tempdir = C:\Converter\tmp logdir = C:\Converter\log logerror = errors.txt logaccess = access.txt logmax = 50 logdays = 7 |
Ce fichier contient les paramètres liés aux files d'impression du serveur Linbox-Converter.
À une file d'impression correspond les paramètres de qualités suivants :
la résolution en DPI de la conversion en PostScript,
le driver TIF à utiliser pour convertir un fichier en TIF.
Toutes les sections correspondent à une file d'impression, le nom de la section correspond au nom de la file d'impression. Les options à spécifier pour chaque file d'impression sont :
option "driver" : le nom de l'imprimante associée à la file d'impression,
option "dpi" : la résolution de l'impression PostScript en DPI,
option "gstiff" : le nom du pilote d'impression que GhostScript doit utiliser pour générer les fichiers TIFF. Deux pilotes sont disponibles : tiffg4 pour du TIFF G4 (noir et blanc) et tiff24nc pour du TIFF 24 bits RGB (couleur, 8 bits par composante).
La file d'impression par défaut est spécifiée par la section BYDEFAULT. C'est la file d'impression qui sera utilisée par le serveur Linbox-Converter si le client ne demande pas de file d'impression (voir Section 3.2.4, « Sélection d'une file d'impression »).
Pour référence, voici un fichier de configuration utilisant l'imprimante "LBX Conv" créée en Section 1.2.5, « Installation des imprimantes PostScript ». Nous supposons aussi qu'une imprimante noir et blanc appelée "LBX Conv NB" a été paramétrée.
[BYDEFAULT] driver = LBX Conv dpi = 100 gstiff = tiff24nc [BANDW] driver = LBX Conv NB dpi = 200 gstiff = tiffg4 |
Il est possible que le processus de conversion de document déclenche une ou plusieurs bogues dans les applications MS-Office ou dans GNU Ghostscript. Linbox-Converter est capable de détecter ces blocages et de tuer les applications fautives. Des blocages de ce type peuvent survenir principalement avec Windows NT.
Un processus dédié se charge de détecter si le serveur Linbox-Converter s'arrête pour une raison inconnue. Dans ce cas, le serveur Linbox-Converter est tout simplement relancé.
De la même manière, si le serveur occupe trop de temps processeur pendant un laps de temps anormal, il est stoppé puis relancé.
Le script linbox-converter-starter.bat du répertoire d'installation permet de lancer le serveur Linbox-Converter. Voici ce qui s'affiche au démarrage du serveur :
Démarrage du serveur Linbox-Converter
Ces messages indiquent notamment que:
Le fichier de configuration qui a été lu,
Le répertoire de stockage des logs a été créé,
Le répertoire temporaire a été effacé (s'il existait avant) puis créé,
Le répertoire de travail (qui est correspond au répertoire temporaire) est C:\Converter\tmp,
Le journal des erreurs est C:\Converter\log\errors.txt,
Le journal des accès des clients au serveur est C:\Converter\log\access.txt. Les messages de démarrage du serveur y sont aussi inscrits,
La dernière ligne indique que le serveur est prêt à répondre au client sur le port TCP 5007.
Dans la suite de l'exécution du serveur, aucun autre message ne sera affiché par Linbox-Converter sur la sortie standard.
Il y a deux façons d'arrêter le serveur :
La plus simple est de fermer la fenêtre en cliquant sur le bouton de fermeture en haut à droite,
Appuyer simultanément sur les touches Ctrl puis Pause, puis confirmer l'arrêt du programme.
Si des conversions sont en cours, elles seront arrêtées instantanément.
Les journaux (ou logs) permettent de garder une trace écrite et horodatée des requêtes faites par les clients au serveur Linbox-Converter, ainsi que des erreurs éventuelles.
Un message du journal correspond à une ligne du fichier. Un message contient les champs suivants :
La date du message au millième de seconde prêt,
Le nom de l'émetteur du message,
Le message ayant été émis.
Les champs sont séparés par un deux-points.
La rotation des fichiers permet de limiter la place en taille prise par les journaux. Si un critère de rotation est atteint, le journal en cours est renommé en lui ajoutant l'extension ".1". Si ce fichier existe déjà, il est écrasé. Ensuite un nouveau fichier journal est créé.
Il existe deux conditions différentes qui déclencheront la rotation des fichiers :
La taille du fichier a atteint la limite autorisée. Cette limite est spécifiée dans le fichier de configuration linbox-converter.ini par l'option logmax (voir Section 2, « Fichiers de configuration »),
L'âge en jours du fichier de log est supérieure à la limite autorisée. La limite autorisée est spécifiée dans le fichier de configuration linbox-converter.ini par l'option logdays (voir Section 2, « Fichiers de configuration »).
Ce journal contient les enregistrements suivants :
Les messages de démarrage du serveur :
2003-02-24 11:33:18,052:Access.start:Work directory is C:\Converter\tmp 2003-02-24 11:33:18,052:Access.start:Errors are logged in C:\Converter\log\errors.txt 2003-02-24 11:33:18,062:Access.start:Clients access and these startup messages are logged in C:\Converter\log\access.txt 2003-02-24 11:33:18,062:Access.start:Server is ready, listening to port 5007 |
Le journal des requêtes faites par les clients au serveur Linbox-Converter. Le début de la conversion, la taille des documents, les différents paramètres de la conversion, les fonctions de conversions appelées et la fin de la conversion sont indiqués :
2003-02-24 09:21:22,069:Access.Thread-18:Beginning of the request from 192.168.0.18:54103. 2003-02-24 09:21:22,881:Access.Thread-18:Document data received (769536 bytes). Conversion of 'test' from 'doc' to 'ps' with printer 'BYDEFAULT' has started. 2003-02-24 09:21:23,041:Access.Thread-18:Running doc2ps ,in: C:\Converter\tmp\~396-32\test.doc ,out: C:\Converter\tmp\~396-32\test.ps 2003-02-24 09:21:42,429:Access.Thread-18:sending back 437020 bytes to the client 2003-02-24 09:21:43,070:Access.Thread-18:End of the request. |
Le nom de l'émetteur des enregistrements commence toujours par "Access". L'émetteur des messages de démarrage s'appelle "Access.start". Pour chaque tâche de conversion lancée, l'émetteur des messages s'appelle "Access.Thread-n", n étant un nombre entier positif permettant de dissocier les tâches les unes de autres. n vaut 1 au lancement du serveur, et est incrémenté de 1 à chaque conversion.
À cause de l'aspect multithread de Linbox-Converter, il est tout à fait normal de trouver des messages appartenants à des tâches différentes imbriqués les uns dans les autres. Par exemple :
2003-02-24 14:59:04,605:Access.Thread-2:Beginning of the request from 192.168.0.18:54245. 2003-02-24 14:59:04,695:Access.Thread-3:Beginning of the request from 192.168.0.18:54246. 2003-02-24 14:59:05,547:Access.Thread-2:Document data received (769536 bytes). Conversion of 'test' from 'doc' to 'ps' with printer 'BYDEFAULT' has started. 2003-02-24 14:59:05,656:Access.Thread-2:Running doc2ps ,in: C:\Converter\tmp\~1008-1\test.doc ,out: C:\Converter\tmp\~1008-1\test.ps 2003-02-24 14:59:05,726:Access.Thread-3:Document data received (769536 bytes). Conversion of 'test' from 'doc' to 'pdf' with printer 'BYDEFAULT' has started. 2003-02-24 14:59:05,927:Access.Thread-3:Running doc2ps ,in: C:\Converter\tmp\~1008-2\test.doc ,out: C:\Converter\tmp\~1008-2\test.ps 2003-02-24 14:59:25,555:Access.Thread-2:sending back 131372 bytes to the client 2003-02-24 14:59:25,876:Access.Thread-2:End of the request. 2003-02-24 14:59:30,582:Access.Thread-3:Running ps2pdf ,in: C:\Converter\tmp\~1008-2\test.ps ,out: C:\Converter\tmp\~1008-2\test.pdf 2003-02-24 14:59:56,429:Access.Thread-3:sending back 437020 bytes to the client 2003-02-24 14:59:56,830:Access.Thread-3:End of the request. |
Ce journal contient les erreurs qui peuvent se produire lors des conversions de documents. Par exemple, voici un exemple de conversion PostScript vers TIFF qui a échoué :
2003-02-24 16:45:02,233:Error.Thread-1:Problem during conversion, traceback is: Traceback (most recent call last): File "linbox-converter-server.py", line 506, in handle File "Converter.py", line 199, in convert File "DocumentHelper.py", line 336, in ps2tiff Exception: Error: ps to tiff conversion failed. |
Les anciennes versions de GhostScript ont notamment quelques problèmes de conversion pour de gros documents.
Table des matières
Les scripts clients nécessitent Python et Sh (ou Bash). Pour Python, les conditions suivantes sont demandées :
Version supérieure ou égale à 2.0,
Les modules Python: pthread (support des threads POSIX), zlib (compression des fichiers), TKinter (toolkit graphique TK). Ces modules sont inclus en standard sur toutes les distributions GNU/Linux.
La partie cliente de Linbox-Converter se résume à quatre fichiers :
lbx-converter.conf : le fichier de configuration du script linbox-converter,
lbx-converter : le script Python permettant de convertir des documents,
lbx-view : un script Sh utilisant lbx-converter pour convertir puis afficher un document dans une visionneuse PDF,
lbx-view-web : un script Sh utilisant lbx-converter pour convertir puis afficher un document dans un navigateur web.
Les trois scripts lbx-converter, lbx-view et lbx-view-web sont à recopier dans un des répertoires contenus dans la variable d'environnement PATH de votre shell. Le fichier de configuration lbx-converter.conf est à placer dans le répertoire /etc.
Le script lbx-converter requiert une version de Python supérieure ou égale à 2.0, avec les modules additionnels zlib (compression et décompression de données), thread (POSIX threads) et Tkinter (boîte à widgets graphiques TK).
Le fichier de configuration est au format INI. C'est-à-dire qu'il est composé de sections (notées entre crochets ("[NOMSECTION]"), et que chaque section contient une liste de paires nom de l'option/valeur de l'option (notées "option = valeur").
Ce fichier permet au client Linbox-Converter de se connecter à un serveur.
Cette section définit deux paramètres importants de Linbox-Converter :
server : cette option doit être le nom d'hôte ou l'IP du serveur Linbox-Converter à contacter,
port : cette option doit être un nombre entier positif définissant le port TCP de connexion avec le serveur Linbox-Converter.
Ce programme a pour but principal de convertir un document d'un format de fichier à un autre. Il est aussi capable de convertir un à un les documents contenus dans une archive zip.
Voici un résumé des conversions de documents que peut vous offrir le serveur Linbox-Converter. Les formats de fichiers supportés en entrée sont dans la colonne de gauche, et les formats en sortie sont dans la première ligne. Une croix à l'intersection d'une ligne et d'une colonne indique que la conversion est possible.
PS | TXT | RTF | HTML | TIF[F] | ||
---|---|---|---|---|---|---|
DOC | X | X | X | X | X | X |
XLS | X | X | X | X | X | |
PPT | X | X | X | X | X | X |
PS | X | X | ||||
TXT | X | X | X | X |
Les exemples de la section suivante supposent que votre environnement est Unix. Sous Windows, vous devez lancer le script client dans le répertoire contenant le script client et son fichier de configuration, et en spécifiant l'interpréteur Python à utiliser. Par exemple:
C:\lbx-converter> C:\python23\python.exe lbx-converter fichier.doc fichier.pdf |
Il suffit de spécifier en paramètres sur la ligne de commande de lbx-converter un fichier en entrée et un fichier en sortie. Le format du fichier donné en entrée est détecté grâce à son extension, et uniquement grâce à son extension (".doc" pour les fichiers Microsoft Word par exemple). Le format du fichier cible est lui aussi obtenu grâce à l'extension du fichier donné en sortie.
Pour convertir un fichier Microsoft Word en PDF :
% lbx-converter fichier.doc fichier.pdf lbx-converter: Connecting to the server (1 attempt out of 5) ... lbx-converter: Connected to the server. lbx-converter: Input file sent to the server. Now the server is working on it. Please wait. lbx-converter: Output file received. lbx-converter: Unzipping... lbx-converter: Done. |
Pour convertir un fichier Powerpoint en TIF :
% lbx-converter fichier.ppt fichier.tif lbx-converter: Connecting to the server (1 attempt out of 5) ... lbx-converter: Connected to the server. lbx-converter: Input file sent to the server. Now the server is working on it. Please wait. lbx-converter: Output file received. lbx-converter: Unzipping... lbx-converter: Done. |
Une fois la conversion terminée, le résultat de la conversion effectuée par le serveur est mis dans un fichier ayant pour nom le deuxième argument de la ligne de commande (fichier.pdf, fichier.tif dans les exemples). Si le fichier existe déjà, la commande vous demande (avant toute conversion de fichier) si elle peut l'écraser.
Chaque document est envoyé au serveur, qui le convertit et le renvoie dans le format demandé. Pour spécifier le format de sortie, on utilise l'option -o suivie du format de sortie (par exemple "-o ps" pour une sortie en postscript. Si une erreur survient lors du traitement d'un document, la suite de l'archive est tout de même traitée.
Voici un exemple d'appel, pour convertir tous les fichiers d'une archive en ps :
% lbx-converter -z -o ps archive.zip lbx-converter: Processing zip file archive.zip... lbx-converter: Working on CV.doc... lbx-converter: Connecting to the server (1 attempt out of 5) ... lbx-converter: Connected to the server. lbx-converter: Input file sent to the server. Now the server is working on it. Please wait. lbx-converter: Output file received. lbx-converter: Unzipping... lbx-converter: Working on report.xls... lbx-converter: Connecting to the server (1 attempt out of 5) ... lbx-converter: Connected to the server. lbx-converter: Input file sent to the server. Now the server is working on it. Please wait. lbx-converter: Output file received. lbx-converter: Unzipping... lbx-converter: Done. |
À une file d'impression correspondent les paramètres de qualité suivants :
la résolution en DPI de la conversion en PostScript,
le driver TIF à utiliser pour convertir un fichier en TIF.
Le changement de file d'impression sert seulement à la conversion au format TIF. En choisissant la file nommée "QMS", la DPI est de 300 et le driver TIF ghostscript a une meilleure résolution (driver "tiffg4"). La file d'impression par défaut a une DPI de 100 et le driver TIF utilisé est tiff24nc.
L'option -p suivie du nom de la file d'impression permet de la sélectionner. Par exemple, pour sélectionner la file QMS :
% lbx-converter -p QMS fichier.doc fichier.tif |
Sans l'option -p, lbx-converter choisit la file d'impression par défaut.
Il est possible de sélectionner le nombre de pages à convertir en utilisant l'option -n suivie du nombre de pages à convertir (en partant du début du document). Ainsi, si on désire convertir les 3 premières pages d'un fichier, on utilisera lbx-converter de la façon suivante :
% lbx-converter -n 3 fichier.doc fichier.pdf |
Sans l'option -n, toutes les pages du document sont converties
La sélection du nombre de pages ne fonctionne que pour la conversion vers des formats intégrant la notion de page. Dans la version actuelle, cette sélection ne fonctionne que lors de la conversion de documents MS-Office vers les formats Postscript, PDF ou TIFF.
L'option -f indique à la commande d'écraser le fichier cible s'il existe déjà, sans poser de question,
L'option -q indique à la commande de n'afficher que les erreurs, c'est-à-dire que jamais rien ne s'affichera si la commande ne rencontre pas d'erreur,
L'option -w indique à la commande d'afficher une petite fenêtre d'attente pendant la conversion du document,
L'option -r suivie d'un nombre ("-r 10") indique le nombre d'essais de connexion au serveur Linbox-Converter si celui-ci ne répond pas avant l'arrêt de la commande avec un message d'erreur. Par défaut, le nombre d'essais vaut 5,
L'option -v indique à la commande d'afficher son numéro de version,
L'option -V indique à la commande d'afficher son numéro de version ainsi que la version du serveur Linbox-Converter. Le numéro de version du serveur est directement demandé au serveur.
La règle concernant les codes d'erreurs retournés par lbx-converter est très simple. Si la commande s'est déroulée sans problème, la valeur 0 est retournée. Dans le cas contraire, une valeur est retournée selon le type d'erreur rencontré, avec un message d'erreur en précisant la cause affiché sur la sortie standard.
Voici un tableau présentant pour chaque numéro de code le type d'erreur associé :
Numéro | Type d'erreur |
---|---|
1 | Erreur inconnue : erreur interne au script client lbx-converter (ne devrait pas se produite) |
2 | Erreur réseau : problèmes de connexion réseau (connexion au serveur, envoi/réception de données, ...) |
3 | Erreur sur la ligne de commande : les paramètres passés au script lbx-converter sont mauvais, ou alors leur nombre est incorrect. L'aide en ligne est alors affichée. |
4 | Erreur dans le fichier de configuration : il y a eu un problème lors de l'exploitation du fichier de configuration |
5 | Le serveur refuse de convertir le document : le format de fichier en entrée est inconnu, le format de sortie est inconnu, ... |
6 | Erreur post-conversion : le serveur a bien renvoyé le fichier converti, mais il n'a pas pu être exploité (le fichier est corrompu, ...) |
7 | Impossible de choisir un serveur auquel se connecter : le fichier de configuration est incomplet, ou alors les commandes utilisées par le script lbx-converter ne sont pas exploitables |
8 | Le fichier à convertir ne peut être lu (problème d'existence ou de permissions) |
9 | Annulation de l'exécution de la commande en tapant CTRL-C par exemple |
10 | Le document est protégé par mot de passe |
11 | L'ouverture du document sur le serveur a atteint un temps d'expiration. Le document est sûrement corrompu. |
12 | La conversion du document sur le serveur a atteint un temps d'expiration. Un problème dans la chaîne de conversion est apparu. |
Dès qu'une erreur est rencontrée, le script client lbx-converter stoppe son exécution.
Deux scripts permettent d'intégrer Linbox-Converter à Netscape (version 4) :
lbx-view : conversion du document donnée en paramètre au format PDF, puis affichage dans la visionneuse Acrobat Reader,
lbx-view-web : conversion du document donnée en paramètre au format PDF, puis affichage dans le plugin Acrobat Reader dans une nouvelle fenêtre Netscape.
Ces scripts utilisent la commande lbx-converter avec l'option -w pour afficher une petite fenêtre d'attente.
Pour utiliser l'un ou l'autre de ces scripts dans Netscape pour visualiser les fichiers Microsoft Office, il suffit de faire correspondre au MIME-type "Microsoft Word Document", "Microsoft Excel Worksheet" et "Microsoft PowerPoint Show" la ligne suivante :
PATH/lbx-view-web '%s' |
Remplacer PATH avec le chemin de la commande lbx-view-web.
Table des matières
FSF Copyright note
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
GNU FDL Modification Conditions
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Samle Invariant Sections list
Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this:
Sample Invariant Sections list
with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.