0

I am having Libreoffice7 installed with custom python 3.8.6 in Windows. I want to use PyUNO to navigate the view cursor to a specific position based on the X, Y coordinates(of instance com.sun.star.awt.Point) in a writer document. Is there a way by which this can be achieved? I am unable to find any resource or documentation that helps. Please let me know if any other info or clarifications needed. Thank you in advance.

1 Answer 1

0

Precise positioning using points and pixels is difficult or impossible with the UNO API. The numbers seem to be unpredictable, for example https://ask.libreoffice.org/t/what-is-the-base-for-cursor-x-position-in-basic/71827.

Instead, move the cursor to a character or paragraph or object, for example with goRight().

To investigate point positioning further, take a look at this discussion on positioning a dialog in Calc: https://ask.libreoffice.org/t/dynamically-position-a-dialog/67289/39

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.