code conversion from itext 2 to itext 5.5 -
i generating pdf using itext 2 , below code
string xhtml = toxhtml(xml).replaceall("<br>", "<br/>"); itextrenderer renderer = new itextrenderer(); renderer.setdocumentfromstring(xhtml); renderer.layout(); file temp = file.createtempfile("test", ".pdf"); temp.deleteonexit(); outputstream os = new fileoutputstream(temp); renderer.createpdf(os); os.close();
but, when place itextpdf-5.5 jar.i getting below error
type com.lowagie.text.documentexception cannot resolved. indirectly referenced required .class files
i know of methods deprecated. tried using document class but, did n't work.
do need find alternatives createpdf method in new api or there way can make jar not refer 'lowagie' deprecated. on appreciated
itext 2 packages starting com.lowagie
, while itext 5 packages starting com.itextpdf
. replacing jar won't work in such place. have replace imports.
if you're using 3rd party dependecy uses itext error means have use version 2. there major change in license version 5 of itext 2 not interchangeable.
wiki
Comments
Post a Comment