I am trying to create document using iText. I am using Eclipse IDE. I've imported the jar files (itextpdf-5.2.1.jar and itext-xtra-5.2.1.jar).

However RtfWriter2 is not being recognised as a class.

        Document doc = new Document();
        RtfWriter2 writer = new RtfWriter2();
        RtfWriter2.getInstance(doc,new FileOutputStream("testRTFdocument.rtf"));

Can someone help me in figuring out what I am missing. I am very new to iText.

Why do you think it is a class? Is it in a package that needs to be imported?

iText2.0.1.jar file needs to added to the build path. It works now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.