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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

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