boxable
boxable copied to clipboard
Hyperlink inside Cell
Hi All,
I have been trying to find a way I could insert a hyperlink inside a table cell. Unfortunately since row.createCell only takes float and String parameters, not really sure how to insert a hyperlink in it.
I've tried using <a href tag as well but seems like that is not supported as well. Is there a way to get this working? Any help will be highly appreciated.
Thank you
I am pretty sure that Adobe will make any http:// or https:// as hyperlink. Try with that
Unfortunately, when I put in < a href='www.google.com' >Link< /a > I get this printed as it is the cell. This is what I've written,
Row<PDPage> attachmentsRow = table.createRow(rowHeight); cell = attachmentsRow.createCell(30, "Attachments"); cell = attachmentsRow.createCell(70, "< a href='www.google.com' >Test"); cell.setFillColor(descriptionCell); cell.setFont(PDType1Font.HELVETICA_BOLD);
The result is,
| Attachments | < a href='www.google.com' >Test |
rather than,
| Attachments | Test |
P.S> Please note spaces in html code above is added to display it as string otherwise they were being converted to hyperlinks
What happen when you just say: https://google.com ? Did you tried that?
@Frulenzo Do you mean without the <a href tag or with? I am just trying it ... will update you in 5 mins
@Frulenzo Okay I tried using the <a href tag and even without, it displays https://google.com, the cursor even changes to click one but clicking on it doesn't work.
Yeah, I see --> feature request
any update on this?
Hi, I just added a pull request with some code that will allow you to set a Cell's URL, based on code developed for my employer. Please let me know if any refinements are required to make it suitable for merge.