Sorry for the cross-posting, I modified the code of RtfTable and it did the
trick.

Thanks for help.

- Anil

-----Original Message-----
From: Mark Hall [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 27 February 2008 10:40 AM
To: 'Post all your questions about iText here'
Cc: Anil Kumar
Subject: Re: [iText-questions] RTF Add Image & Line Break

Hi,

please also keep all follow ups on the mailing list and on the topic
specified 
in the subject line, otherwise I am tempted to save myself some time and 
ignore them.

This is a basic limitation of the table implementation. You'll have to
modify 
the source to get rid of this. Look through the mailing list archives, how
to 
do this has been explained multiple times.

Mark

On Tuesday 26 February 2008, you wrote:
> Thanks Mark, this works. Now I am facing same problem with Table, it
always
> adds one line before table. I tried wrapping it in paragraph but it
doesn't
> work. Any clue why it is happening ?
>
> Regards
> Anil
>
> -----Original Message-----
> From: Mark Hall [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 27 February 2008 7:25 AM
> To: 'Post all your questions about iText here'
> Cc: Anil Kumar
> Subject: Re: [iText-questions] RTF Add Image & Line Break
>
> Hi,
>
> yes you are right. Sorry, my answer was incorrect. You need to place the
> Image
> in a Paragraph, not a Chunk. It's been some time since I've used this
> functionality. I've tested it now and
>  Paragraph par = new Paragraph();
>  par.add(image);
>  doc.add(par);
> works.
>
> Mark
>
> On Tuesday 26 February 2008, Anil Kumar wrote:
> > Hi Mark
> >
> > Thanks for the help, I tried it, but wrapping it in chunk made no
> > difference. Here is the code I am using and sample output.
> >
> > Image image = Image.getInstance(imageData);
> > int percent = (int)(100 * (PageSize.A4.width()-100) / (image.width()));
> > percent = Math.min(percent, 100);
> > image.scalePercent(percent, percent);
> > Document document = (Document) documentObj;
> > document.add(new Chunk(image,0,0));
> >
> > Thanks
> > Anil
> >
> > -----Original Message-----
> > From: Mark Hall [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 26 February 2008 8:39 PM
> > To: Post all your questions about iText here
> > Cc: Anil Kumar
> > Subject: Re: [iText-questions] RTF Add Image & Line Break
> >
> > Hi,
> >
> > place the Image in a Chunk, that will display the image in-line.
> >
> > Mark
> >
> > On 26 Feb 2008, at 06:22, Anil Kumar wrote:
> > > There is one automatic line-break / CR gets added after image, is
> > > there anyway to stop this happening.
> > >
> > > I am using this code.
> > >
> > > Image image = Image.getInstance(imageData);
> > > int percent = (int)(100 * (PageSize.A4.width()-100) / image.width());
> > > mage.scalePercent(percent, percent);
> > > document.add(image);
> > >
> > > Thanks for the help.
>
> -------------------------------------------------------------------------
>
> > > This SF.net email is sponsored by: Microsoft
> > > Defy all challenges. Microsoft(R) Visual Studio 2008.
>
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/____________________
>
> >_ __________________________
> >
> > > iText-questions mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > > Buy the iText book: http://itext.ugent.be/itext-in-action/



-- 
This is the first age that's paid much attention to the future, which is a
little ironic since we may not have one.
                -- Arthur Clarke

My GPG public key is available at:
http://www.room3b.eu/data_box/download?path=%2Fsecurity%2FMarkHall.asc



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to