Ok, I've got a somewhat better result using this

                    URL url = getClass().getResource("plus.png");
                    Phrase ph = null;
                    try {
                        Image image = Image.getInstance(url);
                        ph = new Phrase(new Chunk(image, 0, 0));
                        ph.add(new Chunk("SomeText", FONT_CELL_H));
                    } catch (Exception e) {
                        ph = new Phrase("SomeText", FONT_CELL_H);
                    }
                    PdfPCell c = new PdfPCell(ph);

but now, the image is scaled, I think. At least it looks too big in the
resulting pdf file. Is there anything I can do about that?
Thanks,
Philipp


On Tue, Mar 23, 2010 at 10:22 AM, Philipp Bouillon <
[email protected]> wrote:

> Hi all,
>
> I am creating a PdfPCell with an image and some text like this:
>
>            PdfPCell c = new
> PdfPCell(Image.getInstance(getClass().getResource("plus.gif")), false);
>            c.addElement(new Phrase("SomeText", new
> Font(Font.FontFamily.HELVETICA, 8, Font.BOLD)));
>
> Now, in the output, the text is shown -- the image is not.
> Am I doing something wrong?
>
> Thanks for your help.
> Philipp
>
> P.s.: Yes, the image exists...
>
>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to