Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Gilad Denneboom
After a lot of trials and tribulations I think I was able to solve this
issue... I had to go back to the lowest-level results and re-build the rect
from scratch, and it seems to work now. I'll test it some more but thanks a
lot for the tips, they put me in the right direction.

On Sat, Mar 26, 2016 at 10:47 PM, Maruan Sahyoun 
wrote:

>
> > Am 26.03.2016 um 22:38 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > I know the principle behind it. My question is how do I do that... How
> do I
> > get from the one set of coordinates to the other.
> > Would it maybe be better to rotate the rect and then convert it to quads
> > using the same method, or the other way around?
>
>
> I'd go from the rect to the quads as the quads reflect the edges of the
> rect (with some padding if you'd do it the same way as Acrobat does but
> that's not necessary). So the first step would be to get the rect correct.
>
> Try this sample for the rectangle
>
> PDRectangle position = ew PDRectangle();
> position.setLowerLeftX(82);   // llx
> position.setLowerLeftY(102);  // lly
> position.setUpperRightX(92);  // urx
> position.setUpperRightY(147); // try
>
>
> >
> > On Sat, Mar 26, 2016 at 10:28 PM, Maruan Sahyoun  >
> > wrote:
> >
> >> Hi,
> >>
> >>> Am 26.03.2016 um 22:23 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Sorry, I'm not quite following you there…
> >>>
> >>
> >>
> >> you have to draw the annotation rect as if the page is unrotated i.e.
> look
> >> at the page in portrait mode not landscape.
> >>
> >>
> >>> On Sat, Mar 26, 2016 at 10:21 PM, Maruan Sahyoun <
> sahy...@fileaffairs.de
> >>>
> >>> wrote:
> >>>
>  the Rect is more around. The upper left corner is from where you have
> to
>  calculate as this is the the lower left of the unrotated page.
> 
>  position.setLowerLeftX(82);   // llx
>  position.setLowerLeftY(102);  // lly
>  position.setUpperRightX(92);  // urx
>  position.setUpperRightY(147); // try
> 
>  BR
>  Maruan
> 
> > Am 26.03.2016 um 22:14 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > No luck, I'm afraid... The new quads array is:
> >
> 
> >>
> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
> >
> > And the resulting PDF is attached...​
> > Landscape page_highlighted.pdf
> > <
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsbElkZ3ZnVTA2eUU/view?usp=drive_web
> >
> > ​
> >
> > On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun <
> >> sahy...@fileaffairs.de>
> > wrote:
> >
> >> Hi,
> >>
> >>> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Thanks a lot for your reply, Maruan.
> >>>
> >>> I'll test it out and will update here if it worked…
> >>>
> >>
> >> if not let me know - sorry again for the delay.
> >>
> >> Maruan
> >>
> >>> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun <
>  sahy...@fileaffairs.de>
> >>> wrote:
> >>>
>  Hi Gilad,
> 
>  sorry that it took so long to answer your question.
> 
>  When drawing the annotation you have to think like you draw it on
> >> the
>  unrotated page with your pages upper left corner being the lower
> >> left
>  corner and the width and height of the annotation rect being
> >> swapped.
> 
>  With that the calculation of the quads is
> 
>  float[] quads = new float[8];
>  quads[0] = position.getLowerLeftX();
>  quads[1] = position.getLowerLeftY();
>  quads[2] = quads[0];
>  quads[3] = position.getUpperRightY();
>  quads[4] = position.getUpperRightX();
>  quads[5] = quads[1];
>  quads[6] = quads[4];
>  quads[7] = quads[3];
> 
>  Hope that helps.
> 
>  BR
>  Maruan
> 
> 
> > Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > Any luck?
> >
> > On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
> >> sahy...@fileaffairs.de>
> > wrote:
> >
> >> Hi,
> >>
> >> I'll take a look later today
> >>
> >> Maruan Sahyoun
> >>
> >>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Does that help anyone find a solution for this issue? I think
> it
> >> could
>  be
> >>> useful for more operations within PDFBox, relating to rotated
>  pages.
> >>>
> >>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com>
> >>> wrote:
> >>>
>  OK, her

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Maruan Sahyoun

> Am 26.03.2016 um 22:38 schrieb Gilad Denneboom :
> 
> I know the principle behind it. My question is how do I do that... How do I
> get from the one set of coordinates to the other.
> Would it maybe be better to rotate the rect and then convert it to quads
> using the same method, or the other way around?


I'd go from the rect to the quads as the quads reflect the edges of the rect 
(with some padding if you'd do it the same way as Acrobat does but that's not 
necessary). So the first step would be to get the rect correct.

Try this sample for the rectangle

PDRectangle position = ew PDRectangle();
position.setLowerLeftX(82);   // llx
position.setLowerLeftY(102);  // lly
position.setUpperRightX(92);  // urx
position.setUpperRightY(147); // try


> 
> On Sat, Mar 26, 2016 at 10:28 PM, Maruan Sahyoun 
> wrote:
> 
>> Hi,
>> 
>>> Am 26.03.2016 um 22:23 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Sorry, I'm not quite following you there…
>>> 
>> 
>> 
>> you have to draw the annotation rect as if the page is unrotated i.e. look
>> at the page in portrait mode not landscape.
>> 
>> 
>>> On Sat, Mar 26, 2016 at 10:21 PM, Maruan Sahyoun >> 
>>> wrote:
>>> 
 the Rect is more around. The upper left corner is from where you have to
 calculate as this is the the lower left of the unrotated page.
 
 position.setLowerLeftX(82);   // llx
 position.setLowerLeftY(102);  // lly
 position.setUpperRightX(92);  // urx
 position.setUpperRightY(147); // try
 
 BR
 Maruan
 
> Am 26.03.2016 um 22:14 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> No luck, I'm afraid... The new quads array is:
> 
 
>> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
> 
> And the resulting PDF is attached...​
> Landscape page_highlighted.pdf
> <
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsbElkZ3ZnVTA2eUU/view?usp=drive_web
> 
> ​
> 
> On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun <
>> sahy...@fileaffairs.de>
> wrote:
> 
>> Hi,
>> 
>>> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Thanks a lot for your reply, Maruan.
>>> 
>>> I'll test it out and will update here if it worked…
>>> 
>> 
>> if not let me know - sorry again for the delay.
>> 
>> Maruan
>> 
>>> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun <
 sahy...@fileaffairs.de>
>>> wrote:
>>> 
 Hi Gilad,
 
 sorry that it took so long to answer your question.
 
 When drawing the annotation you have to think like you draw it on
>> the
 unrotated page with your pages upper left corner being the lower
>> left
 corner and the width and height of the annotation rect being
>> swapped.
 
 With that the calculation of the quads is
 
 float[] quads = new float[8];
 quads[0] = position.getLowerLeftX();
 quads[1] = position.getLowerLeftY();
 quads[2] = quads[0];
 quads[3] = position.getUpperRightY();
 quads[4] = position.getUpperRightX();
 quads[5] = quads[1];
 quads[6] = quads[4];
 quads[7] = quads[3];
 
 Hope that helps.
 
 BR
 Maruan
 
 
> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> Any luck?
> 
> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
>> sahy...@fileaffairs.de>
> wrote:
> 
>> Hi,
>> 
>> I'll take a look later today
>> 
>> Maruan Sahyoun
>> 
>>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Does that help anyone find a solution for this issue? I think it
>> could
 be
>>> useful for more operations within PDFBox, relating to rotated
 pages.
>>> 
>>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com>
>>> wrote:
>>> 
 OK, here's a file that demonstrates the issue. I'm attaching the
>> original
 as well as the version highlighted using PDFBox and the one I
>> highlighted
 manually in Acrobat, for comparison purposes.
 
 The details of the highlight added in PDFBox are:
 Rect:[104.73436,751.22327,147.8024,757.2535]
 
 
>> 
 
>> 
 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
 
 I hope this is sufficient... If not, please let me know.
 ​
 Landscape page_high

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Gilad Denneboom
I know the principle behind it. My question is how do I do that... How do I
get from the one set of coordinates to the other.
Would it maybe be better to rotate the rect and then convert it to quads
using the same method, or the other way around?

On Sat, Mar 26, 2016 at 10:28 PM, Maruan Sahyoun 
wrote:

> Hi,
>
> > Am 26.03.2016 um 22:23 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > Sorry, I'm not quite following you there…
> >
>
>
> you have to draw the annotation rect as if the page is unrotated i.e. look
> at the page in portrait mode not landscape.
>
>
> > On Sat, Mar 26, 2016 at 10:21 PM, Maruan Sahyoun  >
> > wrote:
> >
> >> the Rect is more around. The upper left corner is from where you have to
> >> calculate as this is the the lower left of the unrotated page.
> >>
> >> position.setLowerLeftX(82);   // llx
> >> position.setLowerLeftY(102);  // lly
> >> position.setUpperRightX(92);  // urx
> >> position.setUpperRightY(147); // try
> >>
> >> BR
> >> Maruan
> >>
> >>> Am 26.03.2016 um 22:14 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> No luck, I'm afraid... The new quads array is:
> >>>
> >>
> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
> >>>
> >>> And the resulting PDF is attached...​
> >>> Landscape page_highlighted.pdf
> >>> <
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsbElkZ3ZnVTA2eUU/view?usp=drive_web
> >>>
> >>> ​
> >>>
> >>> On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun <
> sahy...@fileaffairs.de>
> >>> wrote:
> >>>
>  Hi,
> 
> > Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > Thanks a lot for your reply, Maruan.
> >
> > I'll test it out and will update here if it worked…
> >
> 
>  if not let me know - sorry again for the delay.
> 
>  Maruan
> 
> > On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun <
> >> sahy...@fileaffairs.de>
> > wrote:
> >
> >> Hi Gilad,
> >>
> >> sorry that it took so long to answer your question.
> >>
> >> When drawing the annotation you have to think like you draw it on
> the
> >> unrotated page with your pages upper left corner being the lower
> left
> >> corner and the width and height of the annotation rect being
> swapped.
> >>
> >> With that the calculation of the quads is
> >>
> >>  float[] quads = new float[8];
> >>  quads[0] = position.getLowerLeftX();
> >>  quads[1] = position.getLowerLeftY();
> >>  quads[2] = quads[0];
> >>  quads[3] = position.getUpperRightY();
> >>  quads[4] = position.getUpperRightX();
> >>  quads[5] = quads[1];
> >>  quads[6] = quads[4];
> >>  quads[7] = quads[3];
> >>
> >> Hope that helps.
> >>
> >> BR
> >> Maruan
> >>
> >>
> >>> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Any luck?
> >>>
> >>> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
>  sahy...@fileaffairs.de>
> >>> wrote:
> >>>
>  Hi,
> 
>  I'll take a look later today
> 
>  Maruan Sahyoun
> 
> > Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > Does that help anyone find a solution for this issue? I think it
>  could
> >> be
> > useful for more operations within PDFBox, relating to rotated
> >> pages.
> >
> > On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
>  gilad.denneb...@gmail.com>
> > wrote:
> >
> >> OK, here's a file that demonstrates the issue. I'm attaching the
>  original
> >> as well as the version highlighted using PDFBox and the one I
>  highlighted
> >> manually in Acrobat, for comparison purposes.
> >>
> >> The details of the highlight added in PDFBox are:
> >> Rect:[104.73436,751.22327,147.8024,757.2535]
> >>
> >>
> 
> >>
> 
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> >>
> >> I hope this is sufficient... If not, please let me know.
> >> ​
> >> Landscape page_highlighted in Acrobat.pdf
> >> <
> 
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >
> >> ​​
> >> Landscape page.pdf
> >> <
> 
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >
> >> ​​
> >> Landscape page_highlighted.pdf
> >> <
> 
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >
> >> ​
> >>

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Maruan Sahyoun
Hi,

> Am 26.03.2016 um 22:23 schrieb Gilad Denneboom :
> 
> Sorry, I'm not quite following you there…
> 


you have to draw the annotation rect as if the page is unrotated i.e. look at 
the page in portrait mode not landscape.


> On Sat, Mar 26, 2016 at 10:21 PM, Maruan Sahyoun 
> wrote:
> 
>> the Rect is more around. The upper left corner is from where you have to
>> calculate as this is the the lower left of the unrotated page.
>> 
>> position.setLowerLeftX(82);   // llx
>> position.setLowerLeftY(102);  // lly
>> position.setUpperRightX(92);  // urx
>> position.setUpperRightY(147); // try
>> 
>> BR
>> Maruan
>> 
>>> Am 26.03.2016 um 22:14 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> No luck, I'm afraid... The new quads array is:
>>> 
>> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
>>> 
>>> And the resulting PDF is attached...​
>>> Landscape page_highlighted.pdf
>>> <
>> https://drive.google.com/file/d/0B_eBFHMNjkhsbElkZ3ZnVTA2eUU/view?usp=drive_web
>>> 
>>> ​
>>> 
>>> On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun 
>>> wrote:
>>> 
 Hi,
 
> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> Thanks a lot for your reply, Maruan.
> 
> I'll test it out and will update here if it worked…
> 
 
 if not let me know - sorry again for the delay.
 
 Maruan
 
> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun <
>> sahy...@fileaffairs.de>
> wrote:
> 
>> Hi Gilad,
>> 
>> sorry that it took so long to answer your question.
>> 
>> When drawing the annotation you have to think like you draw it on the
>> unrotated page with your pages upper left corner being the lower left
>> corner and the width and height of the annotation rect being swapped.
>> 
>> With that the calculation of the quads is
>> 
>>  float[] quads = new float[8];
>>  quads[0] = position.getLowerLeftX();
>>  quads[1] = position.getLowerLeftY();
>>  quads[2] = quads[0];
>>  quads[3] = position.getUpperRightY();
>>  quads[4] = position.getUpperRightX();
>>  quads[5] = quads[1];
>>  quads[6] = quads[4];
>>  quads[7] = quads[3];
>> 
>> Hope that helps.
>> 
>> BR
>> Maruan
>> 
>> 
>>> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Any luck?
>>> 
>>> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
 sahy...@fileaffairs.de>
>>> wrote:
>>> 
 Hi,
 
 I'll take a look later today
 
 Maruan Sahyoun
 
> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> Does that help anyone find a solution for this issue? I think it
 could
>> be
> useful for more operations within PDFBox, relating to rotated
>> pages.
> 
> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
 gilad.denneb...@gmail.com>
> wrote:
> 
>> OK, here's a file that demonstrates the issue. I'm attaching the
 original
>> as well as the version highlighted using PDFBox and the one I
 highlighted
>> manually in Acrobat, for comparison purposes.
>> 
>> The details of the highlight added in PDFBox are:
>> Rect:[104.73436,751.22327,147.8024,757.2535]
>> 
>> 
 
>> 
 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
>> 
>> I hope this is sufficient... If not, please let me know.
>> ​
>> Landscape page_highlighted in Acrobat.pdf
>> <
 
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> 
>> ​​
>> Landscape page.pdf
>> <
 
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> 
>> ​​
>> Landscape page_highlighted.pdf
>> <
 
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> 
>> ​
>> 
>> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com> 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 no

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Gilad Denneboom
Sorry, I'm not quite following you there...

On Sat, Mar 26, 2016 at 10:21 PM, Maruan Sahyoun 
wrote:

> the Rect is more around. The upper left corner is from where you have to
> calculate as this is the the lower left of the unrotated page.
>
> position.setLowerLeftX(82);   // llx
> position.setLowerLeftY(102);  // lly
> position.setUpperRightX(92);  // urx
> position.setUpperRightY(147); // try
>
> BR
> Maruan
>
> > Am 26.03.2016 um 22:14 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > No luck, I'm afraid... The new quads array is:
> >
> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
> >
> > And the resulting PDF is attached...​
> > Landscape page_highlighted.pdf
> > <
> https://drive.google.com/file/d/0B_eBFHMNjkhsbElkZ3ZnVTA2eUU/view?usp=drive_web
> >
> > ​
> >
> > On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun 
> > wrote:
> >
> >> Hi,
> >>
> >>> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Thanks a lot for your reply, Maruan.
> >>>
> >>> I'll test it out and will update here if it worked…
> >>>
> >>
> >> if not let me know - sorry again for the delay.
> >>
> >> Maruan
> >>
> >>> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun <
> sahy...@fileaffairs.de>
> >>> wrote:
> >>>
>  Hi Gilad,
> 
>  sorry that it took so long to answer your question.
> 
>  When drawing the annotation you have to think like you draw it on the
>  unrotated page with your pages upper left corner being the lower left
>  corner and the width and height of the annotation rect being swapped.
> 
>  With that the calculation of the quads is
> 
>    float[] quads = new float[8];
>    quads[0] = position.getLowerLeftX();
>    quads[1] = position.getLowerLeftY();
>    quads[2] = quads[0];
>    quads[3] = position.getUpperRightY();
>    quads[4] = position.getUpperRightX();
>    quads[5] = quads[1];
>    quads[6] = quads[4];
>    quads[7] = quads[3];
> 
>  Hope that helps.
> 
>  BR
>  Maruan
> 
> 
> > Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > Any luck?
> >
> > On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
> >> sahy...@fileaffairs.de>
> > wrote:
> >
> >> Hi,
> >>
> >> I'll take a look later today
> >>
> >> Maruan Sahyoun
> >>
> >>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Does that help anyone find a solution for this issue? I think it
> >> could
>  be
> >>> useful for more operations within PDFBox, relating to rotated
> pages.
> >>>
> >>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com>
> >>> wrote:
> >>>
>  OK, here's a file that demonstrates the issue. I'm attaching the
> >> original
>  as well as the version highlighted using PDFBox and the one I
> >> highlighted
>  manually in Acrobat, for comparison purposes.
> 
>  The details of the highlight added in PDFBox are:
>  Rect:[104.73436,751.22327,147.8024,757.2535]
> 
> 
> >>
> 
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> 
>  I hope this is sufficient... If not, please let me know.
>  ​
>  Landscape page_highlighted in Acrobat.pdf
>  <
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >>>
>  ​​
>  Landscape page.pdf
>  <
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >>>
>  ​​
>  Landscape page_highlighted.pdf
>  <
> >>
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >>>
>  ​
> 
>  On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
>  gilad.denneb...@gmail.com> 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 <
> >> sahy

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Maruan Sahyoun
the Rect is more around. The upper left corner is from where you have to 
calculate as this is the the lower left of the unrotated page.

position.setLowerLeftX(82);   // llx
position.setLowerLeftY(102);  // lly
position.setUpperRightX(92);  // urx
position.setUpperRightY(147); // try

BR
Maruan

> Am 26.03.2016 um 22:14 schrieb Gilad Denneboom :
> 
> No luck, I'm afraid... The new quads array is:
> [104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]
> 
> And the resulting PDF is attached...​
> Landscape page_highlighted.pdf
> 
> ​
> 
> On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun 
> wrote:
> 
>> Hi,
>> 
>>> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Thanks a lot for your reply, Maruan.
>>> 
>>> I'll test it out and will update here if it worked…
>>> 
>> 
>> if not let me know - sorry again for the delay.
>> 
>> Maruan
>> 
>>> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun 
>>> wrote:
>>> 
 Hi Gilad,
 
 sorry that it took so long to answer your question.
 
 When drawing the annotation you have to think like you draw it on the
 unrotated page with your pages upper left corner being the lower left
 corner and the width and height of the annotation rect being swapped.
 
 With that the calculation of the quads is
 
   float[] quads = new float[8];
   quads[0] = position.getLowerLeftX();
   quads[1] = position.getLowerLeftY();
   quads[2] = quads[0];
   quads[3] = position.getUpperRightY();
   quads[4] = position.getUpperRightX();
   quads[5] = quads[1];
   quads[6] = quads[4];
   quads[7] = quads[3];
 
 Hope that helps.
 
 BR
 Maruan
 
 
> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> Any luck?
> 
> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
>> sahy...@fileaffairs.de>
> wrote:
> 
>> Hi,
>> 
>> I'll take a look later today
>> 
>> Maruan Sahyoun
>> 
>>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Does that help anyone find a solution for this issue? I think it
>> could
 be
>>> useful for more operations within PDFBox, relating to rotated pages.
>>> 
>>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com>
>>> wrote:
>>> 
 OK, here's a file that demonstrates the issue. I'm attaching the
>> original
 as well as the version highlighted using PDFBox and the one I
>> highlighted
 manually in Acrobat, for comparison purposes.
 
 The details of the highlight added in PDFBox are:
 Rect:[104.73436,751.22327,147.8024,757.2535]
 
 
>> 
 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
 
 I hope this is sufficient... If not, please let me know.
 ​
 Landscape page_highlighted in Acrobat.pdf
 <
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
>>> 
 ​​
 Landscape page.pdf
 <
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
>>> 
 ​​
 Landscape page_highlighted.pdf
 <
>> 
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
>>> 
 ​
 
 On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
 gilad.denneb...@gmail.com> 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 <
>> sahy...@fileaffairs.de>
> 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 <
>> gilad.denneb...@g

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Gilad Denneboom
No luck, I'm afraid... The new quads array is:
[104.73436,751.22327,104.73436,757.2535,147.8024,751.22327,147.8024,757.2535]

And the resulting PDF is attached...​
 Landscape page_highlighted.pdf

​

On Sat, Mar 26, 2016 at 9:52 PM, Maruan Sahyoun 
wrote:

> Hi,
>
> > Am 26.03.2016 um 21:49 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > Thanks a lot for your reply, Maruan.
> >
> > I'll test it out and will update here if it worked…
> >
>
> if not let me know - sorry again for the delay.
>
> Maruan
>
> > On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun 
> > wrote:
> >
> >> Hi Gilad,
> >>
> >> sorry that it took so long to answer your question.
> >>
> >> When drawing the annotation you have to think like you draw it on the
> >> unrotated page with your pages upper left corner being the lower left
> >> corner and the width and height of the annotation rect being swapped.
> >>
> >> With that the calculation of the quads is
> >>
> >>float[] quads = new float[8];
> >>quads[0] = position.getLowerLeftX();
> >>quads[1] = position.getLowerLeftY();
> >>quads[2] = quads[0];
> >>quads[3] = position.getUpperRightY();
> >>quads[4] = position.getUpperRightX();
> >>quads[5] = quads[1];
> >>quads[6] = quads[4];
> >>quads[7] = quads[3];
> >>
> >> Hope that helps.
> >>
> >> BR
> >> Maruan
> >>
> >>
> >>> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Any luck?
> >>>
> >>> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun <
> sahy...@fileaffairs.de>
> >>> wrote:
> >>>
>  Hi,
> 
>  I'll take a look later today
> 
>  Maruan Sahyoun
> 
> > Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
>  gilad.denneb...@gmail.com>:
> >
> > Does that help anyone find a solution for this issue? I think it
> could
> >> be
> > useful for more operations within PDFBox, relating to rotated pages.
> >
> > On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
>  gilad.denneb...@gmail.com>
> > wrote:
> >
> >> OK, here's a file that demonstrates the issue. I'm attaching the
>  original
> >> as well as the version highlighted using PDFBox and the one I
>  highlighted
> >> manually in Acrobat, for comparison purposes.
> >>
> >> The details of the highlight added in PDFBox are:
> >> Rect:[104.73436,751.22327,147.8024,757.2535]
> >>
> >>
> 
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> >>
> >> I hope this is sufficient... If not, please let me know.
> >> ​
> >> Landscape page_highlighted in Acrobat.pdf
> >> <
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >
> >> ​​
> >> Landscape page.pdf
> >> <
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >
> >> ​​
> >> Landscape page_highlighted.pdf
> >> <
> 
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >
> >> ​
> >>
> >> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com> 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 <
>  sahy...@fileaffairs.de>
> >>> 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 <
>  gilad.denneb...@gmail.com>:
> >
> > No one has any ideas? ...
> >
> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>  gilad.denneb...@gmail.com
> >> 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 

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Maruan Sahyoun
Hi,

> Am 26.03.2016 um 21:49 schrieb Gilad Denneboom :
> 
> Thanks a lot for your reply, Maruan.
> 
> I'll test it out and will update here if it worked…
> 

if not let me know - sorry again for the delay.

Maruan

> On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun 
> wrote:
> 
>> Hi Gilad,
>> 
>> sorry that it took so long to answer your question.
>> 
>> When drawing the annotation you have to think like you draw it on the
>> unrotated page with your pages upper left corner being the lower left
>> corner and the width and height of the annotation rect being swapped.
>> 
>> With that the calculation of the quads is
>> 
>>float[] quads = new float[8];
>>quads[0] = position.getLowerLeftX();
>>quads[1] = position.getLowerLeftY();
>>quads[2] = quads[0];
>>quads[3] = position.getUpperRightY();
>>quads[4] = position.getUpperRightX();
>>quads[5] = quads[1];
>>quads[6] = quads[4];
>>quads[7] = quads[3];
>> 
>> Hope that helps.
>> 
>> BR
>> Maruan
>> 
>> 
>>> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Any luck?
>>> 
>>> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun 
>>> wrote:
>>> 
 Hi,
 
 I'll take a look later today
 
 Maruan Sahyoun
 
> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
 gilad.denneb...@gmail.com>:
> 
> Does that help anyone find a solution for this issue? I think it could
>> be
> useful for more operations within PDFBox, relating to rotated pages.
> 
> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
 gilad.denneb...@gmail.com>
> wrote:
> 
>> OK, here's a file that demonstrates the issue. I'm attaching the
 original
>> as well as the version highlighted using PDFBox and the one I
 highlighted
>> manually in Acrobat, for comparison purposes.
>> 
>> The details of the highlight added in PDFBox are:
>> Rect:[104.73436,751.22327,147.8024,757.2535]
>> 
>> 
 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
>> 
>> I hope this is sufficient... If not, please let me know.
>> ​
>> Landscape page_highlighted in Acrobat.pdf
>> <
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> 
>> ​​
>> Landscape page.pdf
>> <
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> 
>> ​​
>> Landscape page_highlighted.pdf
>> <
 
>> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> 
>> ​
>> 
>> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com> 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 <
 sahy...@fileaffairs.de>
>>> 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 <
 gilad.denneb...@gmail.com>:
> 
> No one has any ideas? ...
> 
> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
 gilad.denneb...@gmail.com
>> 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 unsubsc

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Gilad Denneboom
Thanks a lot for your reply, Maruan.

I'll test it out and will update here if it worked...

On Sat, Mar 26, 2016 at 8:53 PM, Maruan Sahyoun 
wrote:

> Hi Gilad,
>
> sorry that it took so long to answer your question.
>
> When drawing the annotation you have to think like you draw it on the
> unrotated page with your pages upper left corner being the lower left
> corner and the width and height of the annotation rect being swapped.
>
> With that the calculation of the quads is
>
> float[] quads = new float[8];
> quads[0] = position.getLowerLeftX();
> quads[1] = position.getLowerLeftY();
> quads[2] = quads[0];
> quads[3] = position.getUpperRightY();
> quads[4] = position.getUpperRightX();
> quads[5] = quads[1];
> quads[6] = quads[4];
> quads[7] = quads[3];
>
> Hope that helps.
>
> BR
> Maruan
>
>
> > Am 14.03.2016 um 09:58 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > Any luck?
> >
> > On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun 
> > wrote:
> >
> >> Hi,
> >>
> >> I'll take a look later today
> >>
> >> Maruan Sahyoun
> >>
> >>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> Does that help anyone find a solution for this issue? I think it could
> be
> >>> useful for more operations within PDFBox, relating to rotated pages.
> >>>
> >>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com>
> >>> wrote:
> >>>
>  OK, here's a file that demonstrates the issue. I'm attaching the
> >> original
>  as well as the version highlighted using PDFBox and the one I
> >> highlighted
>  manually in Acrobat, for comparison purposes.
> 
>  The details of the highlight added in PDFBox are:
>  Rect:[104.73436,751.22327,147.8024,757.2535]
> 
> 
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> 
>  I hope this is sufficient... If not, please let me know.
>  ​
>  Landscape page_highlighted in Acrobat.pdf
>  <
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >>>
>  ​​
>  Landscape page.pdf
>  <
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >>>
>  ​​
>  Landscape page_highlighted.pdf
>  <
> >>
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >>>
>  ​
> 
>  On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
>  gilad.denneb...@gmail.com> 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 <
> >> sahy...@fileaffairs.de>
> > 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 <
> >> gilad.denneb...@gmail.com>:
> >>>
> >>> No one has any ideas? ...
> >>>
> >>> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com
>  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: users-unsubscr...@pdfbox.apache.org
> >> For additional commands, e-mail: users-h...@pdfbox.apache.org
> >>
> >>
> >
> 
> >>
> >> -

Re: Rotating a new annotation to match the page's rotation

2016-03-26 Thread Maruan Sahyoun
Hi Gilad,

sorry that it took so long to answer your question. 

When drawing the annotation you have to think like you draw it on the unrotated 
page with your pages upper left corner being the lower left corner and the 
width and height of the annotation rect being swapped.

With that the calculation of the quads is

float[] quads = new float[8];
quads[0] = position.getLowerLeftX();
quads[1] = position.getLowerLeftY();
quads[2] = quads[0];
quads[3] = position.getUpperRightY();
quads[4] = position.getUpperRightX();
quads[5] = quads[1];
quads[6] = quads[4];
quads[7] = quads[3]; 

Hope that helps.

BR
Maruan


> Am 14.03.2016 um 09:58 schrieb Gilad Denneboom :
> 
> Any luck?
> 
> On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun 
> wrote:
> 
>> Hi,
>> 
>> I'll take a look later today
>> 
>> Maruan Sahyoun
>> 
>>> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
>> gilad.denneb...@gmail.com>:
>>> 
>>> Does that help anyone find a solution for this issue? I think it could be
>>> useful for more operations within PDFBox, relating to rotated pages.
>>> 
>>> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com>
>>> wrote:
>>> 
 OK, here's a file that demonstrates the issue. I'm attaching the
>> original
 as well as the version highlighted using PDFBox and the one I
>> highlighted
 manually in Acrobat, for comparison purposes.
 
 The details of the highlight added in PDFBox are:
 Rect:[104.73436,751.22327,147.8024,757.2535]
 
 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
 
 I hope this is sufficient... If not, please let me know.
 ​
 Landscape page_highlighted in Acrobat.pdf
 <
>> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
>>> 
 ​​
 Landscape page.pdf
 <
>> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
>>> 
 ​​
 Landscape page_highlighted.pdf
 <
>> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
>>> 
 ​
 
 On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
 gilad.denneb...@gmail.com> 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 <
>> sahy...@fileaffairs.de>
> 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 <
>> gilad.denneb...@gmail.com>:
>>> 
>>> No one has any ideas? ...
>>> 
>>> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>> gilad.denneb...@gmail.com
 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: users-unsubscr...@pdfbox.apache.org
>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>> 
>> 
> 
 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>> 
>> 


-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Rotating a new annotation to match the page's rotation

2016-03-14 Thread Gilad Denneboom
Any luck?

On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun 
wrote:

> Hi,
>
> I'll take a look later today
>
> Maruan Sahyoun
>
> > Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > Does that help anyone find a solution for this issue? I think it could be
> > useful for more operations within PDFBox, relating to rotated pages.
> >
> > On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
> gilad.denneb...@gmail.com>
> > wrote:
> >
> >> OK, here's a file that demonstrates the issue. I'm attaching the
> original
> >> as well as the version highlighted using PDFBox and the one I
> highlighted
> >> manually in Acrobat, for comparison purposes.
> >>
> >> The details of the highlight added in PDFBox are:
> >> Rect:[104.73436,751.22327,147.8024,757.2535]
> >>
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> >>
> >> I hope this is sufficient... If not, please let me know.
> >> ​
> >> Landscape page_highlighted in Acrobat.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >
> >> ​​
> >> Landscape page.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >
> >> ​​
> >> Landscape page_highlighted.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >
> >> ​
> >>
> >> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com> 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 <
> sahy...@fileaffairs.de>
> >>> 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 <
>  gilad.denneb...@gmail.com>:
> >
> > No one has any ideas? ...
> >
> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>  gilad.denneb...@gmail.com
> >> 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: users-unsubscr...@pdfbox.apache.org
>  For additional commands, e-mail: users-h...@pdfbox.apache.org
> 
> 
> >>>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
>
>


Re: Rotating a new annotation to match the page's rotation

2016-03-08 Thread Gilad Denneboom
Thanks, Maruan... Looking forward to your findings.

On Mon, Mar 7, 2016 at 10:13 AM, Maruan Sahyoun 
wrote:

> Hi,
>
> I'll take a look later today
>
> Maruan Sahyoun
>
> > Am 07.03.2016 um 09:50 schrieb Gilad Denneboom <
> gilad.denneb...@gmail.com>:
> >
> > Does that help anyone find a solution for this issue? I think it could be
> > useful for more operations within PDFBox, relating to rotated pages.
> >
> > On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom <
> gilad.denneb...@gmail.com>
> > wrote:
> >
> >> OK, here's a file that demonstrates the issue. I'm attaching the
> original
> >> as well as the version highlighted using PDFBox and the one I
> highlighted
> >> manually in Acrobat, for comparison purposes.
> >>
> >> The details of the highlight added in PDFBox are:
> >> Rect:[104.73436,751.22327,147.8024,757.2535]
> >>
> >>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
> >>
> >> I hope this is sufficient... If not, please let me know.
> >> ​
> >> Landscape page_highlighted in Acrobat.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsRWdYZEdFbFBPYVU/view?usp=drive_web
> >
> >> ​​
> >> Landscape page.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsLXd5T1RKUVl4M00/view?usp=drive_web
> >
> >> ​​
> >> Landscape page_highlighted.pdf
> >> <
> https://drive.google.com/file/d/0B_eBFHMNjkhsQm1MZ01TTlZSSU0/view?usp=drive_web
> >
> >> ​
> >>
> >> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
> >> gilad.denneb...@gmail.com> 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 <
> sahy...@fileaffairs.de>
> >>> 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 <
>  gilad.denneb...@gmail.com>:
> >
> > No one has any ideas? ...
> >
> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>  gilad.denneb...@gmail.com
> >> 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: users-unsubscr...@pdfbox.apache.org
>  For additional commands, e-mail: users-h...@pdfbox.apache.org
> 
> 
> >>>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
>
>


Re: Rotating a new annotation to match the page's rotation

2016-03-07 Thread Maruan Sahyoun
Hi,

I'll take a look later today

Maruan Sahyoun

> Am 07.03.2016 um 09:50 schrieb Gilad Denneboom :
> 
> Does that help anyone find a solution for this issue? I think it could be
> useful for more operations within PDFBox, relating to rotated pages.
> 
> On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom 
> wrote:
> 
>> OK, here's a file that demonstrates the issue. I'm attaching the original
>> as well as the version highlighted using PDFBox and the one I highlighted
>> manually in Acrobat, for comparison purposes.
>> 
>> The details of the highlight added in PDFBox are:
>> Rect:[104.73436,751.22327,147.8024,757.2535]
>> 
>> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
>> 
>> I hope this is sufficient... If not, please let me know.
>> ​
>> Landscape page_highlighted in Acrobat.pdf
>> 
>> ​​
>> Landscape page.pdf
>> 
>> ​​
>> Landscape page_highlighted.pdf
>> 
>> ​
>> 
>> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
>> gilad.denneb...@gmail.com> 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 
>>> 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 <
 gilad.denneb...@gmail.com>:
> 
> No one has any ideas? ...
> 
> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
 gilad.denneb...@gmail.com
>> 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: users-unsubscr...@pdfbox.apache.org
 For additional commands, e-mail: users-h...@pdfbox.apache.org
 
 
>>> 
>> 

-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Rotating a new annotation to match the page's rotation

2016-03-07 Thread Gilad Denneboom
Does that help anyone find a solution for this issue? I think it could be
useful for more operations within PDFBox, relating to rotated pages.

On Tue, Mar 1, 2016 at 2:17 PM, Gilad Denneboom 
wrote:

> OK, here's a file that demonstrates the issue. I'm attaching the original
> as well as the version highlighted using PDFBox and the one I highlighted
> manually in Acrobat, for comparison purposes.
>
> The details of the highlight added in PDFBox are:
> Rect:[104.73436,751.22327,147.8024,757.2535]
>
> Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]
>
> I hope this is sufficient... If not, please let me know.
> ​
>  Landscape page_highlighted in Acrobat.pdf
> 
> ​​
>  Landscape page.pdf
> 
> ​​
>  Landscape page_highlighted.pdf
> 
> ​
>
> On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom <
> gilad.denneb...@gmail.com> 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 
>> 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 <
>>> gilad.denneb...@gmail.com>:
>>> >
>>> > No one has any ideas? ...
>>> >
>>> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>>> gilad.denneb...@gmail.com
>>> >> 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: users-unsubscr...@pdfbox.apache.org
>>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>>>
>>>
>>
>


