You're using PdfWriter
which involves rotating the page and rotating the table you're adding on top of that page. You can avoid this problem, by adding the table using PdfStamper
. In this case, you can just add the table and if the rotation setting of the page is OK, the table will automatically be rotated too, unless you use the following line:
stamper.setRotateContents(false);
By default, the extra content will have the same rotation of the page.