• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

iText: How to make sure each ListItem is completely on one page?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently using iText in a small application that generates a PDF test paper with user-inputted questions. I'm using a long List with each question in a separate ListItem. However, sometimes, if the question is too long it will go onto the next A4 page (see attached image), which can be quite annoying when you are actually completing the test on paper.

Is there a way to detect if the next ListItem is too long is fit on the rest of the page, in which case the program should start writing on the next page?

Thank you very much!
CodeRanch-capture.PNG
[Thumbnail for CodeRanch-capture.PNG]
A question which is too long to fit on the rest of the first page
 
A teeny tiny vulgar attempt to get you to buy our stuff
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic