How can i get the content height of a given page with pdfbox? I have X pages, where i need to add Y elements to. Once the first page is full, it should start a new page, putting out the rest of the Y elements and of course starting another page, once the second is also full.
So: How do i determine if the page is full - aka the content height?
I have something like this:
private static void addChapters() throws IOException {
for(int i = 0; i < chapters.size(); i++) {
// if page is full, add a new page and start printing on the new page here
// Chapter Headline
// some output here...
// Data table
// some more output here
contentStream.close();
}
}
Thanks!