Hi,
Is it possible to add Link page element in a table cell?
Thanks,
SP
Link
Re: Link
Support · Nov 16, 2009Hello SP,
Yes, you can add Links to the table cell without any problem. Add the Link and Label elements to the AreaGroup and then add the group to the cell of the table. You can add multiple elements to the cell by using the groups.
Thanks,
ceTe Software Support Team.
Re: Link
Forum member · Nov 16, 2009Hi,
Is it possible to add multiple groups to the table cell?
Thanks,
SP.
Re: Link
Support · Nov 16, 2009Hello SP,
Only one group can be added to the cell. So if you have multiple groups, then add all the groups or elements to one main group and then add the main group to the cell.
Thanks,
ceTe Software Support Team.
Re: Link
Forum member · Nov 17, 2009Hi,
I tried the below code to add Link to the table cell. The Lable shows in a right x, y place but the Link UrlAction shows in some other location. Am I doing something wrong?
Here's my code:
PageElements.AreaGroup refGroup = new PageElements.AreaGroup(400, 50);
strin temp = "This is Link";
float xPos = 15;
float yPos = 0;
PageElements.Label label = new PageElements.Label(temp, xPos, yPos, 400, 0, RegularFont, 12);
label.Underline = true;
PageElements.Link link = new PageElements.Link(xPos, yPos, RegularFont.GetTextWidth(temp, 12),
0, new ceTe.DynamicPDF.UrlAction("http://www.dynamicpdf.com"));
refGroup.Add(label);
refGroup.Add(link);
row = table.Rows.Add(RegularFont, 12);
cell = row.Cells.Add(refGroup, 2);
Help is gretely appreciated.
Thanks
SP.
Re: Link
Support · Nov 17, 2009Hello SP,
You are not setting any height to the Label and Link page elements in the constructors. Please set some height and this should solve your problem. Below is the sample code for this.
Label label = new Label(temp, xPos, yPos, 400, 20, Font.CourierBold, 12);
label.Underline = true;
Link link = new Link(xPos, yPos, Font.CourierBold.GetTextWidth(temp, 12), 20, new ceTe.DynamicPDF.UrlAction("http://www.dynamicpdf.com"));
Thanks,
ceTe Software Support Team.
Re: Link
Forum member · Nov 17, 2009Hi,
I set the height for both lable and link as 20 and tried but still the label is not changed to a hyperlink. Actually, the hyper link shows on some other text.
I tried exactly how it's described in documentation. It's very urgent. Please help me out.
Thanks,
SP.
Re: Link
Support · Nov 17, 2009Hello SP,
We are able to add the link and label without any problem to the cell. Below is the code we have used for this.
float y = 20;
Document document = new Document();
Page page = new Page();
Table table = new Table(20, y, 200, 0);
Column c1 = table.Columns.Add(100);
Column c2 = table.Columns.Add(100);
for (int i = 0; i < 8; i++)
{
Row row = table.Rows.Add();
Cell cell1 = row.Cells.Add((i + 1).ToString() + "\n cete");
cell1.VAlign = CellVAlign.Bottom;
AreaGroup refGroup = new AreaGroup(400, 50);
string temp = "This is Link";
float xPos = 15;
float yPos = 0;
Label label = new Label(temp, xPos, yPos, 400, 20, Font.CourierBold, 12);
label.Underline = true;
Link link = new Link(xPos, yPos, Font.CourierBold.GetTextWidth(temp, 12), 20, new ceTe.DynamicPDF.UrlAction("http://www.dynamicpdf.com"));
refGroup.Add(label);
refGroup.Add(link);
Cell cell2 = row.Cells.Add(refGroup);
}
table.Height = table.GetRequiredHeight();
page.Elements.Add(table);
document.Pages.Add(page);
document.Draw(@"D:\Attachments\test.pdf");
What build of our product are you using? Please make sure that you are using the latest build of our product. You can get the latest build from our CustomerArea
by logging in using your serial number. If you are evaluating then you can get it from our website
.
Thanks,
ceTe Software Support Team.
Re: Link
Forum member · Nov 17, 2009Hi,
Thank you so much for your reply. I have ceTe.DynamicPDF.20, Version 4.0.1.20 installed on my computer.
Do I have to install the Core Suite v5.1 for .NET(Build 14406)?
Thanks,
SP
Re: Link
Support · Nov 17, 2009Hello SP,
The links will be added with respect to the page and not with respect to the cell when using our v4.0 of our product. You will have to manually calculate the X, Y position when using the v4.0 for the links.
This is supported in v5.0. Using the v5.0 of our product you can add links with respect to the cell and you do not have to do any manual calculations for its positioning.
If you are evaluating then you can try our v5.0 downloading from our website
. If you are a licensed user of v4 then you will have to do it manually or you will have to upgrade to v5.0.
Thanks,
ceTe Software Support Team.