Bonjour,
Est ce qu'une librairie JAVA permettant de convertir un fichier RTF en un fichier PDF existe?
J'ai fais des recherches, mais je n'ai rien trouvé...
Bonjour,
Est ce qu'une librairie JAVA permettant de convertir un fichier RTF en un fichier PDF existe?
J'ai fais des recherches, mais je n'ai rien trouvé...
Bonjour,
En direct, je crois pas.
Par contre, tu peux recupérer le RTF en mémoire, et il existe des API pour générer des PDF, le truc aprés est d'en trouver une gratuite, essaie sur le site de source forge, avec de la chance, y a un projet open source qui permet de le faire.
A+
JHelp
J'avais pensé a Itext, car je sais qu'il peut faire de la génération de PDF et de RTF, mais en allant fouiller, je suis tombé dans les FAQ la dessus :
A priori, il y a des chances que tu aies besoin de faire d'abord du parsing RTF via POI pour générer ton document PDF, avec une autre API (Itext par exemple)...Can I convert WORD doc-files or RTF to PDF using iText?
No, iText is only able to generate RTF. It doesn't do RTF or Word-doc parsing. Try Apache POI.
Re-bonjour,
C'est juste pour signaler qu'il existe le package java.swing.text.rtf dans l'API de base pour chager en mémoire les documents RTF en mémoire.
JHelp
Et en partant d'un autre langage comme l'HTML ou autres?
En fait, comme on peut pas rechercher et remplacer du texte dans un pdf avec iText, je voulais le faire dans un fichier RTF, avant de le convertir en pdf...
Merci pour votre aide...
Toujours sur le site www.Lowagie.com, pour Itext, dans les FAQ :
Donc pour le HTML, c'est experimental, par contre pour le XML :Can I convert a HTML file to a PDF document?
This is not really supported by iText. In Chapter 7, you find a (very experimental) example. There are people who have succeeded in using this functionality in combination with the HtmlTidy and there are also some examples here (but the links are broken most of the time): http://128.146.184.28/pdfsamples/asp_readme.htm and http://128.146.184.28/pdfsamples/Html2pdf.asp.
If you really need HTML to PDF conversion, use HtmlDoc or post your question to the mailing list to hear from other subscribers how they achieved to parse their HTML.
[/quote]Can I convert a XML file to a PDF document?
Chapters 7 and 12 in the old tutorial have some examples. I wrote the XML package a long time ago, because I needed some specific XML functionality in a project at Ghent University. I added the package to iText, but sometimes I regret this: it's suites my needs, but a lot of people expect just too much of it and they blame me for not answering all their questions.
iText is a very good product, but when looking at the XML package, some people say: 'you see, Open Source technology has many disadvantages; the XML part of iText is really bad'.
They are right and wrong at the same time. There are a lot of flaws in the package: the choice of the tagnames, the incorrect DTD, the strange design,... On the other hand: you can do a lot of nice things with com.lowagie.text.xml.*. The projects at Ghent University are a success and I'm sure many people make good use of the XML functionality of iText.
I'm not sure what I'm going to do in the future with the XML package. It should be redesigned; I have planned to do this many times, but other projects always got in the way. There is a good alternative for XML2PDF conversion that uses iText as PDF generator: before you investigate the XML capabilities of iText, you may want to take a look at UJAC.
Si je me souviens bien le JEditorPane (ou le JTextPane je ne sais jamaispeut charger des RTF. Il ne gère pas tout mais si le RTF est simple ça suffira. Une fois le RTF chargé dans le JEditorPane il est possible de parcourir le contenu en récupérant tous les styles (gras, couleur, etc.) et donc d'invoquer iText pour générer le PDF.
Encore une petite question...
Existe t'il des librairies Java Open Source, permettant d'extraire du texte d'un fichier .pdf?
Merci.
iText met à disposition un Object PdfReader, mais je sais pas quelles sont ses possibilités.. (au minimum, récupérer les méta données du document ).
bon courage
Partager