Re: Rotating a new annotation to match the page's rotation

2016-03-01 Thread Gilad Denneboom
OK, here's a file that demonstrates the issue. I'm attaching the original
as well as the version highlighted using PDFBox and the one I highlighted
manually in Acrobat, for comparison purposes.

The details of the highlight added in PDFBox are:
Rect:[104.73436,751.22327,147.8024,757.2535]
Quads:[104.73436,755.2535,147.8024,755.2535,104.73436,749.22327,147.8024,749.22327]

I hope this is sufficient... If not, please let me know.
​
 Landscape page_highlighted in Acrobat.pdf

​​
 Landscape page.pdf

​​
 Landscape page_highlighted.pdf

​

On Wed, Feb 24, 2016 at 2:30 PM, Gilad Denneboom 
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 
> 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 <
>> gilad.denneb...@gmail.com>:
>> >
>> > No one has any ideas? ...
>> >
>> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
>> gilad.denneb...@gmail.com
>> >> 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: users-unsubscr...@pdfbox.apache.org
>> For additional commands, e-mail: users-h...@pdfbox.apache.org
>>
>>
>


Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Tilman Hausherr

Am 24.02.2016 um 09:34 schrieb Gilad Denneboom:

No one has any ideas? ...


I don't know of a utility. I assume you need to use AffineTransform math 
to calculate the coordinates, i.e. a rotation and a translation on one 
axis. Note that rotations always go around the 0 point, that's why you 
need the transation.



