Posted as an answer ...
If I remember correctly, PDF uses a coordinate system that starts in the left corner of the BOTTOM page, and not at the top. Therefore, each coordinator is mistaken when you use it directly in html. You will need to convert the values.
Your pdf document should have something like document.actualheight, just subtract your value from this ....
source share