p1.add(new Chunk(img, 0 , -img.scaledHeight())) will drop the image below the baseline and autoleading is only calculated above the baseline.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Andreas Meyer > Sent: Thursday, March 17, 2005 2:34 PM > To: [email protected] > Subject: Re: RE: [iText-questions] text, images, background > images and keep together > > I have experimented with leading as you can see, but with no luck: > > PdfContentByte cb = writer.getDirectContent(); > > ColumnText ct = new ColumnText(cb); > > //ct.setLeading(0, 1); > > Paragraph p1 = new Paragraph(); > > Image img = Image.getInstance("Event_logo.gif"); > > p1.add(new Chunk(img, 0 , -img.scaledHeight())); // Scaled > height is about > 4*titlefont > > //p1.add(new Chunk(img, 0 , -img.scaledHeight(), true)); > > p1.add(new Chunk("Event_title\n", titlefont)); > > p1.add(new Chunk("Event_subtitle\n", subtitlefont)); > > p1.add(new Chunk("Event date, time and location\n", locationfont)); > > p1.setKeepTogether(true); // do not separate logo and text ! > > //p1.setLeading(0, 1); > > ct.addElement(p1); > > > > All that is possible with ColumnText (and autoleading > works). Post some > > snippets of your code and we'll start from there. > > > > > -----Original Message----- > > > From: itext-questions-admin <at> lists.sourceforge.net > > > [mailto:itext-questions-admin <at> lists.sourceforge.net] On > > > Behalf Of Andreas Meyer > > > Sent: Thursday, March 17, 2005 5:23 AM > > > To: itext-questions <at> lists.sourceforge.net > > > Subject: [iText-questions] text, images, background images > > > and keep together > > > > > > hi all, > > > I am new to iText and need to combine text with images or > > > background images in > > > columns, preferably with automatic keep together of certain > > > parts (text/text, > > > text/image). Can someone please recommend me, which > > > combination of objects is > > > best suitable for this ? I have already tried to solve the > > > problem with > > > ColumnText/Paragraph, but I could not get autoleading to work. > > > > > > Thanks in advance, > > > Andreas Meyer > > > ------------------------------------------------------- > 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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- 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://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
