I always struggle with the y-coordinates in drawing
I am working on creating a PDFdocument. The doc is simple with a category title and a table below it, followed by another title and table, and so on
I set my yCoord at the top, add in the necessary spacing between before drawing the next piece. This document is different from others I’ve done previously as it has a series of tables. In the screenshot below, this doc has repeated tables with 7 rows + 1 header. It won’t always be a 7-row table. Could be more or less. I have managed to calculate the size of the table based on number of rows in order to display the next title + table. However, the problem I am running into is when the last table on the page goes onto the following page, my yCoord is confused and then starts the next page with a lot of whitespace on the current one
Here is how I handle going to the next page:
if yCoord > d.PageHeight - 50 then
g.NextPage
'reset yCoord
yCoord = 50
'start the next title + table combo and continue
Here is what it currently looks like:
Any advice? Is there a way to identify if a new page is auto created from the last table?
4 posts - 2 participants