Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
GetTableCellDblProperty |
Post Reply |
Author | |
mdgodfrey
Team Player Joined: 09 Jul 13 Location: Utah Status: Offline Points: 23 |
Post Options
Thanks(0)
Posted: 10 Jun 15 at 6:54PM |
I am trying to draw a checkbox (unicode character $2610 or $2611) into a table cell.
I originally tried using SetTableCellContent but can't seem to find a way to get the HTML to work. So my latest attempt is to use GetTableCellDblProperty using Tag 101 & 102 to get the Left and Top of the cell. Left wants to return 0. Not helpful since the cell is in the middle of the page. Top wants to return a 279.8 which is at the bottom of the page. Either way niether Left of Top return a value that is where the cell is. Is that what it is intended to do? Any suggestions at this point will be greatly appreciated. |
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
Hi mdgodfrey,
Yes, it looks like there's an issue there. I'm seeing some unhelpful results on my end. I see one of my colleagues has already lodged a case for this in the bug tracker, I'll bump up the priority. Cheers, - Rowan.
|
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(1)
|
Actually, turns out it is not a bug, but unclear documentation. The GetTableCellDblProperty function needs to be called after the DrawTableRows function when you want to get the Left/Top/Width/Height values. All of the other returned values should return correctly if GetTableCellDblProperty earlier in the code. Doing that will give you the results you expect. We will update the function reference to make this clearer. Apologies for the confusion.
Here's some sample code: // Set the page size of the new document DPL.SetPageSize("Letter"); // Create the table and specify the number of rows and columns int tableID = DPL.CreateTable(5, 5); // Specify color and width of borders DPL.SetTableBorderColor(tableID, 0, 0.3, 0.204, 0); DPL.SetTableBorderWidth(tableID, 0, 0.2); // Specify table row height and table column width DPL.SetTableRowHeight(tableID, 1, 5, 0); DPL.SetTableColumnWidth(tableID, 1, 5, 100); // Specify a background color for the column headers DPL.SetTableCellBackgroundColor(tableID, 1, 1, 1, 5, 0.3, 0.7, 1.0); DPL.SetTableCellAlignment(tableID, 1, 1, 1, 5, 4); // Setup the column headers and content for the first row DPL.SetTableCellContent(tableID, 1, 1, "<b>This Week</b>"); DPL.SetTableCellContent(tableID, 1, 2, "<b>Last Week</b>"); DPL.SetTableCellContent(tableID, 1, 3, "<b>Artist Name</b>"); DPL.SetTableCellContent(tableID, 1, 4, "<b>Peak</b>"); DPL.SetTableCellContent(tableID, 1, 5, "<b>Weeks On</b>"); // Insert the content for the second row DPL.SetTableCellContent(tableID, 2, 1, "1"); DPL.SetTableCellContent(tableID, 2, 2, "1"); DPL.SetTableCellContent(tableID, 2, 3, "<b>The Black Eyed Peas</b><br>Boom Boom Pow"); DPL.SetTableCellContent(tableID, 2, 4, "<b>1</b>"); DPL.SetTableCellContent(tableID, 2, 5, "<b>11</b>"); // Insert the content for the third row DPL.SetTableCellContent(tableID, 3, 1, "2"); DPL.SetTableCellContent(tableID, 3, 2, "3"); DPL.SetTableCellContent(tableID, 3, 3, "<b>Missy Higgins</b><br>Life is a rainbow"); DPL.SetTableCellContent(tableID, 3, 4, "<b>2</b>"); DPL.SetTableCellContent(tableID, 3, 5, "<b>8</b>"); // Insert the content for the fourth row DPL.SetTableCellContent(tableID, 4, 1, "3"); DPL.SetTableCellContent(tableID, 4, 2, "2"); DPL.SetTableCellContent(tableID, 4, 3, "<b>Silverchair</b><br>The Door"); DPL.SetTableCellContent(tableID, 4, 4, "<b>3</b>"); DPL.SetTableCellContent(tableID, 4, 5, "<b>7</b>"); // Insert the content for the fourth row DPL.SetTableCellContent(tableID, 5, 1, "4"); DPL.SetTableCellContent(tableID, 5, 2, "4"); DPL.SetTableCellContent(tableID, 5, 3, "<b>Rolling Stones</b><br>Sweet Virginia"); DPL.SetTableCellContent(tableID, 5, 4, "<b>4</b>"); DPL.SetTableCellContent(tableID, 5, 5, "<b>19</b>"); // Draw the table onto the document DPL.SetOrigin(1); DPL.DrawTableRows(tableID, 50, 50, 400, 1, 0); double cellPosLeft = DPL.GetTableCellDblProperty(tableID, 5, 1, 101); double cellPosTop = DPL.GetTableCellDblProperty(tableID, 5, 1, 102); double cellPosWidth = DPL.GetTableCellDblProperty(tableID, 5, 1, 103); double cellPosHeight = DPL.GetTableCellDblProperty(tableID, 5, 1, 104); Console.WriteLine("Left: " + Convert.ToString(cellPosLeft)); Console.WriteLine("Top: " + Convert.ToString(cellPosTop)); Console.WriteLine("Height: " + Convert.ToString(cellPosHeight)); Console.WriteLine("Width: " + Convert.ToString(cellPosWidth)); // Save the document to disk DPL.SaveToFile("table.pdf"); Edited by Rowan - 24 Jun 15 at 3:40PM |
|
mdgodfrey
Team Player Joined: 09 Jul 13 Location: Utah Status: Offline Points: 23 |
Post Options
Thanks(0)
|
That helps.
Thanks!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store