We use iText to read the input PDF file, then add the messaging and save the output.
PdfReader reader = new PdfReader(inputFilepath);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputFilename, true));
PdfContentByte over = stamper.getOverContent(1);
over.beginText();
over.showTextAligned(align, text, x, y, angle);
...
over.endText();
stamper.close();
Is there a way to read in the PDF generated in the unit test, and then check for existing text in the correct x, y coordinates?
source
share