You can build on the following code that removes the empty Paragraphs from the end of document. In this case, this will also remove the empty blank page.
Document doc = new Document("E:\\Temp\\Data\\source.docx");
Section lastSec = doc.getLastSection();
Paragraph para = (Paragraph) lastSec.getBody().getLastParagraph();
while (para != null && para.toString(SaveFormat.TEXT).trim().equals("")) {
para.remove();
para = (Paragraph) lastSec.getBody().getLastParagraph();
}
doc.save("E:\\Temp\\Data\\awjava-18.12.docx");