Print Page | Close Window

Tables in PDF spanning several pages

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1573
Printed Date: 11 May 25 at 5:22PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Tables in PDF spanning several pages
Posted By: stakon
Subject: Tables in PDF spanning several pages
Date Posted: 16 Sep 10 at 10:57AM
Hi all,


I have some really lengthy tables i want to put in a PDF.
The documentation on tables notes that DrawTableRows will only draw as much of a table as it fits in the current page.

Is there any alternative? Some function that continues drawing my table across several pages?
If not, is there any trick some of you have used to make this happen?

Thanx in advance,

stakon.



Replies:
Posted By: Rowan
Date Posted: 20 Oct 10 at 2:21PM
Hi Stakon,

Sure, you can draw a table across multiple pages using DrawTableRows. 

When you call the DrawTableRows function there is a 'Height' parameter that will determine the area in which table rows can be drawn. If the rows being drawn exceed that area, then the DrawTableRows function will return the number of the last drawn row. This information can be used as a starting point for drawing the next row on the second page. When you call this function you don't have to start at row 1, you can start at row 101 if you want. Your table will still be in memory after DrawTableRows finishes on the first page.

SelectPage(1)
DrawTableRows
SelectPage(2)
DrawTableRows
SelectPage(3)
DrawTableRows

You just keep doing this until you haven't got any more rows in your table to draw.

Cheers,
- Rowan.


Posted By: pdfOakleaf
Date Posted: 24 Oct 10 at 12:30AM
sorry if this is a daft question but I've only just started with this library

SelectPage(1)
DrawTableRows

how do you know which rows have been drawn and which are still to be rendered?


Many thanks
Phil



Posted By: pdfOakleaf
Date Posted: 24 Oct 10 at 12:35AM
Or is it just a case that I just have to work out how many rows will fit on the first page, render them,
then add a new page and continue the rendering until I reach the end of the table.

I'm quite happy to do that unless there's an elegant solution.

Thanks Again (great product by the way)
Phil


Posted By: pdfOakleaf
Date Posted: 24 Oct 10 at 12:59AM
having read the documentation for DrawTableRows more thoroughly I have worked this out

It's a very impressive  libary.

Phil
(next time I'll read more and post less)


Posted By: Rowan
Date Posted: 26 Oct 10 at 9:30PM
Great -- I'm glad to hear that you were able to resolve the issue. Thanks for keeping us updated.

Cheers,
- Rowan.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk