Hello,

I am trying to use iText to create a RTF document that has images and text.  
The images are all .jpg.  I have been trying to add them to my document, and 
no error is thrown but the image is not added.  I have created a very simple 
program just to see if it is possible to add an image to a RTF document 
using iText.  This is my code, and bartest.jpg resides in the same directory 
as the java file:

        // rotating the page size makes this document landscape
        Document document = new Document(PageSize.A4.rotate(), 54, 36, 108, 
54);
        try {
            String fileName = "Bar.rtf";
            RtfWriter.getInstance(document, new FileOutputStream(fileName));
            document.open();
            Image jpeg = Image.getInstance("bartest.jpg");
            document.add(jpeg);
        } catch (Exception e) {
            System.out.println("Exception in createBarGraph:"+e.toString());
        }
        document.close();

Please tell me if this is possible, and if so how I can get the image to 
appear in my finished document?  Posting any code of your own that actually 
displays an image in an RTF would be very helpful.

Thanks,
BeckyG

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to