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?













-1















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!










share|improve this question



















  • 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















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!










share|improve this question



















  • 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








-1








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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?