I detect if a document is added to a "Chunk" after adding Chunk.NEWLINE,
next Chunk is not under, but he is on the same line.
eg:
Document documento = new Document();
try {
PdfWriter.getInstance(documento, new FileOutputStream("EX.pdf"));
documento.open();
documento.add(new Chunk("E
Surely this is partly a maths question and partly a business logic question.
You can first grab the total number of pages and then loop over the
pagenumber of each page you wish to extract and if it gets over the max,
then make it the max pagenumber and stop looping to guarantee it is the last
page