Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

java - iText 5.0.0 where did RTF and HTML go?

This question may seem stupid, but, so be it! I have a stupid problem then :-). Well, my problem is this : using this code

//PDF generation

PdfWriter.getInstance(document,
new FileOutputStream("PDFFile.pdf"));

//RTF generation

RtfWriter2.getInstance(document,
new FileOutputStream("RTFFile.rtf"));

//HTM generation

HtmlWriter.getInstance(document,
new FileOutputStream("HTMLFile.htm"));

(and some other lines) with iText version 2.1.7, every computer geek is able to produce files in PDF, RTF or HTM file formats from his Java code. Now, i've upgraded iText to latest version (5.0.0) and i am unable to locate RtfWriter2 (or old RtfWriter) or HtmlWriter. To be concise, i was wondering if anyone has any idea if the support for those file types was even maintained, since every search on web-search engines obviously pointed me to previous versions of iText, where, apparently, one was able to do everything. Any hints on the matter?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

According to the iText website, in v5.0.0 they deliberately removed the RTF and HTML writers. On their history page (http://itextpdf.com/content/changelogs), they say:

"The toolbox and RTF support have been removed: they are now in a separate project at SourceForge."

I believe this is the link to the new separate iText RTF project: http://sourceforge.net/projects/itextrtf

And according to this thread: http://itext-general.2136553.n4.nabble.com/HTML-to-RTF-td2161984.html, the HTML support is taken over by the xhtmlrenderer project at https://xhtmlrenderer.dev.java.net (update: dead link. The project appears to have been renamed "Flying Saucer": new home at http://code.google.com/p/flying-saucer/, source at https://github.com/flyingsaucerproject/flyingsaucer).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...