itext pdf imagae

onanar
onanar used Ask the Experts™
on
Hi

How to add image in pdf table using itext, i have added two lnes to pdf table (name and company), now i need to add singanture image next to that. how to do that?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Multitechnician
Top Expert 2014
Commented:
In this case you have to make your table with two columns/with one cell in each column/. In the first column to add another table with the two lines you have mentioned above. On the second column you have to add your image.
Image can be added in this way : Image logo = Image.getInstance(path + "img/Logo.jpg");
If you want to stretch it : logo.scaleToFit(90, 45);
Table with two columns could be created in this way : PdfPTable tblLogo = new PdfPTable(new float [] { 0.5f, 0.5f });
Tables could be nested in each other in this way : http://stackoverflow.com/questions/1340623/itext-nested-table-inside-a-cell
And if you need to align cells, you can do this by :
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setVerticalAlignment(Element.ALIGN_BOTTOM);

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial