CN111144078A - Method and device for determining position to be marked in PDF file, server and storage medium - Google Patents

Method and device for determining position to be marked in PDF file, server and storage medium Download PDF

Info

Publication number
CN111144078A
CN111144078A CN201911285809.2A CN201911285809A CN111144078A CN 111144078 A CN111144078 A CN 111144078A CN 201911285809 A CN201911285809 A CN 201911285809A CN 111144078 A CN111144078 A CN 111144078A
Authority
CN
China
Prior art keywords
marked
coordinate
pdf document
position coordinate
transparent canvas
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911285809.2A
Other languages
Chinese (zh)
Other versions
CN111144078B (en
Inventor
马超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN201911285809.2A priority Critical patent/CN111144078B/en
Publication of CN111144078A publication Critical patent/CN111144078A/en
Application granted granted Critical
Publication of CN111144078B publication Critical patent/CN111144078B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a method for determining a position to be marked in a PDF file, which comprises the following steps: acquiring and displaying a PDF document to be marked; creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when a button event of the mouse is monitored to be triggered, acquiring a first position coordinate of a mouse pointer on a transparent canvas; and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is the position to be marked on the PDF document. Monitoring a first position coordinate of a mouse pointer on the transparent canvas when a button event of the mouse is triggered; and then the first position coordinate is converted into a second position coordinate corresponding to the position to be marked on the PDF document, so that the position to be marked on the PDF document can be quickly and accurately positioned, the user time is saved, and the user experience effect is improved.

Description

Method and device for determining position to be marked in PDF file, server and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a device for determining a position to be marked in a PDF file, a server and a storage medium.
Background
Various common contract documents, industry research and reports and the like are usually displayed in a PDF format, and a user needs to confirm related key contents in the process of signing various contract documents or analyzing the industry research and report, so that information such as characters, tables, pictures and the like which represent the key contents in the PDF document needs to be marked quickly and accurately, and the user can conveniently analyze and confirm the information.
At present, a common PDF document position labeling method is a keyword positioning method, which can accurately position text data in a PDF document, but is difficult to accurately position information contained in a form and a picture, so that a user needs to spend a large amount of time to search for related content, and experience effects of the user are seriously affected. Therefore, how to accurately position all to-be-labeled positions (including information of tables and pictures) in a PDF document is an urgent problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a server, and a storage medium for determining a position to be annotated in a PDF file, so as to solve the problem in the prior art that it is difficult to accurately locate information included in a table and a picture, which causes a user to spend a large amount of time to search for related content, and seriously affects an experience effect of the user.
A first aspect of an embodiment of the present application provides a method for determining information to be annotated in a PDF file, including:
acquiring and displaying a PDF document to be marked;
creating a transparent canvas in the PDF document;
adding a button event of a mouse on the transparent canvas;
when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas;
and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and determining a position corresponding to the second position coordinate as a position to be marked on the PDF document.
Optionally, the acquiring and displaying a PDF document to be annotated includes:
and when an instruction for displaying the PDF document to be marked is detected, acquiring and displaying the PDF document to be marked, wherein the instruction for displaying the PDF document to be marked is triggered through a predetermined operation interface.
Optionally, the acquiring and displaying a PDF document to be annotated includes:
and calling a JavaScript program, loading the PDF document, and displaying on the operation interface.
Optionally, the operation interface includes a label button, and adding a button event of a mouse on the transparent canvas includes:
and when detecting that the user clicks the annotation button to trigger an annotation request, generating a virtual mouse pointer on the transparent canvas.
Optionally, before the obtaining of the first position coordinate of the virtual mouse pointer on the transparent canvas when the button pressing event of the mouse is monitored to be triggered, the method includes:
and when the fact that the number of times that the virtual mouse pointer is clicked within the preset time length is larger than a preset click number threshold value is monitored, judging that the key event of the virtual mouse pointer is triggered.
Optionally, the obtaining a first position coordinate of the virtual mouse pointer on the transparent canvas includes:
and calling a canvas method for obtaining the position coordinate to obtain the first position coordinate of the virtual mouse pointer on the transparent canvas.
Optionally, the preset coordinate conversion formula is:
Figure BDA0002317947400000021
wherein ,(x,y) The coordinate of the second position of the virtual mouse pointer in the PDF document, (x, y) is the coordinate of the first position of the virtual mouse pointer in the transparent canvas, the first position coordinate is a pixel coordinate, the second position coordinate is a millimeter coordinate, h is the height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinate into the millimeter coordinate.
A second aspect of the embodiments of the present application provides a device for determining a position to be marked in a PDF file, including:
the first acquisition module is used for acquiring and displaying a PDF document to be marked;
a creation module for creating a transparent canvas in the PDF document;
the adding module is used for adding a button event of a mouse on the transparent canvas;
the second acquisition module is used for acquiring the current first position coordinate of a mouse pointer on the transparent canvas when the condition that the button event of the mouse is triggered is monitored;
and the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document.
A third aspect of the embodiments of the present application provides a server, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the steps of the method for determining a position to be annotated in a PDF file according to the first aspect.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for determining a position to be annotated in a PDF file according to the above first aspect.
The embodiment of the application acquires and displays the PDF document to be marked; creating a transparent canvas in the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document. As a result of creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and then the first position coordinate is converted into a second position coordinate corresponding to the position to be marked on the PDF document, so that the position to be marked on the PDF document can be quickly and accurately positioned, the user time is saved, and the user experience effect is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a method for determining a position to be annotated in a PDF file according to a first embodiment of the present application;
FIG. 2 is a flowchart illustrating an embodiment of S104 shown in FIG. 1;
fig. 3 is a block diagram of a device for determining a position to be marked in a PDF file according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a service provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples. As shown in fig. 1, the method is a flowchart for determining a position to be annotated in a PDF file according to a first embodiment of the present application, and an execution subject of the present embodiment is a server. The details are as follows:
s101, a PDF document to be marked is obtained and displayed.
In a possible implementation manner, when relevant staff send a PDF file with equal importance to a user, in order to facilitate the user to know key contents, such as contract terms, signing date, execution time, signature location, etc., it is generally desirable that the PDF file can be quickly and accurately labeled during the display process.
In this embodiment, after detecting an instruction for displaying a to-be-annotated PDF document triggered by a user, a server loads and displays the PDF document.
Optionally, in an embodiment of the present disclosure, after an instruction to display a PDF document to be annotated is detected, the PDF document may be loaded using a transliterated scripting language (JavaScript, JS), and displayed on the operation interface.
As an example and not by way of limitation, S101 specifically includes: when an instruction for displaying a PDF document to be marked is detected, acquiring and displaying the PDF document to be marked; and the instruction for displaying the PDF document to be marked is triggered through a predetermined operation interface.
In an optional implementation manner, the operation interface is an operation interface generated by loading a web page.
Specifically, the operation interface includes an input box and/or a selection box and a trigger button, the input box is used for a user to input and display information of the to-be-labeled PDF document, the selection box includes a pull-down menu, the pull-down menu includes menu items for displaying the to-be-labeled PDF document, and the user can input and display the information of the to-be-labeled PDF document through the input box or select the menu item for displaying the to-be-labeled PDF document through the selection box and click the trigger button.
Further, in an implementable embodiment, S101 specifically includes: and calling a JavaScript program, loading the PDF document, and displaying on the operation interface.
S102, a transparent canvas is created in the PDF document.
In one possible implementation manner, the transparent canvas is a canvas transparent canvas, and the size of the transparent canvas is larger than or equal to the display size of the PDF document, so that the transparent canvas completely covers the PDF document.
S103, adding a button event of the mouse on the transparent canvas.
In a possible implementation manner, a button event (mousedown) of the mouse is added to the transparent canvas, optionally, a label button is provided on a predetermined operation interface, and when a user clicks the label button, an instruction for adding the button event of the mouse is triggered.
It should be noted that, in practical application, the mouse pointer needs to be moved to the position to be labeled, so as to trigger the instruction of adding the key event of the mouse. Therefore, optionally, a mouse event button is arranged on the predetermined operation interface, when a user clicks the mouse event button, a selection item is generated on the predetermined operation interface, where the selection item includes a button event of the mouse and a movement event (mousemove) of the mouse, and when it is determined that the movement event of the mouse needs to be triggered, the movement event of the mouse is selected to be clicked, and the movement event of the mouse may be added on the transparent canvas.
Specifically, S103 includes: and when detecting that the user clicks the annotation button to trigger an annotation request, generating the virtual mouse pointer on the transparent canvas.
Specifically, the virtual mouse pointer is a pointer which is virtual by simulating a mouse pointer, and the virtual mouse pointer can be made to simulate common operations of the mouse by calling a function of the simulated mouse, such as a movement-type operation, a lock-enabling-type operation, and the like of the simulated mouse.
And S104, when the button event of the mouse is monitored to be triggered, acquiring the current first position coordinate of the virtual mouse pointer on the transparent canvas.
In one possible implementation, after the virtual mouse pointer is generated on the transparent canvas, whether a button event of the mouse is triggered or not may be determined by monitoring a click operation on the virtual mouse pointer.
By way of example and not limitation, clicking operations on the virtual mouse pointer may be monitored by calling the addEventListener method of JavaScript.
In an alternative implementation, step S104 is preceded by determining that the key event of the virtual mouse pointer is triggered, which is detailed as follows:
and when the fact that the number of times that the virtual mouse pointer is clicked within the preset time length is larger than a preset first time threshold value is monitored, judging that the key event of the virtual mouse pointer is triggered.
For example, when the number of times that the virtual mouse pointer is clicked within the preset time duration is larger than a preset click number threshold value is monitored by calling addEventListener of JavaScript, it is determined that the mouse button event is triggered.
It will be appreciated that in some applications, if the user chooses to click on a mouse pointer movement event, the determination of whether to trigger the mouse movement event may be made by calling addEventListener of JavaScript to listen to the movement operation of the virtual mouse pointer.
For example, when a virtual mouse pointer is monitored to move on a PDF document, a mouse movement event (mousemove) is triggered, and any HTML element can monitor the mouse movement event. And when the fact that the number of times of movement of the virtual mouse pointer in the preset time length is larger than a preset movement number threshold value is monitored, determining that the movement event of the mouse is triggered.
Optionally, a label button may be preset at a preset position (for example, the lowest end of a page or the top end of a page) of the PDF document, and when a user clicks the label button on the PDF document, an instruction to add a mouse movement event and/or a mouse button event to the transparent canvas may also be triggered.
Further, the transparent canvas is a canvas transparent canvas, and in a possible implementation manner, when it is monitored that a button event of the mouse is triggered, the first position coordinate of the virtual mouse pointer on the transparent canvas is obtained by calling a canvas position coordinate obtaining method.
In an optional implementation manner, obtaining the first position coordinate of the virtual index on the transparent canvas currently includes: and calling a canvas method for obtaining the position coordinates to obtain the first position coordinates of the current virtual mouse pointer on the transparent canvas.
In one possible implementation, the first position coordinate of the virtual mouse pointer currently on the transparent canvas may be obtained by calling the getounting clientrect method of canvas.
It should be noted that the first position coordinate is a pixel coordinate, specifically, the pixel coordinate is a position coordinate of a pixel in the image, and is a position coordinate determined with respect to an origin of the image coordinate system of the transparent canvas.
And S105, converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document.
It should be noted that, in general, the position of the coordinate axis origin of the transparent canvas (for example, at the upper left corner of the transparent canvas) does not correspond to the position of the coordinate axis origin of the PDF document (for example, at the lower left corner of the PDF document), and the first position coordinate of the virtual mouse pointer on the transparent canvas is a pixel coordinate, and the second position coordinate of the virtual mouse pointer in the PDF document is a millimeter coordinate. Therefore, it is necessary to convert the coordinates of the first position into the coordinates of the second position according to a preset coordinate conversion formula.
Specifically, the preset coordinate conversion formula is as follows:
Figure BDA0002317947400000081
wherein, (x ', y') is a coordinate of a second position of the virtual mouse pointer in the PDF document, (x, y) is a first position coordinate of the virtual mouse pointer in the transparent canvas, the first position coordinate is a pixel coordinate, the second position coordinate is a millimeter coordinate, h is a height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinate into the millimeter coordinate.
Optionally, after the coordinates of the second location are determined, the coordinates of the second location are obtained and stored, so that when the PDF document is sent to a client, the client is prompted to confirm key content, such as a contract number, a name, identity information, product information, and the like, in the corresponding location according to the stored coordinates of the second location, or to sign in the corresponding location, and the like.
According to the embodiment, the method for determining the position to be marked in the PDF file, provided by the application, comprises the steps of obtaining and displaying the PDF file to be marked; creating a transparent canvas in the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document. As a result of creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and then the first position coordinate is converted into a second position coordinate corresponding to the position to be marked on the PDF document, so that the position to be marked on the PDF document can be quickly and accurately positioned, the user time is saved, and the user experience effect is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
According to the embodiment, the method for determining the position to be marked in the PDF file, provided by the application, comprises the steps of obtaining and displaying the PDF file to be marked; creating a transparent canvas in the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document. As a result of creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a mouse pointer on the transparent canvas; and then the first position coordinate is converted into a second position coordinate corresponding to the position to be marked on the PDF document, so that the position to be marked on the PDF document can be quickly and accurately positioned, the user time is saved, and the user experience effect is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the method for determining a position to be marked in a PDF file described in the foregoing embodiment, fig. 3 is a block diagram of a structure of a device for determining a position to be marked in a PDF file provided in the embodiment of the present application, and for convenience of description, only a part related to the embodiment of the present application is shown.
Referring to fig. 3, the apparatus 3 for determining a position to be marked in a PDF file according to this embodiment includes:
a first obtaining module 310, configured to obtain and display a PDF document to be annotated;
a creation module 320 for creating a transparent canvas in the PDF document;
an adding module 330, configured to add a button event of a mouse on the transparent canvas;
a second obtaining module 340, configured to obtain a current first position coordinate of a virtual mouse pointer on the transparent canvas when it is monitored that a key event of the mouse is triggered;
the converting module 350 is configured to convert the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, where a position corresponding to the second position coordinate is a position to be marked on the PDF document.
Preferably, the first obtaining module 310 is specifically configured to:
when an instruction for displaying the PDF document to be marked is detected, the PDF document to be marked is obtained and displayed, and the instruction for displaying the PDF document to be marked is triggered through a predetermined operation interface.
Preferably, the first obtaining module 310 is specifically configured to:
after receiving an instruction of displaying the PDF document to be marked, calling a JavaScript program, loading the PDF document, and displaying on the operation interface.
Preferably, the operation interface includes a label button, and the adding module 330 is specifically configured to:
and when detecting that the user clicks the annotation button to trigger an annotation request, generating the virtual mouse pointer on the transparent canvas.
Preferably, the mouse comprises a judging module, configured to judge that a key event of the virtual mouse pointer is triggered when it is monitored that the number of times that the virtual mouse pointer is clicked within a preset time duration is greater than a preset click number threshold; .
Preferably, the transparent canvas is a canvas transparent canvas, and the obtaining of the first position coordinate of the virtual mouse pointer on the transparent canvas specifically includes:
and calling a canvas method for obtaining the position coordinates to obtain the first position coordinates of the virtual mouse pointer on the transparent canvas.
Preferably, the preset coordinate conversion formula is as follows:
Figure BDA0002317947400000101
wherein, (x ', y') is a coordinate of a second position of the virtual mouse pointer in the PDF document, (x, y) is a first position coordinate of the virtual mouse pointer in the transparent canvas, the first position coordinate is a pixel coordinate, the second position coordinate is a millimeter coordinate, h is a height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinate into the millimeter coordinate.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides a server, which is a schematic structural diagram of a service provided in the embodiment of the present application, as shown in fig. 4. As can be seen from fig. 4, the server comprises a processor 40, a memory 41 and a computer program 42, such as an information annotation program for PDF files, stored in the memory 41 and executable on the processor 40. The processor 40 executes the computer program 42 to implement the steps in the above-mentioned embodiment of the method for labeling information of each PDF file, such as the steps 101 to 105 shown in fig. 1. Alternatively, the processor 40 executes the computer program 42 to implement the functions of the modules/units in the above-mentioned embodiment of the apparatus for determining a position to be marked in a PDF file, for example, the functions of the modules 310 to 350 shown in fig. 3.
Illustratively, the computer program 42 may be divided into one or more modules/units, which are stored in the memory 41 and executed by the processor 40 to perform the steps of the information labeling method of the PDF file of the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 42 in the server 4. For example, the computer program 42 may be divided into a first acquisition module, a creation module, an addition module, a second acquisition module, and a conversion module (module in the virtual device), each of which functions specifically as follows:
the first acquisition module is used for acquiring and displaying a PDF document to be marked;
a creation module for creating a transparent canvas in the PDF document;
the adding module is used for adding a button event of a mouse on the transparent canvas;
the second acquisition module is used for acquiring the current first position coordinate of the virtual mouse pointer on the transparent canvas when the condition that the button event of the mouse is triggered is monitored;
and the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of communication units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for determining a position to be marked in a PDF file is characterized by comprising the following steps:
acquiring and displaying a PDF document to be marked;
creating a transparent canvas in the PDF document;
adding a button event of a mouse on the transparent canvas;
when it is monitored that the key event of the mouse is triggered, acquiring a first position coordinate of a virtual mouse pointer on the transparent canvas;
and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and determining a position corresponding to the second position coordinate as a position to be marked on the PDF document.
2. The method for determining the position to be labeled in the PDF file according to claim 1, wherein the acquiring and displaying the PDF file to be labeled comprises:
and when an instruction for displaying the PDF document to be marked is detected, acquiring and displaying the PDF document to be marked, wherein the instruction for displaying the PDF document to be marked is triggered through a predetermined operation interface.
3. The method for determining the position to be labeled in the PDF file according to claim 2, wherein the acquiring and displaying the PDF file to be labeled comprises:
and calling a JavaScript program, loading the PDF document, and displaying on the operation interface.
4. The method for determining the position to be marked in the PDF file according to claim 2, wherein the operation interface includes a mark button, and adding a mouse button event to the transparent canvas includes:
and when detecting that the user clicks the annotation button to trigger an annotation request, generating a virtual mouse pointer on the transparent canvas.
5. The method for determining the position to be marked in the PDF file according to claim 4, wherein before the obtaining the first position coordinate of the virtual mouse pointer on the transparent canvas when the button pressing event of the mouse is monitored to be triggered, the method comprises:
and when the fact that the number of times that the virtual mouse pointer is clicked within the preset time length is larger than a preset click number threshold value is monitored, judging that the key event of the mouse pointer is triggered.
6. The method for determining the position to be marked in the PDF file according to claim 5, wherein the transparent canvas is a canvas transparent canvas, and the obtaining the first position coordinate of the virtual mouse pointer on the transparent canvas comprises:
and calling a canvas method for obtaining the position coordinate to obtain the first position coordinate of the virtual mouse pointer on the transparent canvas.
7. The method for determining the position to be marked in the PDF file according to claim 6, wherein the preset coordinate transformation formula is:
Figure FDA0002317947390000021
wherein, (x ', y') is a coordinate of a second position of the virtual mouse pointer in the PDF document, (x, y) is a first position coordinate of the virtual mouse pointer in the transparent canvas, the first position coordinate is a pixel coordinate, the second position coordinate is a millimeter coordinate, h is a height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinate into the millimeter coordinate.
8. A device for determining a position to be marked in a PDF file is characterized by comprising:
the first acquisition module is used for acquiring and displaying a PDF document to be marked;
a creation module to create a transparent canvas over the PDF document;
the adding module is used for adding a button event of a mouse on the transparent canvas;
the second acquisition module is used for acquiring the current first position coordinate of a mouse pointer on the transparent canvas when the condition that the button event of the mouse is triggered is monitored;
and the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, wherein the position corresponding to the second position coordinate is a position to be marked on the PDF document.
9. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method for determining the position to be marked in a PDF file according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for determining a location to be annotated in a PDF file according to any one of claims 1 to 7.
CN201911285809.2A 2019-12-13 2019-12-13 Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file Active CN111144078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911285809.2A CN111144078B (en) 2019-12-13 2019-12-13 Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911285809.2A CN111144078B (en) 2019-12-13 2019-12-13 Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file

Publications (2)

Publication Number Publication Date
CN111144078A true CN111144078A (en) 2020-05-12
CN111144078B CN111144078B (en) 2023-09-01

Family

ID=70518354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911285809.2A Active CN111144078B (en) 2019-12-13 2019-12-13 Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file

Country Status (1)

Country Link
CN (1) CN111144078B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112764642A (en) * 2020-12-31 2021-05-07 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN112967418A (en) * 2021-01-29 2021-06-15 惠州市大圣和乘科技有限公司 Vehicle-mounted data record display method and device, computer equipment and storage medium
CN113836090A (en) * 2021-09-01 2021-12-24 北京来也网络科技有限公司 File labeling method, device, equipment and medium based on AI and RPA

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609401A (en) * 2011-12-26 2012-07-25 北京大学 Webpage annotation method
CN103631964A (en) * 2013-12-18 2014-03-12 重庆市科学技术研究院 PDF (Portable document format)-embedded hypertext markup language (HTML) file shuffling method
CN106502506A (en) * 2016-11-01 2017-03-15 上海爱数信息技术股份有限公司 The mask method of document, system and electronic equipment in webpage
CN108829435A (en) * 2018-06-19 2018-11-16 数据堂(北京)科技股份有限公司 A kind of image labeling method and general image annotation tool
CN110297550B (en) * 2019-06-28 2023-05-16 北京百度网讯科技有限公司 Label display method and device, screen throwing equipment, terminal and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112650714B (en) * 2020-12-22 2024-04-05 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112764642A (en) * 2020-12-31 2021-05-07 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN112967418A (en) * 2021-01-29 2021-06-15 惠州市大圣和乘科技有限公司 Vehicle-mounted data record display method and device, computer equipment and storage medium
CN113836090A (en) * 2021-09-01 2021-12-24 北京来也网络科技有限公司 File labeling method, device, equipment and medium based on AI and RPA

Also Published As

Publication number Publication date
CN111144078B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN111144078B (en) Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file
US9977765B2 (en) Information processing device, information processing method, information processing program, display control device, and display control program
US20140380178A1 (en) Displaying interactive charts on devices with limited resources
CN104243273A (en) Method and device for displaying information on instant messaging client and information display system
CN102411614A (en) Display Of Image Search Results
US9690855B2 (en) Method and system for searching for a web document
CN114357345A (en) Picture processing method and device, electronic equipment and computer readable storage medium
CN111045653B (en) System generation method and device, computer readable medium and electronic equipment
EP3175375A1 (en) Image based search to identify objects in documents
CN111782758A (en) Drawing review result viewing method based on CAD and related device
CN110990010A (en) Software interface code generation method and device
CN110020344B (en) Webpage element labeling method and system
EP3178009A1 (en) Replicating a web technology
CN111475237A (en) Menu processing method and device, electronic equipment and storage medium
WO2015119970A1 (en) Visual tagging to record interactions
CN110633251B (en) File conversion method and equipment
US10140278B2 (en) Computer-implemented methods and systems for associating files with cells of a collaborative spreadsheet
CN111259381A (en) Page interaction method and device, computer readable medium and electronic equipment
CN109684156B (en) Monitoring method, device, terminal and storage medium based on mixed mode application
CN113220381A (en) Click data display method and device
CN113704650A (en) Information display method, device, system, equipment and storage medium
CN105677749B (en) Page display method and device
KR20170050338A (en) Data structuring method
CN110633197A (en) Method and device for detecting excessive drawing
CN110209336B (en) Content display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant