Is there any workaround to achieve this effect when using straight
paragraphs? Thanks!

Jerry

-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 15, 2004 5:18 PM
To: Jerry Heinz; itext-questions
Subject: Re: [iText-questions] Inline Images


It only works in ColumnText with auto leading.

----- Original Message ----- 
From: "Jerry Heinz" <[EMAIL PROTECTED]>
To: "itext-questions" <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 2004 9:51 PM
Subject: [iText-questions] Inline Images


I have a paragraph in which I'm including an inline image using the code
below. There are some cases, however, where the image height is larger
than the line spacing. From the JavaDoc, it appears that the constructor
Chunk(Image image, float offsetX, float offsetY, boolean changeLeading)
would handle this, however as you can see from the attached pdf, the
line spacing is not adjusted. 

Can someone please tell me what I'm doing wrong? As always, thanks for
your help!

Jerry

import java.io.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;

public class imageTest {   
    
    public static void main(String[] args) {
        Document document = new Document(PageSize.A4, 50, 50, 50, 50);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("c:\\image_leading.pdf"));
            String myString = "<itext><p></p></itext>";
            document.open();
            
            Paragraph p = new Paragraph();
            p.add(new Chunk("Here is some text and an image will appear
inline with the test test here ... blah blah blah blah"));
            Image img = Image.getInstance("C:/myimage.gif");
            p.add(new Chunk(img,0,0, true));
            p.add(new Chunk("blah blah blah blah blah blah blah"));
            
            document.add(p);
            
            document.close();
            System.out.println("Finished.");
        }
        catch (Exception de) {
            de.printStackTrace();
        }
    }
}



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to