You have a syntax problem. Text state in PDF is marked with BT
and ET
. These operators are added using the beginText()
and endText()
methods. You have a BT
, but no ET
. Adobe Reader is more strict than the other viewers (that's why I prefer Adobe Reader over all other viewers: people should respect the syntax when writing code).
Add the following line before pdfStamper.close();
canvas.endText();
Better yet, read my book and you'll find out you can reduce the complexity of your code by using ColumnText.showTextAligned()
.