Bookmarks in Table with Overflow

Bookmarks in Table with Overflow

Forum member · May 13, 2010
Hi, I'm using version 6.0 of DynamicPDF Merger to generate a PDF file. The PDF that is generated has a single table element, containing thousands of rows. I've coded the app so that the table overflows onto dozens of pages. What I'm trying to do now is add bookmarks to specific rows within the table, or at least to the pages on which those rows reside. The paging is handled automatically by the overflow functionality in DynamicPDF, so I don't know which pages the rows end up on. What is the best way to accomplish this type of bookmarking? FYI - When I try to bookmark specific rows in the table, the bookmarks just take me to the beginning of the table on page 1. Thanks, Todd

Re: Bookmarks in Table with Overflow

Support · May 14, 2010
Hello Todd, You will have to know ahead of time what page the bookmark should go to. So maybe you will have to search for some specific text in the Table and find out on what page it resides and use that when creating bookmarks. You will need to do calculations to find out how many rows fit on the page after you have determined the row number for the text to which you need the bookmark. There is nothing in the API that can give you the page number directly for the search text. Thanks, ceTe Software Support Team

Re: Bookmarks in Table with Overflow

Forum member · May 14, 2010
I've actually been trying a few workarounds like that. One method was to loop through the table, and try to determine how many rows will display on each page. The problem with this approach is that the GetVisibleRowCount() method only shows me how many records will appear on the first page. With cell wrapping, this count will not necessarily be the same for subsequent pages. How can I determine which pages particular rows will be displayed on? Is there a way to search through the table and determine this? Or will I need to use the ActualRowHeight to calculate how many rows will end up fitting on each page? Thanks, Todd

Re: Bookmarks in Table with Overflow

Support · May 14, 2010
Hello Todd, It is not possible to find out the page number using the row of the table present in the page. You may have to track it by using a work around which is suitable for your need. You can use the GetVisibleRowCount to get the number of visible rows in the given dimensions of the table. You can use this on overflow table also. You may also track the rows by actual row height. Depending on your requirement you can use some work around. Thanks, ceTe Software Support Team.

Re: Bookmarks in Table with Overflow

Forum member · May 14, 2010
I would be fine with using the GetVisibleRowCount() method as a workaround. My problem is that it doesn't seem to work. When I apply it to the table or the overflow table, it only gives me the number of rows displayed on Page 1, not any other pages. For example, my sample application has 5000 records, each time I apply the GetVisibleRowCounts() method to the table or the overflow table, I always get 31 rows visible. This is true for the first page, but not necessarily for subsequent pages. FYI - I'm seeing a similar issue when I check the row count of the overflow table (I create an overflow table using table.GetOverflowRows()). If I check the row count on the overflow table, it is always 5000 (which is the total rows in the entire table). Can you please see if these are bugs? Below is some example code. The BuildTable() method creates the table, and populates it with 5000 rows of data. When I put a breakpoint on the overflowCount variable, it always says 5000. When I put a breakpoint on the visibleCount variable it always say 31. Thanks, Todd ceTe.DynamicPDF.PageElements.Table2 tb = BuildTable(document); do { tb = AddTableToPage(document, tb); ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(PageSize.Letter); if (table != null) { page.Elements.Add(table); } document.Pages.Add(page); int visibleCount = tb.GetVisibleRowCount(); tb = tb.GetOverflowRows(); int overflowCount = tb.Rows.Count; } while (tb != null);

Re: Bookmarks in Table with Overflow

Support · May 14, 2010
Hello Todd, We will do some testing on our end and get back to you with the results on Monday. Thanks,c ceTe Software Support Team

Re: Bookmarks in Table with Overflow

Forum member · May 14, 2010
Thank you.

Re: Bookmarks in Table with Overflow

Support · May 17, 2010
Hello, The GetVisibleRowCount method is working fine with the overflow table without any problem. We do have a sample code for this. Please send an email to our [^a|mailto:support@cete.com|Support Team^] so that they can send you the example. If you are still having a problem then please let us know what exact problem are you having? Can you please send over a sample code which can recreate this error to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further? Thanks, ceTe Software Support Team.