Did you create a generic converter, or did you just hard-code the results you got from manually rotating the page? I'm sure it's possible to abstract this transformation to a formula that could be applied to the quads to rotate them so that they fit the page's rotation. I just can't seem to figure it out... I actually think that the Matrix2D object in Acrobat's JavaScript does that, but it's too opaque for me to figure out how it works, exactly. I can post the source code for it, if anyone is interested.
On Wed, Feb 24, 2016 at 3:27 PM, Karl Heinz Kremer <[email protected]> wrote: > I came up with a solution for such a problem in a previous job (which means > I don't have access to the code anymore). The process I used was to create > test documents in all rotations, with annotations in all four rotations in > Adobe Acrobat. I then analyzed the files and came up with a transformation > for every case. I then just used a switch statement for the four different > page rotations to place my annotation in the correct spot. > > Hope that helps, > > Karl Heinz > > On Wed, Feb 24, 2016 at 8:30 AM, Gilad Denneboom < > [email protected]> > wrote: > > > It's a highlight. > > > > Let me give you the background. I'm using a variation on > PrintTextLocation > > to find the locations I want to highlight and then add them. As I wrote, > it > > works very well in pages with zero rotation, but the results are skewed > > when the pages are rotated. > > What I mean by skewed is that they appear on the location of the page > where > > the text would have have been had it not been rotated, if that makes > sense. > > I'll try to set up a simple example that demonstrates this issue and > share > > it. > > > > On Wed, Feb 24, 2016 at 1:34 PM, Maruan Sahyoun <[email protected]> > > wrote: > > > > > Hi, > > > > > > what type of annotation are you trying to put on the page. I could > create > > > a little sample placing an annotation at the (visual) upper left corner > > of > > > a portrait and landscape page. > > > > > > BR > > > Maruan > > > > > > > Am 24.02.2016 um 09:34 schrieb Gilad Denneboom < > > > [email protected]>: > > > > > > > > No one has any ideas? ... > > > > > > > > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom < > > > [email protected] > > > >> wrote: > > > > > > > >> Hi all, > > > >> > > > >> Hoping someone can help me with this issue... > > > >> I have a tool that adds new highlight annotations to a page. It > works > > > very > > > >> well, except for when the page is rotated. I know I need to apply a > > > >> transformation to my rect and/or quads to get them to match the > > rotated > > > >> user space, but I just can't get it to work. > > > >> Is there a utility in PDFBox (I'm using 1.8.11 at the moment) that > can > > > >> help me perform this transformation so I can place my annotations at > > the > > > >> right location on these pages? > > > >> > > > >> Thanks a lot in advance for any helpful tips... > > > >> > > > >> Gilad > > > >> > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > >

