Get coordinates of mouse pointer over PDF in Python?How to get the current time in PythonGetting the last element of a list in PythonHow do I get the number of elements in a list in Python?How do I get a Graphic2D object to follow a mouse pointer exactly in Java?Converting mouse coordinates to label coordinates in QtGetting World Coordinates with mouse in pygame.NET MVC pdf collect mouse click coordinatesUse mouse coordinates in form onlyGet pixel coordinate inside an image opposed to mouse / cursor position on screenPixels to PDF coordinates?
Is exact Kanji stroke length important?
Why not increase contact surface when reentering the atmosphere?
How many times can American Tourist re-enter UK in same 6 month period?
How to write papers efficiently when English isn't my first language?
How does Loki do this?
Sort a list by elements of another list
Is there a good way to store credentials outside of a password manager?
Is this version of a gravity generator feasible?
How to draw lines on a tikz-cd diagram
How can a function with a hole (removable discontinuity) equal a function with no hole?
You cannot touch me, but I can touch you, who am I?
Failed to fetch jessie backports repository
Italian words for tools
How does it work when somebody invests in my business?
What does "I’d sit this one out, Cap," imply or mean in the context?
Type int? vs type int
Class Action - which options I have?
Why is Lord Kartikeya called 'Devasenapati'?
What is the intuitive meaning of having a linear relationship between the logs of two variables?
What is paid subscription needed for in Mortal Kombat 11?
Did Dumbledore lie to Harry about how long he had James Potter's invisibility cloak when he was examining it? If so, why?
How to escape string to filename? It is in backup a file append date
How did Doctor Strange see the winning outcome in Avengers: Infinity War?
Why Were Madagascar and New Zealand Discovered So Late?
Get coordinates of mouse pointer over PDF in Python?
How to get the current time in PythonGetting the last element of a list in PythonHow do I get the number of elements in a list in Python?How do I get a Graphic2D object to follow a mouse pointer exactly in Java?Converting mouse coordinates to label coordinates in QtGetting World Coordinates with mouse in pygame.NET MVC pdf collect mouse click coordinatesUse mouse coordinates in form onlyGet pixel coordinate inside an image opposed to mouse / cursor position on screenPixels to PDF coordinates?
I have a need to get the x/y coordinates from a PDF using the mouse pointer. I need to show a PDF to the user, then collect the x/y coords of the mouse pointer when they click the mouse button.
So if this file was displayed, the user could position the mouse over the top-left corner of the "Accelio" logo and clicked the mouse button, the code would return something like "50, 100", representing the X and Y of the mouse pointer location from the top-left (0,0) of the document.
The coordinates need to be the coordinates of the PDF, not the screen. I need to be able to use the coordinates that come in to then write some text or add an image to that PDF using PyMuPDF in some other code (which I already have working).
Is there a way to do that in TKinter or something else?
Thanks!
python pdf tkinter coordinates
add a comment |
I have a need to get the x/y coordinates from a PDF using the mouse pointer. I need to show a PDF to the user, then collect the x/y coords of the mouse pointer when they click the mouse button.
So if this file was displayed, the user could position the mouse over the top-left corner of the "Accelio" logo and clicked the mouse button, the code would return something like "50, 100", representing the X and Y of the mouse pointer location from the top-left (0,0) of the document.
The coordinates need to be the coordinates of the PDF, not the screen. I need to be able to use the coordinates that come in to then write some text or add an image to that PDF using PyMuPDF in some other code (which I already have working).
Is there a way to do that in TKinter or something else?
Thanks!
python pdf tkinter coordinates
1
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01
add a comment |
I have a need to get the x/y coordinates from a PDF using the mouse pointer. I need to show a PDF to the user, then collect the x/y coords of the mouse pointer when they click the mouse button.
So if this file was displayed, the user could position the mouse over the top-left corner of the "Accelio" logo and clicked the mouse button, the code would return something like "50, 100", representing the X and Y of the mouse pointer location from the top-left (0,0) of the document.
The coordinates need to be the coordinates of the PDF, not the screen. I need to be able to use the coordinates that come in to then write some text or add an image to that PDF using PyMuPDF in some other code (which I already have working).
Is there a way to do that in TKinter or something else?
Thanks!
python pdf tkinter coordinates
I have a need to get the x/y coordinates from a PDF using the mouse pointer. I need to show a PDF to the user, then collect the x/y coords of the mouse pointer when they click the mouse button.
So if this file was displayed, the user could position the mouse over the top-left corner of the "Accelio" logo and clicked the mouse button, the code would return something like "50, 100", representing the X and Y of the mouse pointer location from the top-left (0,0) of the document.
The coordinates need to be the coordinates of the PDF, not the screen. I need to be able to use the coordinates that come in to then write some text or add an image to that PDF using PyMuPDF in some other code (which I already have working).
Is there a way to do that in TKinter or something else?
Thanks!
python pdf tkinter coordinates
python pdf tkinter coordinates
edited Mar 21 at 16:01
martineau
69.7k1092186
69.7k1092186
asked Mar 21 at 15:50
KorzakKorzak
106210
106210
1
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01
add a comment |
1
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01
1
1
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284349%2fget-coordinates-of-mouse-pointer-over-pdf-in-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284349%2fget-coordinates-of-mouse-pointer-over-pdf-in-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You're probably going to have to use some third-party pdf reading module to display the file, and it may contain utility functions that do what you need.
– martineau
Mar 21 at 16:01