Hi,
we use some code for placing a TextBoxField on a page. We found out, that when the page has been originally scanned with a different rotation, the location of our TextBoxField is not the same on the resulting pdf. Is there a possibilty to guarantee the same location. I tried with following code. As log as rotateFactor is 0, the TextBoxField is on the correct location. But when it is 3, the location is changed.
It seems I should set the rectangle2 values with some diplacement from the original textBoxField1 rectangle values. Do you have some algorithm for calculating the new position?
int rotateFactor = pdfPage.getRotate();
TextBoxField textBoxField1 = new TextBoxField(pdfPage, new Rectangle(annotationen.getLeft() * 72 + getCorrMarginLeft()
, hight - annotationen.getTop() * 72 - annotationen.getHeight() * 72 - getCorrHeight()
, annotationen.getLeft() * 72 + (annotationen.getWidth() * 72) + getCorrWidth()
, hight - annotationen.getTop() * 72 + getCorrMarginBottom()));
if (rotateFactor > 0) {
Rectangle rectangle2 = textBoxField1.getRectangle(false);
rectangle2.setLLX(textBoxField1.getRect().getLLX());
rectangle2.setLLY(textBoxField1.getRect().getLLY());
rectangle2.setURY(textBoxField1.getRect().getURY());
rectangle2.setURX(textBoxField1.getRect().getURX());
rectangle2.rotateAngle(rotateFactor*90);
textBoxField1.setRect(rectangle2);
textBoxField1.getCharacteristics().setRotate(rotateFactor);
}