This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See jsp pages.

I've searched on pagination, but haven't seen anything that relates to my needs. Can anyone send me in the right direction for something like this?


author & internet detective
Posts: 37874
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to decide where a logical breaking point is. Do you want to break on paragraphs? sentences? words? ...

Then keep adding to a data structure until a page is almost full. This will probably be based on the number of characters. When you can't add the next word/sentence/paragraph/ to the page, it is time for a page break.

If this is an online article, you have more slack and can break on paragraphs. If it is a printed article, you would want to fill up the page and use a words or sentences.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!