我对 iText 2.1.7 也有同样的问题,这让我发疯。jrubins 描述的顺序对我不起作用,它产生了凹注释。最终我找到了正确的顺序,即 lr > ll > ur > ul 。
/*
* PDF Specification Order - results in broken annotation
*
* 7,8 5, 6
* (x,y)___________(x,y)
* | |
* | |
* |___________|
* (x,y) (x,y)
* 1, 2 3, 4
*/
/*
* Concave order - results in working, but concave annotation; don't know why
*
* 5, 6 7, 8
* (x,y)___________(x,y)
* | |
* | |
* |___________|
* (x,y) (x,y)
* 1, 2 3, 4
*/
/*
* Convex order - this is the one working like expected:
*
* 7,8 5, 6
* (x,y)___________(x,y)
* | |
* | |
* |___________|
* (x,y) (x,y)
* 3, 4 1, 2
*/
float[] quad = { rect.getRight(), rect.getBottom(), rect.getLeft(),rect.getBottom(), rect.getRight(), rect.getTop(),
rect.getLeft(), rect.getTop() };