I am struggling to add annotations to a pdf document that has been zoomed in iOS.
I only get the coordinates of the screen rather than the document on touch, so the positioning is wrong.
Is there a function that returns the true document coordinates where the user has clicked/touched?
Normally you would use the Tools framework, as this takes care of everything for you.
If don’t want to use it, you should still use the code there as a guideline for writing your own.
In particular the Tools code shows how to user PDFViewCtrl ConvScreenPtToPagePt
Tools code also shows how to acquire and release a Write Lock, which you need to do if the document is also being viewed. If you don’t get the write lock you could cause undefined behaviour.