Tilman


On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom 
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: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Karl Heinz Kremer
I ended up with a transformation that I applied to the coordinates of my
unrotated annotation.


Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Gilad Denneboom
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  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 <
> gilad.denneb...@gmail.com>
> 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 
> > 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 <
> > > gilad.denneb...@gmail.com>:
> > > >
> > > > No one has any ideas? ...
> > > >
> > > > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
> > > gilad.denneb...@gmail.com
> > > >> 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: users-unsubscr...@pdfbox.apache.org
> > > For additional commands, e-mail: users-h...@pdfbox.apache.org
> > >
> > >
> >
>


Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Karl Heinz Kremer
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 
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 
> 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 <
> > gilad.denneb...@gmail.com>:
> > >
> > > No one has any ideas? ...
> > >
> > > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
> > gilad.denneb...@gmail.com
> > >> 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: users-unsubscr...@pdfbox.apache.org
> > For additional commands, e-mail: users-h...@pdfbox.apache.org
> >
> >
>


Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Gilad Denneboom
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 
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 <
> gilad.denneb...@gmail.com>:
> >
> > No one has any ideas? ...
> >
> > On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom <
> gilad.denneb...@gmail.com
> >> 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: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
>
>


Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Maruan Sahyoun
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 :
> 
> No one has any ideas? ...
> 
> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom > 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: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Andreas Lehmkühler
Hi,

> Gilad Denneboom  hat am 24. Februar 2016 um 09:34
> geschrieben:
> 
> 
> No one has any ideas? ...
> 
> On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom  > 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...
I'm not an annotation expert, but according to the spec both the Rect and the
QuadPoints values are specified in default user space which doesn't include any
rotation or scaling. But I have no clue where to put these information instead.
Can you create a sample pdf with such an annotation using acrobat or something
similar so that we can have a look how it looks like?

> > Gilad

BR
Andreas

-
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



Re: Rotating a new annotation to match the page's rotation

2016-02-24 Thread Gilad Denneboom
No one has any ideas? ...

On Sun, Feb 21, 2016 at 12:30 AM, Gilad Denneboom  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
>


Rotating a new annotation to match the page's rotation

2016-02-20 Thread Gilad Denneboom
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