I’m searching a way to check my new PDF for a specific String on every page. The idea is to go on every page and if project name is missing from the page to add it (before saving the pdf – doc.save(new FileOutputStream(new File(pathToFile))); I already tried: document.save(new FileOutputStream(new File(pathToFile))); PDDocument document = PDDocument.load(new File(pathToFile)); the result is : Hello