CN111144078B - Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file - Google Patents

Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file Download PDF

Info

Publication number
CN111144078B
CN111144078B CN201911285809.2A CN201911285809A CN111144078B CN 111144078 B CN111144078 B CN 111144078B CN 201911285809 A CN201911285809 A CN 201911285809A CN 111144078 B CN111144078 B CN 111144078B
Authority
CN
China
Prior art keywords
marked
pdf document
pdf
position coordinate
coordinate
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.)
Active
Application number
CN201911285809.2A
Other languages
Chinese (zh)
Other versions
CN111144078A (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

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 key event of a mouse is triggered, acquiring a first position coordinate of a mouse pointer on a transparent canvas at present; 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 currently when a key 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 rapidly and accurately positioned, the time of a user is saved, and the user experience effect is improved.

Description

Method, device, server and storage medium for determining positions to be marked in PDF (portable document format) file
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a device for determining positions to be marked in a PDF file, a server and a storage medium.
Background
Common various contract documents, industry research 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 reports, so that the information such as characters, tables, pictures and the like which represent the key contents in the PDF documents needs to be marked quickly and accurately, thereby facilitating the analysis and confirmation of the user.
At present, a common PDF document position labeling method is a keyword positioning method, and the positioning method can accurately position text data in a PDF document, but the information contained in a table and a picture is difficult to accurately position, so that a user needs to spend a large amount of time to search related content, and the experience effect of the user is seriously affected. Therefore, how to accurately locate all the positions to be marked (including the information of the table and the picture) in the PDF document is a problem to be solved.
Disclosure of Invention
In view of the above, the embodiments of the present application provide a method, an apparatus, a server, and a storage medium for determining a position to be marked in a PDF file, so as to solve the problem in the prior art that it is difficult to accurately locate information contained in a table and a picture, so that a user needs to spend a lot of time to search related content, and the experience effect of the user is seriously affected.
A first aspect of the embodiment of the application provides a method for determining information 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 in the PDF document;
adding a button event of a mouse on the transparent canvas;
when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently;
and converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and determining the position corresponding to the second position coordinate as the position to be marked on the PDF document.
Optionally, the acquiring and displaying the PDF document to be annotated includes:
and after detecting an instruction for displaying the PDF document to be annotated, acquiring and displaying the PDF document to be annotated, wherein the instruction for displaying the PDF document to be annotated is triggered through a predetermined operation interface.
Optionally, the acquiring and displaying the 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 an annotation button, and the adding a button event of the 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 step of acquiring the first position coordinate of the virtual mouse pointer on the transparent canvas when the key event of the mouse is triggered, the method comprises:
and when the monitored times of the virtual mouse pointer clicked in the preset time period are larger than the preset clicking times threshold, judging that the key event of the virtual mouse pointer is triggered.
Optionally, the transparent canvas is a canvas transparent canvas, and the obtaining the first position coordinate of the virtual mouse pointer on the transparent canvas currently includes:
and calling a canvas to acquire the position coordinate method, and acquiring the first position coordinate of the virtual mouse pointer on the transparent canvas.
Optionally, the preset coordinate conversion formula is:
wherein ,(x ,y ) And (x, y) is the 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 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 an embodiment 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 PDF documents to be marked;
the creation module is used 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 a first position coordinate of the current mouse pointer on the transparent canvas when the key event of the mouse is triggered;
the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and the position corresponding to the second position coordinate is the position to be marked on the PDF document.
A third aspect of an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for determining a position to be marked in a PDF file according to the first aspect, when the processor executes the computer program.
A fourth aspect of the embodiments of the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method for determining a position to be marked in a PDF file according to the first aspect above.
The embodiment of the application obtains 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 the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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. Creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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 rapidly and accurately positioned, the time of a user is saved, and the user experience effect is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for determining a position to be marked in a PDF file according to a first embodiment of the present application;
FIG. 2 is a flow chart of an implementation of S104 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 by 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 the particular system architecture, 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 illustrate the technical scheme of the application, the following description is made by specific examples. Fig. 1 is a flowchart of a method for determining a position to be marked in a PDF file according to a first embodiment of the present application, where an execution body of the embodiment is a server. The details are as follows:
s101, acquiring and displaying PDF documents to be marked.
In one possible implementation, when sending a PDF file of importance such as contract for a user, in order to facilitate the user to understand the key content, such as contract terms, signing date, execution time, signature position, etc., it is generally desirable that the PDF file can be labeled quickly and accurately during the display process.
In this embodiment, after detecting a user-triggered instruction for displaying a PDF document to be annotated, the server loads and displays the PDF document.
Alternatively, in the embodiment of the present solution, after detecting the instruction for displaying the PDF document to be annotated, an interpreted script language (JavaScript, JS) may be used to load the PDF document and display the PDF document on the operation interface.
By way of example and not limitation, S101 specifically includes: when an instruction for displaying the PDF document to be annotated is detected, acquiring and displaying the PDF document to be annotated; the instruction for displaying the PDF document to be annotated is triggered through a predetermined operation interface.
In an alternative implementation, the operation interface is an operation interface generated through webpage loading.
Specifically, the operation interface comprises an input frame and/or a selection frame and a trigger button, wherein the input frame is used for a user to input and display information of the PDF document to be marked, the selection section comprises a pull-down menu, the pull-down menu comprises menu items for displaying the PDF document to be marked, the user can input and display the information of the PDF document to be marked through the input section, or the selection frame is used for selecting the menu items for displaying the PDF document to be marked, and the trigger button is clicked.
Further, in one implementation manner, S101 specifically includes: and calling a JavaScript program, loading the PDF document, and displaying on the operation interface.
S102, creating a transparent canvas in the PDF document.
In one possible implementation, the transparent canvas is a canvas transparent canvas having a size that is greater than or equal to the display size of the PDF document such that the transparent canvas completely overlays the PDF document.
S103, adding a button event of a mouse on the transparent canvas.
In one possible implementation manner, a mouse button event (mousedown) is added on the transparent canvas, optionally, a labeling button is set on a predetermined operation interface, and when a user clicks the labeling button, an instruction of adding the mouse button event is triggered.
It should be noted that, in practical application, the instruction of adding the button event of the mouse may be triggered only by moving the mouse pointer to the position to be marked. Therefore, optionally, a mouse event button is provided on a predetermined operation interface, and after the 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 clicking the mouse is selected, and a movement event of the mouse may also 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 simulates a mouse pointer and is virtual, and the virtual mouse pointer can simulate common operations of the mouse, such as movement type operation, locking enabling type operation and the like of the simulated mouse by calling functions of the simulated mouse.
And S104, when the fact that the key event of the mouse is triggered is monitored, acquiring the 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, it may be determined whether to trigger a button event of the mouse by listening for a clicking operation on the virtual mouse pointer.
By way of example and not limitation, a click operation on a virtual mouse pointer may be listened to by invoking the addEventListener method of JavaScript.
In an alternative implementation, the step of determining that the key event of the virtual mouse pointer is triggered is included before S104, as described in detail below:
and when the monitored times of clicking the virtual mouse pointer in the preset time period are larger than the preset first time number threshold value, judging that the key event of the virtual mouse pointer is triggered.
For example, by calling addEventListener of JavaScript to monitor that the number of times the virtual mouse pointer is clicked within a preset time period is greater than a preset click number threshold, determining that a button event of the mouse is triggered.
It will be appreciated that in some applications, if the user selects a move event to click on the mouse pointer, then it may be determined whether to trigger a move event of the mouse by invoking an addEventListener of JavaScript to monitor for a move operation on the virtual mouse pointer.
For example, when a movement of a virtual mouse pointer over a PDF document is monitored, a movement event (mousemove) of the mouse is triggered, and any HTML element can monitor the movement event of the mouse. And when the number of times of moving the virtual mouse pointer within the preset time period is monitored to be larger than the preset moving time threshold, determining that a moving event of the mouse is triggered.
Optionally, a labeling button may be preset at a preset position of the PDF document (for example, the lowest end of a page or the top end of a page), and when the user clicks the labeling button on the PDF document, an instruction for adding a movement event of a mouse and/or a button event of a mouse on the transparent canvas may also be triggered.
Further, the transparent canvas is a canvas transparent canvas, and in one possible implementation manner, when the key event of the mouse is monitored to be triggered, the first position coordinate of the virtual mouse pointer on the transparent canvas is obtained by calling a canvas to obtain the position coordinate.
In an alternative implementation, obtaining the first location coordinate of the virtual pointer currently on the transparent canvas includes: and calling a canvas position coordinate acquisition method to acquire the first position coordinate 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 getboundingClientRact method of canvas.
The first position coordinate is a pixel coordinate, specifically, the pixel coordinate is a position coordinate of a pixel in an image, and is a position coordinate determined with respect to an origin of an image coordinate system of the transparent canvas.
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 the position to be marked on the PDF document.
It should be noted that, generally, the position of the coordinate axis origin of the transparent canvas (for example, at the upper left corner position of the transparent canvas) is inconsistent with the position of the coordinate axis origin of the PDF document (for example, at the lower left corner position 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:
wherein (x ', y') is the coordinates of the second position of the virtual mouse pointer in the PDF document, (x, y) is the first position coordinates of the virtual mouse pointer in the transparent canvas, the first position coordinates are pixel coordinates, the second position coordinates are millimeter coordinates, h is the height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinates into millimeter coordinates.
Optionally, after determining the coordinates of the second location, the coordinates of the second location are acquired and saved, so that when the PDF document is sent to the client, the client is prompted to confirm key content, such as contract number, name, identity information, product information, etc., or sign, etc., at the corresponding location according to the saved coordinates of the second location.
According to the method for determining the position to be marked in the PDF file, the PDF file to be marked is obtained and displayed; creating a transparent canvas in the PDF document; adding a button event of a mouse on the transparent canvas; when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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. Creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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 rapidly and accurately positioned, the time of a user is saved, and the user experience effect is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
According to the method for determining the position to be marked in the PDF file, the PDF file to be marked is obtained and displayed; creating a transparent canvas in the PDF document; adding a button event of a mouse on the transparent canvas; when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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. Creating a transparent canvas over the PDF document; adding a button event of a mouse on the transparent canvas; when the key event of the mouse is triggered, acquiring the first position coordinate of the mouse pointer on the transparent canvas currently; 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 rapidly and accurately positioned, the time of a user is saved, and the user experience effect is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Corresponding to the method for determining the position to be marked in the PDF file described in the above embodiment, fig. 3 is a block diagram of the device for determining the position to be marked in the PDF file according to the embodiment of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown.
Referring to fig. 3, the position determining apparatus 3 to be marked in the PDF file of 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 for adding a mouse button event on the transparent canvas;
a second obtaining module 340, configured to obtain a first position coordinate of a virtual mouse pointer currently on the transparent canvas when it is monitored that a button event of the mouse is triggered;
the conversion 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 annotated is detected, acquiring and displaying the PDF document to be annotated, wherein the instruction for displaying the PDF document to be annotated is triggered through a predetermined operation interface.
Preferably, the first obtaining module 310 is specifically configured to:
and after receiving an instruction for 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 an annotation 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 device further comprises a judging module, wherein the judging module is used for judging that the key event of the virtual mouse pointer is triggered when the fact that the number of times that the virtual mouse pointer is clicked in a preset duration is larger than a preset click number threshold value is monitored; .
Preferably, 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 the following steps:
and calling a canvas position coordinate acquisition method to acquire the first position coordinate of the virtual mouse pointer on the transparent canvas.
Preferably, the preset coordinate conversion formula is:
wherein (x ', y') is the coordinates of the second position of the virtual mouse pointer in the PDF document, (x, y) is the first position coordinates of the virtual mouse pointer in the transparent canvas, the first position coordinates are pixel coordinates, the second position coordinates are millimeter coordinates, h is the height of the transparent canvas, and z is a conversion coefficient for converting the pixel coordinates into millimeter coordinates.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The embodiment of the application also provides a server, as shown in fig. 4, which is a schematic structural diagram of the service provided by the embodiment of the application. As can be seen from fig. 4, the server comprises a processor 40, a memory 41 and a computer program 42 stored in the memory 41 and executable on the processor 40, for example an information labeling program for PDF files. The steps of the above-described embodiments of the information labeling method for each PDF file, such as steps 101 to 105 shown in fig. 1, are implemented when the processor 40 executes the computer program 42. Alternatively, the processor 40 may implement the functions of the modules/units of the embodiment of the position determining device to be marked in the PDF file, such as the functions of the modules 310 to 350 shown in fig. 3, when executing the computer program 42.
By way of example, 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 the specified functions, which instruction segments 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 (a module in a virtual device), each of which specifically functions as follows:
the first acquisition module is used for acquiring and displaying PDF documents to be marked;
the creation module is used 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 a first position coordinate of the virtual mouse pointer on the transparent canvas currently when the key event of the mouse is triggered;
the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and the position corresponding to the second position coordinate is the position to be marked on the PDF document.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
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 solution. 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 manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. . Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (4)

1. The method for determining the position to be marked in the PDF file is characterized by comprising the following steps of:
when an instruction for displaying the PDF document to be marked is detected, a JavaScript program is called, the PDF document is loaded and displayed on an operation interface, and the instruction for displaying the PDF document to be marked is triggered through a predetermined operation interface; the operation interface comprises a labeling button;
creating a transparent canvas in the PDF document; the transparent canvas is canvas;
when detecting that a user clicks the marking button to trigger a marking request, generating a virtual mouse pointer on the transparent canvas;
when the monitored times of the virtual mouse pointer clicked within the preset time period are larger than a preset clicking times threshold value, judging that a key event of the mouse pointer is triggered;
when the key event of the mouse is triggered, calling a canvas to acquire a position coordinate method, and acquiring a first position coordinate of the virtual mouse pointer on the transparent canvas;
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;
the preset coordinate conversion formula is as follows:
wherein ,the coordinates of the second position of the virtual mouse pointer in the PDF document are (x, y) the first position coordinates of the virtual mouse pointer in the transparent canvas, the first position coordinates are pixel coordinates, and the second position coordinates are millimeter coordinates>Z is the conversion factor that converts pixel coordinates to millimeter coordinates, which is the height of the transparent canvas.
2. The device for determining the position to be marked in the PDF file is characterized by being used for realizing the method for determining the position to be marked in the PDF file according to claim 1, and the device for determining the position to be marked in the PDF file comprises the following components:
the first acquisition module is used for acquiring and displaying PDF documents to be marked;
a creation module for creating 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 a first position coordinate of the current mouse pointer on the transparent canvas when the key event of the mouse is triggered;
the conversion module is used for converting the first position coordinate into a second position coordinate according to a preset coordinate conversion formula, and the position corresponding to the second position coordinate is the position to be marked on the PDF document.
3. 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 claim 1 when the computer program is executed by the processor.
4. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the method for determining a position to be marked in a PDF file according to claim 1.
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 CN111144078A (en) 2020-05-12
CN111144078B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650714B (en) * 2020-12-22 2024-04-05 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112764642B (en) * 2020-12-31 2022-11-29 达而观数据(成都)有限公司 Canvas technology-based universal document labeling method and system
CN112967418B (en) * 2021-01-29 2023-01-06 惠州市大圣和乘科技有限公司 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

Citations (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
CN110297550A (en) * 2019-06-28 2019-10-01 北京百度网讯科技有限公司 A kind of mark display methods, throws screen equipment, terminal and storage medium at device

Patent Citations (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
CN110297550A (en) * 2019-06-28 2019-10-01 北京百度网讯科技有限公司 A kind of mark display methods, throws screen equipment, terminal and storage medium at device

Also Published As

Publication number Publication date
CN111144078A (en) 2020-05-12

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
US20200073920A1 (en) Systems and methods for remote dashboard image generation
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
WO2016018683A1 (en) Image based search to identify objects in documents
CN111130987A (en) Automatic acquisition method and device for AWR report, electronic equipment and storage medium
CN110889056B (en) Page marking method and device
CN114357345A (en) Picture processing method and device, electronic equipment and computer readable storage medium
CN111045653A (en) System generation method and device, computer readable medium and electronic equipment
CN111651966A (en) Data report file generation method and device and electronic equipment
CN108984070B (en) Method, apparatus, electronic device and readable medium for thermodynamic diagram imaging
CN107391914B (en) Parameter display method, device and equipment
CN109213668B (en) Operation recording method and device and terminal
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
WO2015119970A1 (en) Visual tagging to record interactions
CN107329981B (en) Page detection method and device
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
CN114730341A (en) Protecting user privacy in user interface data collection for native applications
CN111782758A (en) Drawing review result viewing method based on CAD and related device
CN113220381A (en) Click data display method and device
CN111435326A (en) Method and device for analyzing crash logs
CN114579461A (en) Browser compatibility detection method and related equipment
CN110888583B (en) Page display method, system and device and electronic equipment
CN112800373A (en) Webpage resource data generation method and device, computer equipment and storage medium

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