This content has been marked as final. Show 7 replies
As is documented in the PDF Reference, all coordinates relating to a PDF document have a bottom-left origin. Since SetViewRect affects the viewer and not the PDF itself, it uses a top-left origin.
You can find the PDF Reference here:
You might find the following link interesting:
Automating placement of annotations - Converting coordinates in Acrobat by Thom Parker
It describes how to deal with the "roatated" pages.
Thank you guys, both are very useful.
I just read the IAC doc and these things wasn't described too exactly. At least for me...
Now it's ok, the interesting coordinate system notice is not interesting, ignored.
Independently from this question the wrong parameter order and documentation are still alive.
Can you post your example code? Using the values 0,0,100,100 worked as expected for me.
Hm. What is your environment?
I'm using Reader 8.1 through Internet Explorer from python but this code is like VB.
ie = com.Dispatch("InternetExplorer.Application")
ie.Visible = True
ie.Document.SetCurrentHighlight(0, 0, 100, 100)
#This last line does nothing
ie.Document.SetCurrentHighlight(0, 100, 100, 0)
# But this selects a box at the lower-left corner.
>ie.Document.SetCurrentHighlight(0, 100, 100, 0)
># But this selects a box at the lower-left corner.
That's correct and as per the documentation. Top=100, Bottom=0. This
is a normal reflection of the coordinate system. Where the Y
co-ordinates have lower values at the bottom, you can expect top >
Aandi, you are almost right ;-)
The number 100 is a little bit confusing.
Try another number. For example:
ie.Document.SetCurrentHighlight(0, 50, 100, 0)
If the document is good, the result should be a horizontal rectangle, because left=0, top=50, right=100 and bottom=0.
But it is not horizontal in my case. It's vertical.
Therefore I think the right order is left=0,right=50,top=100,bottom=0.