Sorry the bug fix is a null value when placing an image in a shapeproperty. It 
does not address any return values at the end of paragraphs.

Howard



----- Original Message ----
From: "Le Doyen, Loic" <[EMAIL PROTECTED]>
To: Post all your questions about iText here 
<[email protected]>
Sent: Thursday, August 28, 2008 5:00:32 AM
Subject: Re: [iText-questions] RTF: Wrapping text around an image?

Hi,

Is that delete the two line-breakers added after if I use shapes to insert my 
pictures ?

Thanks,

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Howard Shank
Sent: mercredi 27 août 2008 19:29
To: Post all your questions about iText here
Subject: Re: [iText-questions] RTF: Wrapping text around an image?

There are 2 issues here.

First, there is a bug in the code that I have just fixed. In order for this 
example to work, you will need version 2.1.4 when it comes out. Or you can get 
the source from SVN and compile yourself, or obtain the daily snapshot and use 
that until the release. I do not recommend you use a non-release version in 
production. The fix is in RtfShape.java.

Second, below is an example how to wrap text around the graphic object. 
Eventually this example will be posted on the new examples site:
http://1t3xt.info/examples/rtf.php

====================================================================
Document document = new Document();

        try {
            RtfWriter2 rtfWriter = RtfWriter2.getInstance(document,
                    new FileOutputStream(resultsPath + outFile));
            document.open();
            Image logo = Image.getInstance(resourcePath + inFile1);

            Paragraph p = new Paragraph();
            Chunk c = new Chunk();
            c.append("This is some text. This is some text. This is some text. 
This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text.. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text.. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. "
                            + "This is some text. This is some text. This is 
some text. This is some text. This is some text. This is some text. ");

            RtfShapePosition position = new RtfShapePosition(2000, 6000, 10500, 
4500);
            RtfShape shape = new RtfShape(RtfShape.SHAPE_RECTANGLE, position);
            shape.setWrapping(RtfShape.SHAPE_WRAP_BOTH);
            shape.setProperty(new 
RtfShapeProperty(RtfShapeProperty.PROPERTY_IMAGE, logo));

            p.add(shape);
            p.add(c);
            document.add(p);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (BadElementException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        document.close();
====================================================================

This example requires version 2.1.4 or higher to function.

Regards,
Howard Shank



----- Original Message ----
From: John Schroeder <[EMAIL PROTECTED]>
To: Post all your questions about iText here 
<[email protected]>
Sent: Wednesday, August 27, 2008 12:15:40 PM
Subject: Re: [iText-questions] RTF: Wrapping text around an image?

I tried out the text wrapping examples in the tutorial, but none of the shapes 
actually show up in the document that's created when I run it. (or any of the 
.rtf documents that are on that page for that matter).  I've tried it with Word 
2003, OpenOffice Writer 2.4 and WordPad, but all of them are just showing text 
for me.  Am I doing something wrong?

On Wed, Aug 27, 2008 at 8:57 AM, Howard Shank <[EMAIL PROTECTED]> wrote:
> Here is the original tutorial. Wrap your image with a shape.
>
> http://itextdocs.lowagie.com/tutorial/rtf/features/shape/index..php
>
> Howard Shank
>
>
>
> ----- Original Message ----
> From: John Schroeder <[EMAIL PROTECTED]>
> To: Post all your questions about iText here 
> <[email protected]>
> Sent: Wednesday, August 27, 2008 11:46:04 AM
> Subject: Re: [iText-questions] RTF: Wrapping text around an image?
>
> Actually, I hadn't noticed before but yes it does look like there are 
> a couple of extra linebreaks after most (but not all) of the pictures 
> I insert. That's not as much of a problem for me as the text wrapping 
> though.. anyone have a solution for this?
>
> On Wed, Aug 27, 2008 at 12:54 AM, Le Doyen, Loic 
> <[EMAIL PROTECTED]> wrote:
>> hi,
>> Don't you have also the problem of having 2 line breakers added just after 
>> your picture ? Or have you solved this problem ?
>> Back to the alignment, I haven't pass to set another alignment than the 
>> default one(left), the method setAlignment of the Image class is not working 
>> on my computer.
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On Behalf Of 
>> John Schroeder
>> Sent: mercredi 27 août 2008 0:57
>> To: [EMAIL PROTECTED]
>> Subject: [iText-questions] RTF: Wrapping text around an image?
>>
>> I'm trying to wrap the text of a paragraph around an image and I'm having 
>> some problems.  When I use the Image.TEXTWRAP property for the alignment, 
>> the image shows up right next to the last line of the paragraph and there's 
>> an image-sized blank space between the second to last and last lines.  The 
>> code I'm using looks something like this:
>>
>> Image img = Image.getInstance(imageUrl); img.setAlignment 
>> (Image.TEXTWRAP | Image.ALIGN_RIGHT); Paragraph para = new 
>> Paragraph(); para.add(<a bunch of text>); para.add(img); 
>> doc.add(para);
>>
>> What I want to do is have the image on the right side and the text wrapping 
>> around it.  Is this possible? If so, can someone show me how it's done?  
>> Thanks..
>>
>> ---------------------------------------------------------------------
>> ---- This SF.Net email is sponsored by the Moblin Your Move 
>> Developer's challenge Build the coolest Linux based applications with 
>> Moblin SDK & win great prizes Grand prize is a trip for two to an 
>> Open Source event anywhere in the world 
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> 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
>>
>> ---------------------------------------------------------------------
>> ---- This SF.Net email is sponsored by the Moblin Your Move 
>> Developer's challenge Build the coolest Linux based applications with 
>> Moblin SDK & win great prizes Grand prize is a trip for two to an 
>> Open Source event anywhere in the world 
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> 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
>>
>
> ----------------------------------------------------------------------
> --- This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge Build the coolest Linux based applications with Moblin SDK & 
> win great prizes Grand prize is a trip for two to an Open Source event 
> anywhere in the world 
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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
>
>
>
>
>
>
> ----------------------------------------------------------------------
> --- This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge Build the coolest Linux based applications with Moblin SDK & 
> win great prizes Grand prize is a trip for two to an Open Source event 
> anywhere in the world 
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge 
Build the coolest Linux based applications with Moblin SDK & win great prizes 
Grand prize is a trip for two to an Open Source event anywhere in the world 
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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



      


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge 
Build the coolest Linux based applications with Moblin SDK & win great prizes 
Grand prize is a trip for two to an Open Source event anywhere in the world 
http://moblin-contest.org/redirect..php?banner_id=100&url=/
_______________________________________________
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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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



      


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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

Reply via email to