The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

maheelekha (1) [Avatar] Offline
#1
Hi,

I ve one doudt regarding PdfPTable. How should i include Hyperlink or url in table cell.
I easily insert Image in table cell. I insert this code for adding hyperlink in table but does not show link or reference to that page

Anchor anch = new Anchor("yahoo");
anch.setReference("www.yahoo.com");
anch.setName("yahoo");
PdfPCell link = new PdfPCell(anch);
table.addCell(link);

Please reply as soon as possible.

regards,
uma
blowagie (284) [Avatar] Offline
#2
Re: hyperlink in PdfPTable
Create a Chunk instead of an Ancher, then set the reference with setAnchor as described in chapter 4. I think it's briefly mentioned in Chapter 7 that Anchor doesn't work inside a ColumnText object. As you know, a cell in a PdfPTable is a special type of ColumnText object.