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/ -- Q: Why haven't you graduated yet? A: Well, Dad, I could have finished years ago, but I wanted my dissertation to rhyme. My GPG public key is available at: http://www.room3b.eu/data_box/download?path=%2Fsecurity%2FMarkHall.asc
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- 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/
