Hi!

I'm trying to run RTFHelloWorld example from site.

I use iText 2.1.7
I guess I included all needed dependencies, but when I run it I get
Exception in thread "main" java.lang.NoSuchMethodError:
com.lowagie.text.Paragraph.getSpacingBefore()F
        at com.lowagie.text.rtf.text.RtfParagraph.<init>(Unknown Source)
        at com.lowagie.text.rtf.RtfMapper.mapElement(Unknown Source)
        at com.lowagie.text.rtf.RtfWriter2.add(Unknown Source)
        at com.lowagie.text.Document.add(Unknown Source)
        at RTFHelloWorld.main(RTFHelloWorld.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:105)

1. Could you explain me what that means?
2. I saw that starting from iText 5.0 rtf support was moved to another
project, but there is no mention to which exact project it was moved
:) Could someone direct me in this?

public class RTFHelloWorld {

        static String outFile = "RtfHelloWorld1.rtf";
        static String  resultsPath = "results/rtf/intro/";
        static String  resourcePath = "resources/rtf/intro/";

        /**
         * @param args
         */
        public static void main(String[] args) {
                // create a document
                Document document = new Document();

                try {
                        // create a RTF Writer
                        RtfWriter2.getInstance(document, new 
FileOutputStream(resultsPath +
outFile));

                        // Open the document for processing
                        document.open();

                        // add some text
                        document.add(new Paragraph("Hello World"));

                } catch (FileNotFoundException e) {
                        e.printStackTrace();
                } catch (DocumentException e) {
                        e.printStackTrace();
                }

                // close the document
                document.close();
        }

}

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to