Document page processing method and device, computer equipment and storage medium

By responding to the selection event of the target format document page in the browser, obtaining and matching location information, and performing area merging and selection drawing, the problem of inconsistency between the selection and selected areas is solved, and the accuracy of selection drawing is improved.

CN120030250APending Publication Date: 2025-05-23TENCENT TECH WUHAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311589664.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When displaying the target format document page in the browser, the selection drawing is inconsistent with the selected area.

Method used

By responding to the selection event of the target format document page in the browser, the event start position information and event termination position information are obtained, the standard position information of each character in the target format document page is obtained, the event position information and character position information are matched, the selected area information is merged, and the selection is drawn in the selection drawing canvas.

Benefits of technology

Improve the accuracy of selection drawing, ensure that selection drawing is always in the same position as its corresponding selected characters, and solves the problem of inconsistent selection and selected areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030250A_ABST
    Figure CN120030250A_ABST
Patent Text Reader

Abstract

The invention relates to a document page processing method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps of obtaining event starting position information and event ending position information in response to a region selection event of a target format document page in a browser; obtaining standard position information of each character in the target format document page, wherein the standard position information is obtained by drawing a content drawing canvas corresponding to the target format document page based on the original position information of each character; matching the event starting position information and the event ending position information with the standard position information corresponding to each character to obtain the standard position information of the selected character; performing region merging based on the standard position information corresponding to the selected character to obtain selected region information; and performing selected area drawing on a selected area drawing canvas corresponding to the target format document page according to the selected area information to obtain a target selected area document page. By adopting the method, the selected area drawing accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of front-end technology, and in particular to a document page processing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of front-end technology, technologies for displaying documents in browsers have emerged. Displaying target format documents in browsers can be achieved through third-party libraries, thereby obtaining target format document pages. For example, PDF (Portable Document Format) files are displayed in browsers through the pdf.js (JavaScript library for parsing and rendering PDF based on HTML5) library to obtain PDF document pages. Currently, when selecting a target format document page, the selection method natively supported by the browser is usually used to draw the selection at the physical level of drawing the page content. However, due to the differences between the method of displaying page content and the method of drawing the selection, there will be a problem of inconsistency between the drawn selection and the selected area. Summary of the invention

[0003] Based on this, it is necessary to provide a document page processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy of selection area drawing in response to the above technical problems.

[0004] In a first aspect, the present application provides a document page processing method. The method comprises:

[0005] Responding to a selection event for a target format document page in a browser, obtaining event start position information and event end position information;

[0006] Obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document;

[0007] Based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0008] Merge the regions based on the standard position information corresponding to the selected characters to obtain the selected region information corresponding to the selection event;

[0009] In the selection drawing canvas corresponding to the target format document page, selection drawing is performed according to the selected area information to obtain the target selection document page.

[0010] In a second aspect, the present application also provides a document page processing device. The device comprises:

[0011] An event response module, used to respond to a selection event for a target format document page in a browser, and obtain event start position information and event end position information;

[0012] A position acquisition module is used to acquire standard position information corresponding to each character in a target format document page, wherein the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document;

[0013] A position matching module is used to match the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0014] A region merging module, used to merge regions based on standard position information corresponding to the selected characters, and obtain selected region information corresponding to the selection event;

[0015] The selection and drawing module is used to perform selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page.

[0016] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0017] Responding to a selection event for a target format document page in a browser, obtaining event start position information and event end position information;

[0018] Obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document;

[0019] Based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0020] Merge the regions based on the standard position information corresponding to the selected characters to obtain the selected region information corresponding to the selection event;

[0021] In the selection drawing canvas corresponding to the target format document page, selection drawing is performed according to the selected area information to obtain the target selection document page.

[0022] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0023] Responding to a selection event for a target format document page in a browser, obtaining event start position information and event end position information;

[0024] Obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document;

[0025] Based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0026] Merge the regions based on the standard position information corresponding to the selected characters to obtain the selected region information corresponding to the selection event;

[0027] In the selection drawing canvas corresponding to the target format document page, selection drawing is performed according to the selected area information to obtain the target selection document page.

[0028] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0029] Responding to a selection event for a target format document page in a browser, obtaining event start position information and event end position information;

[0030] Obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document;

[0031] Based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0032] Merge the regions based on the standard position information corresponding to the selected characters to obtain the selected region information corresponding to the selection event;

[0033] In the selection drawing canvas corresponding to the target format document page, selection drawing is performed according to the selected area information to obtain the target selection document page.

[0034] The document page processing method, device, computer equipment, storage medium and computer program product described above obtain event start position information and event end position information by responding to a selection event for a target format document page in a browser; obtain standard position information corresponding to each character in the target format document page, the standard position information is obtained by drawing the page content in a content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document; match the event start position information and event end position information with the standard position information corresponding to each character to obtain standard position information of the selected character corresponding to the selection event; merge regions based on the standard position information corresponding to the selected character to obtain selected region information corresponding to the selection event; perform selection drawing in accordance with the selected region information in a selection drawing canvas corresponding to the target format document page to obtain a target selection document page. That is, the selected region information is determined according to the standard position information of the selected character, thereby improving the accuracy of the selected region information; finally, the selected region is drawn in accordance with the selected region information in the selection drawing canvas corresponding to the target format document page, thereby ensuring that the selected region drawing is always at the same position as the corresponding selected character, thereby improving the accuracy of the selected region drawing. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 An application environment diagram of a document page processing method in an embodiment;

[0036] Figure 2 A schematic diagram of a flow chart of a document page processing method in one embodiment;

[0037] Figure 3 A schematic diagram of a process of obtaining a document page in a target format in one embodiment;

[0038] Figure 4 A schematic diagram of a process for determining standard location information in one embodiment;

[0039] Figure 5 is a schematic diagram of a target format document page in a specific embodiment;

[0040] Figure 6 A schematic diagram of a process for obtaining standard position information corresponding to a selected character in one embodiment;

[0041] Figure 7 A schematic diagram of a process for determining a coordinate range of a selected area in one embodiment;

[0042] Figure 8 A schematic diagram of a process for determining selected area information in one embodiment;

[0043] Fig. 9 A schematic diagram of the structure code of a canvas in a specific embodiment;

[0044] Fig.10 It is a flowchart of a document page processing method in a specific embodiment;

[0045] Fig.11 A schematic diagram of a framework for document page processing in a specific embodiment;

[0046] Fig.12 is a schematic diagram of a document page in a target format in a computer terminal in a specific embodiment;

[0047] Fig.13 is a schematic diagram of a document page in a target format in a mobile terminal in a specific embodiment;

[0048] Fig.14 is a structural block diagram of a document page processing device in one embodiment;

[0049] Fig.15 is an internal structure diagram of a computer device in one embodiment;

[0050] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] The document page processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 interacts with the server 104 to display the target format document page in the browser. Then the terminal 102 responds to the selection event for the target format document page in the browser, and obtains the event start position information and event end position information; the terminal 102 obtains the standard position information corresponding to each character in the target format document page, and the standard position information is obtained by drawing the page content in the content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document; the terminal 102 matches the standard position information corresponding to each character based on the event start position information and the event end position information, and obtains the standard position information of the selected character corresponding to the selection event; the terminal 102 performs area merging based on the standard position information corresponding to the selected character, and obtains the selected area information corresponding to the selection event; the terminal 102 performs area drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page, and obtains the target selection document page. The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0053] In one embodiment, Figure 2 As shown, a document page processing method is provided, which is applied to Figure 1 The terminal in the example is used for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0054] S202, responding to a selection event for a target format document page in a browser, and acquiring event start position information and event end position information.

[0055] Wherein, the browser refers to an application used to retrieve, display and transmit World Wide Web information resources. The target format document refers to a document in a portable document format, which is a file format that presents documents in a manner independent of applications, hardware, and operating systems. The target format document page refers to a page that displays the target format document in a browser. The selection refers to the area formed when the page content is selected in the target format document page of the browser. The page content can be text, pictures, table cells, etc. in the target format document page. The selection event refers to a trigger event for selecting the page content in the target format document page of the browser. The trigger event can be triggered by a trigger operation, which can be a pre-set operation behavior, including but not limited to a click operation, a slide operation, a press operation, a move operation, a touch operation, etc. The event start position information refers to information representing the start position of the selection event trigger, for example, the start position information can be the start position coordinates. The event end position information refers to information representing the end position of the selection event trigger, for example, the start position information can be the start position coordinates. Wherein, the position coordinates are determined by a coordinate system established with the lower left corner of the target format document page as the origin.

[0056] Specifically, the terminal can display the target format document page in the browser. Then the terminal detects whether the target format document page is triggered in the target format document page displayed in the browser. Different types of terminals can set different detection events, and detect the operation behavior for the target format document page by detecting the event. When the terminal detects that the operation behavior is the operation behavior corresponding to the selection event, it responds to the selection event for the target format document page in the browser, and obtains the event start position information and event end position information through the selection event call method. Among them, the computer terminal can detect the mouse operation behavior in the target format document page, including the operation actions such as mouse pressing, mouse moving, and mouse lifting. The mobile terminal can detect the touch operation behavior in the target format document page, including the event hooks of the relevant operation actions such as the contact point contacting the device, the contact point moving in the device, and the contact point leaving the device, and then responds to the selection event to obtain the event start position information and event end position information. Among them, the terminal can obtain the page content of the target format document page from the server and then display it in the browser. The terminal can also obtain the page content of the target format document page from the local memory and then display it in the browser.

[0057] S204, obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document.

[0058] Among them, the character refers to the page content displayed in the target format document page, which may include glyph units and symbols, such as text, letters, numbers, operation symbols, punctuation marks and other symbols, as well as some functional symbols. The character may also include non-glyph units, such as pictures, table units, etc. The original position information refers to the position information of the character in the target format document. The original position information may include original character coordinate information and original character width and height information. The original character coordinate information is used to characterize the horizontal and vertical coordinates of the character in the target format document in the target format document. The original character coordinate information is determined by establishing a coordinate system with the lower left corner of the target format document as the coordinate origin. The original character width and height information is used to characterize the width and height of the character in the target format document in the target format document. The content drawing canvas refers to the canvas corresponding to the target format document page for drawing the target format document content. The canvas (Canvas) is used to draw the page content on the web page. The standard position information refers to the position information determined according to the standard size of the target format document page. The standard size of the target format document page may be the initial page size of the target format document page without scaling. The standard position information may include standard character coordinate information and standard character width and height information. The standard character coordinate information is used to represent the horizontal and vertical coordinates of the characters in the target format document page. The standard character coordinate information is determined by establishing a coordinate system with the lower left corner of the target format document page as the coordinate origin. The standard character width and height information is used to represent the width and height of the characters in the target format document page.

[0059] Specifically, the terminal can obtain the standard position information corresponding to each character in the target format document page from the memory. The terminal can also obtain the standard position information corresponding to each character in the target format document page from the cache. The standard position information is obtained by drawing the page content in the content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document, that is, when the terminal displays the target format document page in the browser, it is necessary to draw the page content of each character in the content drawing canvas corresponding to the target format document page. At this time, the terminal needs to convert the original position information of each character into the standard position information according to the size of the content drawing canvas, wherein the terminal can convert the original character coordinate information of each character into the standard character coordinate information according to the size of the content drawing canvas, and convert the original character width and height information of each character into the standard character width and height information. Finally, the terminal draws the page content in the content drawing canvas according to the standard position information of each character, and at the same time, the terminal saves the standard position information of each character, and can cache the standard position information of each character, or store the standard position information of each character in the memory.

[0060] S206, matching the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event.

[0061] The selected characters refer to characters in the target format document page selected by the operation corresponding to the selection event, and the selected characters include at least one.

[0062] Specifically, the terminal can use the event start position information to match the standard position information corresponding to each character, obtain the standard position information that matches consistently, and thus obtain the standard position information of the start selected character. Then, the event end position information is matched with the standard position information corresponding to each character, and the standard position information that matches consistently is obtained, thereby obtaining the standard position information of the end selected character. Then, the standard position information between the standard position information of the start selected character and the standard position information of the end selected character can be determined from the standard position information corresponding to each character, thereby obtaining the standard position information of the middle selected character. Finally, the terminal uses the standard position information of the start selected character, the standard position information of all the middle selected characters, and the standard position information of the end selected character as the standard position information of the selected character corresponding to the selection event.

[0063] In one embodiment, the starting selected character may be the same as the ending selected character. In this case, there is no intermediate selected character, and the terminal may directly use the standard position information corresponding to the starting selected character as the standard position information of the selected character.

[0064] In one embodiment, the terminal determines whether the event start position information and the event end position information can match the standard position information from the standard position information corresponding to each character. If the standard position information is not matched, it means that the selection operation is not performed. In this case, no subsequent processing is performed. If the standard position information is matched, the standard position information of the selected character corresponding to the selection event is obtained.

[0065] S208, performing region merging based on the standard position information corresponding to the selected character to obtain selected region information corresponding to the selection event.

[0066] The selected area information is used to represent the location information of the selected area, and the selected area information may include the selected area coordinate information and the selected area width and height information. The selected area coordinate information is used to represent the horizontal and vertical coordinates of the selected area. The selected area width and height information is used to represent the height and width of the selected area.

[0067] Specifically, the terminal calculates the selected area according to the standard position information corresponding to all the selected characters, wherein the coordinate information of the selected area can be calculated according to the coordinate information of the standard position information corresponding to all the selected characters, and the width and height information of the selected area can be calculated according to the width and height information of the standard position information corresponding to all the selected characters. Finally, the selected area information corresponding to the selection event is obtained based on the coordinate information of the selected area and the width and height information of the selected area.

[0068] S210, performing selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page.

[0069] The selection drawing canvas is a canvas used to draw the selection. The selection drawing canvas is a mirror image of the content drawing canvas, that is, the size and style of the selection drawing canvas and the content drawing canvas are consistent. The selection drawing canvas can be at the same physical level as the content drawing canvas, or at the upper physical level of the content drawing canvas.

[0070] Specifically, the terminal determines the drawing position in the selected area drawing canvas corresponding to the target format document page according to the selected area information, and then obtains the pre-set selected area drawing information, and uses the selected area drawing information to perform selected area drawing at the determined drawing position, and can call the canvas-related drawing application program interface to perform canvas drawing, thereby obtaining the target selected area document page, wherein the selected area drawing information refers to the pre-set information of the selected area to be drawn, which may include the area drawing style, area drawing color, etc. For example, the selected area drawing information may be rectangular area information, etc. The area drawing information corresponding to different target format document pages may be different or the same.

[0071] The document page processing method, device, computer equipment, storage medium and computer program product described above obtain event start position information and event end position information by responding to a selection event for a target format document page in a browser; obtain standard position information corresponding to each character in the target format document page, the standard position information is obtained by drawing the page content in a content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document; match the event start position information and event end position information with the standard position information corresponding to each character to obtain standard position information of the selected character corresponding to the selection event; merge regions based on the standard position information corresponding to the selected character to obtain selected region information corresponding to the selection event; perform selection drawing in accordance with the selected region information in a selection drawing canvas corresponding to the target format document page to obtain a target selection document page. That is, the selected region information is determined according to the standard position information of the selected character, thereby improving the accuracy of the selected region information; finally, the selected region is drawn in accordance with the selected region information in the selection drawing canvas corresponding to the target format document page, thereby ensuring that the selected region drawing is always at the same position as the corresponding selected character, thereby improving the accuracy of the selected region drawing.

[0072] In one embodiment, Figure 3 As shown, before S202, that is, before responding to the selection event for the target format document page in the browser, it also includes:

[0073] S302, in response to a display event for a target format document in a browser, obtaining original position information corresponding to each character in the target format document.

[0074] Among them, the display event refers to the operation event of displaying the target format document in the browser. The operation event is triggered by a trigger operation, which includes but is not limited to a click operation, a slide operation, a press operation, a voice operation, a gesture operation, and the like.

[0075] Specifically, the user can display the target format document in the browser. That is, the terminal can run the browser, and then detect the display event for the target format document in the browser. In response to the display event, the terminal can parse the target format document to obtain the original position information corresponding to each character in the target format document.

[0076] In one embodiment, the target format document can be directly displayed, that is, the terminal does not need to start the browser in advance. Then, when the terminal detects the display event of displaying the target format document in the browser, it runs in the browser and parses the target format document to obtain the original position information corresponding to each character in the target format document. The browser can be a browser based on different kernels, for example, it can be a browser based on the Trident (a typesetting engine) kernel, it can be a browser based on the Gecko (a set of open source web page typesetting engines) kernel, it can be a browser based on the WebKit (an open source project) kernel, and it can be a browser based on the Presto (a computing engine with a higher page loading speed) kernel.

[0077] S304, based on the content corresponding to the target format document page, a canvas is drawn to convert the original position information corresponding to each character to obtain the standard position information corresponding to each character.

[0078] Specifically, the terminal can obtain the position conversion information corresponding to the preset content drawing canvas, and then convert the original position information corresponding to each character according to the position conversion information, so as to obtain the standard position information corresponding to each character. Among them, the position conversion information can be obtained using the application program interface of the canvas, and the position conversion information is used to characterize the conversion parameters required when converting the original position information to the standard position information, and the conversion parameters are determined according to the size of the canvas. The terminal can convert the original character coordinate information in the original position information according to the position conversion information to obtain the standard character coordinate information, and then calculate the degree of change of the coordinates according to the standard character coordinate information and the original character coordinate information, and then change the original character width and height information in the original position information accordingly according to the degree of change of the coordinates, so as to obtain the standard character width and height information, and finally obtain the standard position information of each character according to the standard character coordinate information and the standard character width and height information of each character.

[0079] S306, drawing the page content according to the standard position information corresponding to each character in the content drawing canvas corresponding to the target format document page, obtaining the target format document page, and generating a selection area drawing canvas corresponding to the target format document page according to the content drawing canvas corresponding to the target format document page.

[0080] Specifically, the terminal can also obtain the character display information corresponding to each character, such as the character display style, character display color, etc., and render and draw the page content according to the standard position information and character display information corresponding to each character in the content drawing canvas corresponding to the target format document page, and after the rendering and drawing of the page content is completed, the target format document page is obtained. At this time, the target format document page is displayed in the browser.

[0081] In one embodiment, the target format document displayed in the target format document page may also be a document in any format, for example, the target format document may also be a plain text format document, a formatted text format document, a rich text format document, an open source format document, etc. When drawing the selected area, the document content in any format is drawn in the content drawing canvas corresponding to the document in any format, and the selected area content is drawn in the mirrored canvas corresponding to the content drawing canvas according to the selected area information, thereby obtaining the selected area document page.

[0082] In one embodiment, when the terminal displays a target format document page, it can obtain a document in any format. Preferably, it can convert a document in any format into a portable format document, use the portable format document as the target format document, and draw the page content in accordance with the standard position information corresponding to each character in the content drawing canvas corresponding to the target format document page to obtain the target format document page.

[0083] In the above embodiment, by responding to the display event for the target format document in the browser, the original position information corresponding to each character in the target format document is obtained. Based on the content drawing canvas corresponding to the target format document page, the original position information corresponding to each character is converted to obtain the standard position information corresponding to each character. In the content drawing canvas corresponding to the target format document page, the page content is drawn according to the standard position information corresponding to each character to obtain the target format document page, and the selected area drawing canvas corresponding to the target format document page is generated according to the content drawing canvas corresponding to the target format document page. That is, the page content is drawn according to the target standard position information, so as to ensure the accuracy of the generated target format document page, and finally the corresponding selected area drawing canvas is generated according to the content drawing canvas, so as to avoid the problem of inconsistency between the drawn content and the selected content after the subsequent selected area drawing, thereby ensuring the accuracy of the subsequent selected area drawing.

[0084] In one embodiment, S304, i.e., converting the original position information corresponding to each character by drawing a canvas based on the content corresponding to the target format document page to obtain the standard position information corresponding to each character, includes the following steps:

[0085] The canvas conversion information corresponding to the content drawing canvas is obtained, and the content conversion information is obtained; the original position information corresponding to each character is converted according to the canvas conversion information and the content conversion information to obtain the standard position information corresponding to each character.

[0086] The canvas conversion information is a conversion parameter determined according to the size of the content drawing canvas, and the canvas conversion information may include a horizontal scaling parameter, a horizontal tilt offset parameter, a vertical tilt offset parameter, a vertical scaling parameter, a horizontal movement parameter, and a vertical movement parameter, etc. The canvas conversion information may be pre-set in the browser. The content conversion information is a conversion parameter determined according to the size of the page content to be drawn, and is used to convert the page content converted by the canvas conversion information according to the size of the page content to be drawn. The content conversion information may be pre-set in the browser. The content conversion information may also be obtained by the user modifying the content conversion information pre-set in the browser.

[0087] Specifically, the server obtains the canvas conversion information corresponding to the content drawing canvas through the application program interface of the canvas, and obtains the content conversion information. Then, the target conversion information can be calculated using the canvas conversion information and the content conversion information, that is, the conversion parameters of the same type in the canvas conversion information and the content conversion information can be multiplied to obtain the target conversion parameters of the same type, and the target conversion parameters corresponding to all the conversion parameters of the same type are calculated to obtain the target conversion information. Then, the original position information corresponding to each character is converted using the target conversion information, and the product of the original position information and the target conversion information can be calculated to obtain the standard position information. Each character is traversed to obtain the standard position information corresponding to each character.

[0088] In a specific embodiment, the terminal may obtain the transformation matrix transform of the current page content drawing canvas, and convert the original position information corresponding to each character in combination with the matrix textMatrix of the PDF text to obtain the standard position information corresponding to each character.

[0089] In the above embodiment, the original position information corresponding to each character is converted by using canvas conversion information and content conversion information to obtain the standard position information corresponding to each character, thereby improving the accuracy of the obtained standard position information.

[0090] In one embodiment, the standard position information includes standard character width and height information and standard character coordinate information;

[0091] like Figure 4 As shown, the original position information corresponding to each character is converted according to the canvas conversion information and the content conversion information to obtain the standard position information corresponding to each character, including:

[0092] S402: convert the original character coordinate information in the original position information according to the canvas conversion information and the content conversion information to obtain standard character coordinate information.

[0093] S404, performing ratio calculation based on the original character coordinate information and the corresponding standard character coordinate information to obtain a scaling ratio.

[0094] Among them, the standard character width and height information is used to characterize the width and height of the characters in the target format document page. The standard character coordinate information is used to characterize the horizontal and vertical coordinates of the characters in the target format document page. The zoom ratio is used to characterize the degree of zoom when drawing the content in the target format document to the target format document page. The zoom ratio is a positive number, which can be a value greater than 1, a value less than 1, or 1. When the zoom ratio is greater than 1, it means that the content of the target format document needs to be enlarged when drawing it to the target format document page. When the zoom ratio is less than 1, it means that the content of the target format document needs to be reduced when drawing it to the target format document page. When the zoom ratio is equal to 1, it means that the content of the target format document remains unchanged when drawing it to the target format document page.

[0095] Specifically, the terminal calculates the product of the original character coordinate information, the canvas conversion information, and the content conversion information to obtain the standard character coordinate information. Then the terminal can calculate the ratio of the ordinate in the original character coordinate information to the ordinate in the corresponding standard character coordinate information to obtain the scaling ratio. The terminal can also calculate the ratio of the abscissa in the original character coordinate information to the abscissa in the corresponding standard character coordinate information to obtain the scaling ratio. The terminal can use the original character coordinate information corresponding to any character and the corresponding standard character coordinate information to calculate the scaling ratio, and the scaling ratios calculated for all characters are consistent.

[0096] S406, scaling the original character width and height information in the original position information according to the scaling ratio to obtain standard character width and height information;

[0097] S408: Determine standard position information corresponding to each character based on the standard character coordinate information and the standard character width and height information.

[0098] Specifically, the terminal calculates the product of the scaling ratio and the original character width and height information in the original position information to obtain the standard character width and height information, wherein the product of the original character width and the scaling ratio is calculated to obtain the standard character width, and the product of the original character height and the scaling ratio is calculated to obtain the standard character height, thereby obtaining the standard character width and height information. Finally, the terminal uses the standard character coordinate information and the standard character width and height information calculated for each character as the standard position information corresponding to each character. Then the terminal saves the standard position information corresponding to each character. When the target format document page is redrawn, the standard position information corresponding to each character is recalculated and saved.

[0099] In the above embodiment, the original character coordinate information in the original position information is first converted according to the canvas conversion information and the content conversion information to obtain the standard character coordinate information. Then, the scaling ratio is calculated based on the original character coordinate information and the corresponding standard character coordinate information. Finally, the scaling ratio is used to calculate the standard character width and height information, thereby improving the accuracy of the obtained standard position information.

[0100] In a specific embodiment, Figure 5As shown, it is a partial schematic diagram of the target format document page, wherein the target format document page is displayed in the browser, and the target format document content, i.e., the character set "PDF", is displayed in the target format document page. When drawing the target format document page, the character "P" is drawn by using the pdf.js library, and the context information of the current content drawing canvas drawing is obtained. The context information specifically includes the font information corresponding to the letter "P" currently drawn, such as the font standard width information, font spacing, and character unicode, etc. Then, according to the Canvas API (canvas application program interface), the transformation matrix transform of the current content drawing canvas is obtained, and the matrix textMatrix of the text is obtained, and the matrix information of the current character "P" in the content drawing canvas is calculated according to the matrix multiplication. Then, the horizontal and vertical coordinates of the current character "P" are determined according to the horizontal movement parameters and the vertical movement parameters in the matrix information. Then, the current scaling ratio scale is calculated, and the font width currently required to be rendered and drawn, i.e., the character width w, can be obtained according to the scaling ratio multiplied by the font standard width (i.e., glyphWidth*scale). Then, the character height h is calculated by square root according to the vertical tilt offset parameter and the vertical scaling parameter in the matrix information. Finally, the character value t=“P” can be obtained according to the character Unicode information. Then, each character in the character set is traversed in turn, and finally the standard position information corresponding to the character set “PDF” is obtained, including the standard coordinate information, standard width and standard height of the character “P”, the standard coordinate information, standard width and standard height of the character “D”, and the standard coordinate information, standard width and standard height of the character “F”. The font format information of each character in the character set "PDF" can also be obtained, and the page content is drawn in the content drawing canvas according to the font format information and the standard position information, so as to obtain the target format document page, and the font format information and the standard position information of each character in the character set "PDF" are saved at the same time, wherein the standard position information of the character "P" includes a standard width of 14.016, a standard height of 24, and a standard coordinate of (70.824, 745.9), the standard position information of the character "D" includes a standard width of 17.202, a standard height of 24, and a standard coordinate of (84.84, 745.9), and the standard position information of the character "F" includes a standard width of 12.048, a standard height of 24, and a standard coordinate of (102.048, 745.9). That is, the standard position information of each character is obtained and saved when the content is drawn, which is convenient for subsequent use and improves the efficiency of subsequent execution.

[0101] In one embodiment, S206, based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event, including:

[0102] Obtain the zoom information, restore the event start position information and the event end position information to the standard position according to the zoom information, and obtain the event start standard position information and the event end standard position information; match the event start standard position information and the event end standard position information with the standard position information corresponding to each character, and obtain the standard position information of the selected character corresponding to the selection event.

[0103] The scaling information refers to the scaling ratio information of the target format document page, which may be a scaling ratio or a scaling factor, etc. The event start standard position information refers to the position information obtained by scaling the event start position information according to the scaling information. The event end standard position information refers to the position information obtained by scaling the event end position information according to the scaling information.

[0104] Specifically, the terminal detects a selection event for the target format document page in the zoomed target format document page. At this time, the event start position information and event end position information obtained are the position information after zooming, and cannot be matched with the saved standard position information. At this time, the terminal obtains the zoom information saved when the target format document page is zoomed, and then uses the zoom information to restore the event start position information and event end position information to the standard position, that is, calculates the product of the event start position information and the zoom information, and calculates the product of the event end position information and the zoom information, so as to obtain the event start standard position information and event end standard position information. Finally, the terminal matches the event start standard position information and event end standard position information with the standard position information corresponding to each character, and obtains the standard position information of the selected character corresponding to the selection event.

[0105] In one embodiment, the scaling information may be a magnification ratio. The terminal then magnifies the coordinate information and width and height information in the event start position information according to the magnification ratio to obtain the magnified coordinate information and the magnified width and height information, thereby obtaining the event start standard position information. At the same time, the terminal magnifies the coordinate information and width and height information in the event end position information according to the magnification ratio to obtain the magnified coordinate information and the magnified width and height information, thereby obtaining the event end standard position information.

[0106] In one embodiment, the scaling information may be a reduction ratio. Then the terminal reduces the coordinate information and width and height information in the event start position information according to the reduction ratio, obtains the reduced coordinate information and the reduced width and height information, and thus obtains the event start standard position information. At the same time, the coordinate information and width and height information in the event end position information are reduced according to the reduction ratio, obtains the reduced coordinate information and the reduced width and height information, and thus obtains the event end standard position information.

[0107] In the above embodiment, by acquiring the scaling information, the event start position information and the event end position information are restored to the standard position according to the scaling information to obtain the event start standard position information and the event end standard position information; the event start standard position information and the event end standard position information are matched with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event, that is, the terminal only needs to save the standard position corresponding to each character, and there is no need to calculate the scaled position information corresponding to each character, thereby saving computing resources.

[0108] In one embodiment, S210, i.e., performing selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page, includes the steps of:

[0109] The selected area information is scaled according to the scaling information to obtain the scaled selected area information; the selected area is drawn in the selected area drawing canvas corresponding to the target format document page according to the scaled selected area information to obtain the current selected area document page.

[0110] The current selected area document page refers to a page obtained after performing an area selection operation on the zoomed target format document page.

[0111] Specifically, after obtaining the selected area information, the terminal scales the selected area information according to the scaling information, that is, scales the coordinates in the selected area information, scales the width and height of the selected area, and obtains the scaled selected area information. Finally, the terminal performs selection drawing according to the scaled selected area information in the selection drawing canvas corresponding to the target format document page, and obtains the current selection document page.

[0112] In one embodiment, the scaling information may be a magnification ratio. The terminal then magnifies the selected area information according to the magnification ratio to obtain the magnified selected area information, and finally performs selection drawing in the selection drawing canvas according to the magnified selected area information to obtain the current selection document page. The scaling information may also be a reduction ratio. The terminal then reduces the selected area information according to the reduction ratio to obtain the reduced selected area information, and finally performs selection drawing in the selection drawing canvas according to the reduced selected area information to obtain the current selection document page, that is, matching is performed according to the target standard position information, and finally the selected area is scaled according to the scaling information before performing selection drawing, thereby ensuring the accuracy of selection drawing.

[0113] In the above embodiment, by using the zoomed selected area information to perform selection drawing, the current selected area document page is obtained, thereby avoiding the problem of selection drawing errors when the target format document page is zoomed, thereby improving the accuracy of selection drawing.

[0114] In one embodiment, after obtaining the scaling information, the terminal may also use the scaling information to scale the standard position information corresponding to each character to obtain the scaling position information corresponding to each character, and then use the event start position information and the event end position information to match the scaling position information corresponding to each character to obtain the scaling position information of the selected character corresponding to the selection event, and then merge the areas according to the scaling position information of the selected characters to obtain the selected scaling area information, and finally draw the selection according to the scaling area information in the selection drawing canvas to obtain the scaled selection document page, and directly scale the standard position information corresponding to each character and then match them, thereby improving the accuracy of the scaling position information of the selected character.

[0115] In one embodiment, Figure 6 As shown, S206, that is, matching the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event, includes:

[0116] S602, matching the event start position information with the standard position information corresponding to each character to obtain the standard position information of the start selected character.

[0117] The starting selected character refers to the starting character in the selected area.

[0118] Specifically, the terminal matches the event start position information with the standard position information corresponding to each character, wherein the consistency can be judged based on the start coordinate information in the event start position information and the standard character coordinate information in the standard position information corresponding to each character, and the character corresponding to the consistent standard character coordinate information is determined to obtain the standard position information of the start selected character. When the terminal determines that there is no consistent standard character coordinate information, the start coordinate information is used to calculate the distance between the standard character coordinate information corresponding to each character, and then the standard character coordinate information corresponding to the minimum distance is selected, thereby obtaining the standard position information of the start selected character.

[0119] S604, matching the event termination position information with the standard position information corresponding to each character to obtain the standard position information for terminating the selected character.

[0120] The terminating selected character refers to the terminating character in the selected area.

[0121] Specifically, the terminal matches the event termination position information with the standard position information corresponding to each character, wherein the termination coordinate information in the event termination position information can be used to perform consistency judgment with the standard character coordinate information in the standard position information corresponding to each character, determine the character corresponding to the consistent standard character coordinate information, and obtain the standard position information of the terminated selected character. When the terminal determines that there is no consistent standard character coordinate information, the termination coordinate information is used to calculate the distance between the standard character coordinate information corresponding to each character, and then the standard character coordinate information corresponding to the minimum distance is selected, thereby obtaining the standard position information of the terminated selected character.

[0122] S606: Calculate the coordinate range of the selected area according to the standard position information of the start selected character and the standard position information of the end selected character to obtain the coordinate range of the selected area.

[0123] The selection area coordinate range refers to the coordinate range of the selected area, which may include a horizontal coordinate range and a vertical coordinate range.

[0124] Specifically, the terminal determines the coordinate range of the selected area according to the coordinate information in the standard position information of the starting selected character and the coordinate information in the standard position information of the ending selected character, wherein the horizontal coordinate range can be determined according to the horizontal coordinate information of the starting selected character and the horizontal coordinate information of the ending selected character. At the same time, the vertical coordinate range is determined according to the vertical coordinate information of the starting selected character and the vertical coordinate information of the ending selected character, and finally the coordinate range of the selected area is determined according to the horizontal coordinate range and the vertical coordinate range.

[0125] S608, searching for standard position information within the selection area coordinate range from the standard position information corresponding to each character, and obtaining the standard position information of the selected character corresponding to the selection area event.

[0126] Specifically, the terminal searches for the standard position information within the selection area coordinate range from the standard position information corresponding to each character, that is, all the standard position information within the selection area coordinate range is used as the standard position information of the selected character, and the standard position information of the selected character includes at least one, thereby obtaining the standard position information of all selected characters corresponding to the selection event.

[0127] In the above embodiment, by obtaining the standard position information of the starting selected character and the standard position information of the ending selected character, then obtaining the selection area coordinate range, and finally searching for the standard position information within the selection area coordinate range from the standard position information corresponding to each character, the standard position information of the selected character corresponding to the selection area event is obtained, thereby improving the accuracy of the obtained standard position information of the selected character.

[0128] In one embodiment, S606, i.e., calculating the coordinate range of the selected area according to the standard position information of the start selected character and the standard position information of the end selected character to obtain the coordinate range of the selected area, comprises the steps of:

[0129] When the vertical coordinate in the standard position information of the starting selected character is the same as the vertical coordinate in the standard position information of the ending selected character, the horizontal coordinate in the standard position information of the starting selected character is used as the starting coordinate of the range, and the horizontal coordinate in the standard position information of the ending selected character is used as the ending coordinate of the range to obtain the horizontal coordinate range; the selection area coordinate range is determined based on the vertical coordinate and the horizontal coordinate range in the standard position information of the starting selected character.

[0130] The starting coordinates of the range refer to the coordinates of the starting position in the selection coordinate range, and the ending coordinates of the range refer to the coordinates of the ending position in the selection coordinate range.

[0131] Specifically, when the ordinate in the standard position information of the starting selected character is the same as the ordinate in the standard position information of the ending selected character, it means that the starting selected character and the ending selected character are in the same row. Or when it is determined that the ordinate in the standard position information of the starting selected character and the ordinate in the standard position information of the ending selected character are on the same baseline, it means that the starting selected character and the ending selected character are in the same row. At this time, the terminal directly uses the horizontal coordinate in the standard position information of the starting selected character as the starting coordinate of the range, and uses the horizontal coordinate in the standard position information of the ending selected character as the ending coordinate of the range to obtain the horizontal coordinate range. Finally, the selection area coordinate range corresponding to the selection event is determined based on the same ordinate and horizontal coordinate ranges.

[0132] In a specific embodiment, when the vertical coordinate in the standard position information of the starting selected character is the same as the vertical coordinate in the standard position information of the ending selected character, the terminal determines that it is a single-line selection. At this time, the vertical coordinate of the selection area coordinate range not only needs to be the same as the vertical coordinate in the standard position information of the starting selected character and the vertical coordinate in the standard position information of the ending selected character, but also the horizontal coordinate of the selection area coordinate range needs to be between the horizontal coordinate in the standard position information of the starting selected character and the horizontal coordinate in the standard position information of the ending selected character.

[0133] In the above embodiment, when the vertical coordinate in the standard position information of the starting selected character is the same as the vertical coordinate in the standard position information of the ending selected character, the selection area coordinate range is directly determined according to the horizontal coordinate in the standard position information, thereby improving the efficiency of obtaining the selection coordinate range.

[0134] In one embodiment, Figure 7 As shown, S606, calculating the coordinate range of the selected area according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the coordinate range of the selected area, including the steps of:

[0135] S702, when the vertical coordinate in the standard position information of the starting selected character is different from the vertical coordinate in the standard position information of the ending selected character, determine the starting row coordinate range based on the horizontal coordinate of the starting character in the standard position information of the starting selected character and the horizontal coordinate greater than the horizontal coordinate of the starting character.

[0136] The starting row coordinate range refers to the coordinate range corresponding to the starting row in the selected area.

[0137] Specifically, the terminal determines that when the ordinate in the standard position information of the starting selected character is different from the ordinate in the standard position information of the ending selected character, it means that the selected area has multiple lines, that is, the starting selected character and the ending selected character are in different lines. At this time, the terminal determines the starting row coordinate range according to the starting character horizontal coordinate, the starting character vertical coordinate, and the horizontal coordinate greater than the starting character horizontal coordinate in the standard position information of the starting selected character. That is, the ordinate of the starting row coordinate range is the same as the ordinate in the standard position information of the starting selected character, and the horizontal coordinate in the starting row coordinate range is greater than the horizontal coordinate in the standard position information of the starting selected character, that is, the minimum horizontal coordinate in the horizontal coordinate range is the horizontal coordinate of the starting selected character, and the maximum horizontal coordinate is the horizontal coordinate of the last character in the starting row.

[0138] S704: Determine a terminating row coordinate range based on the terminating character abscissa in the standard position information of the terminating selected character and abscissa smaller than the terminating character abscissa.

[0139] The ending row coordinate range refers to the coordinate range corresponding to the ending row in the selected area.

[0140] Specifically, the terminal determines the terminating row coordinate range according to the terminating character horizontal coordinate, the terminating character vertical coordinate, and the horizontal coordinate smaller than the terminating character horizontal coordinate in the standard position information of the terminating selected character. That is, the vertical coordinate of the terminating row coordinate range is the same as the vertical coordinate in the standard position information of the terminating selected character, and the horizontal coordinate in the terminating row coordinate range is smaller than the horizontal coordinate in the standard position information of the terminating selected character, that is, the maximum horizontal coordinate in the horizontal coordinate range is the horizontal coordinate of the terminating selected character, and the minimum horizontal coordinate is the horizontal coordinate of the first character in the terminating row.

[0141] S706: Determine a middle row coordinate range based on a ordinate between the ordinate in the standard position information of the start selected character and the ordinate in the standard position information of the end selected character.

[0142] The middle row coordinate range refers to the coordinate range corresponding to the middle row in the selected area, and the middle row may include at least one row.

[0143] Specifically, the terminal determines the middle row coordinate range according to the ordinate between the ordinate in the standard position information of the start selected character and the ordinate in the standard position information of the end selected character. That is, the ordinate in the middle row coordinate range is between the ordinate in the standard position information of the start selected character and the ordinate in the standard position information of the end selected character, the smallest abscissa in the middle row coordinate range is the abscissa of the first character in the middle row, and the largest abscissa in the middle row coordinate range is the abscissa of the last character.

[0144] S708, determining a selection area coordinate range based on the start row coordinate range, the end row coordinate range, and the middle row coordinate range.

[0145] Specifically, the terminal determines the area range where the starting row coordinate range, the ending row coordinate range and the middle row coordinate range are located as the coordinate range corresponding to the selection event.

[0146] In the above embodiment, when the vertical coordinate in the standard position information of the starting selected character is different from the vertical coordinate in the standard position information of the ending selected character, the starting row coordinate range, the ending row coordinate range and the middle row coordinate range are determined, and finally the selection area coordinate range is determined based on the starting row coordinate range, the ending row coordinate range and the middle row coordinate range, thereby improving the accuracy of the selection area coordinate range.

[0147] In one embodiment, the vertical coordinates in the standard position information corresponding to the selected characters are the same;

[0148] S208, that is, merging regions based on the standard position information corresponding to the selected characters to obtain selected region information corresponding to the selection event, includes the following steps:

[0149] The starting character horizontal coordinate, the ending character horizontal coordinate and the ending character width are obtained from the standard position information corresponding to the selected character, the fusion width of the ending character horizontal coordinate and the ending character width is calculated, and the difference between the fusion width and the starting character horizontal coordinate is calculated to obtain the selected area width;

[0150] The height of each character is obtained from the standard position information corresponding to the selected character, and the height of the character that meets the preset height condition is selected from the heights of each character to obtain the height of the selected area;

[0151] The selected area information corresponding to the selection event is determined based on the horizontal coordinate of the starting character, the selected area width, and the selected area height.

[0152] The fusion width is used to represent the sum of the horizontal coordinate of the termination character and the width of the termination character. The preset height condition refers to a preset condition for selecting the height of the selected area, which may be a maximum height.

[0153] Specifically, when the terminal merges the areas, it needs to calculate the height and width of the merged area. That is, the terminal detects that the vertical coordinates in the standard position information corresponding to the selected characters are the same, indicating that the selected characters are in the same row. At this time, the terminal obtains the horizontal coordinate of the starting character from the standard position information corresponding to the starting selected character, and then obtains the horizontal coordinate of the ending character and the width of the ending character from the standard position information corresponding to the ending selected character. Then, the sum of the horizontal coordinate of the ending character and the width of the ending character is calculated to obtain the fusion width, and then the difference between the fusion width and the horizontal coordinate of the starting character is calculated to obtain the width of the selected area. Then, the height of each character is obtained from the standard position information corresponding to the selected character, and the character height that meets the preset height condition is selected from each character height. The maximum character height can be selected as the height of the selected area. Finally, the horizontal coordinate and the vertical coordinate of the starting character are used as the coordinate information in the selected area information, and the width and height of the selected area are used as the area width and height information in the selected area information, thereby obtaining the selected area information corresponding to the selection event. In a specific embodiment, the following is obtained: Figure 5 The selected area information where the string "PDF" is located is shown as area coordinates (70.824, 745.9), area width is 43.272, and area height is 24.

[0154] In the above embodiment, when the vertical coordinates in the standard position information corresponding to the selected characters are the same, the selected area width and the selected area height are calculated, and finally the selected area information corresponding to the selection event is determined by the horizontal and vertical coordinates of the starting character, the selected area width and the selected area height, thereby improving the accuracy of the selected area information.

[0155] In one embodiment, the vertical coordinates in the standard position information corresponding to the selected characters are different;

[0156] like Figure 8 As shown, S208, that is, merging regions based on the standard position information corresponding to the selected characters to obtain selected region information corresponding to the selection event, includes:

[0157] S802, dividing the standard position information corresponding to the selected character according to the vertical coordinate in the standard position information corresponding to the selected character to obtain at least two standard position information sets, wherein the vertical coordinates of the standard position information in the standard position information sets are the same, and the vertical coordinates of the standard position information in different standard position information sets are different.

[0158] The standard position information set refers to a set of standard position information corresponding to the selected characters in the same row. The vertical coordinates of the standard position information in the same standard position information set are the same, but the horizontal coordinates are different. The vertical coordinates and horizontal coordinates of the standard position information in different standard position information sets are different.

[0159] Specifically, the terminal divides the standard position information corresponding to the selected characters in different rows into different standard position information sets, and divides the standard position information corresponding to the selected characters in the same row into the same standard position information set, wherein the vertical coordinate is used to determine whether they are in the same row. If the vertical coordinates are the same, it means that the selected characters are in the same row. If the vertical coordinates are different, it means that the selected characters are in different rows. Finally, at least two standard position information sets are obtained.

[0160] S804, obtain the current starting character horizontal coordinate, the current ending character horizontal coordinate and the current ending character width from the current standard position information set of at least two standard position information sets, calculate the current fused width of the current ending character horizontal coordinate and the current ending character width, and calculate the difference between the current fused width and the current starting character horizontal coordinate to obtain the current area width corresponding to the current standard position information set.

[0161] Specifically, the terminal calculates the area width for each standard position information set in the same way as the vertical coordinate in the standard position information corresponding to the selected character, that is, obtains the horizontal coordinate of the current starting character from the standard position information of the starting character of the current row in the current standard position information set, and obtains the horizontal coordinate of the current ending character and the current ending character width from the standard position information of the ending character of the current row. Then the terminal calculates the sum of the horizontal coordinate of the current ending character and the width of the current ending character to obtain the current fusion width, and calculates the difference between the current fusion width and the horizontal coordinate of the current starting character to obtain the current area width corresponding to the current standard position information set.

[0162] S806, acquiring each current character height from the current standard position information set, selecting a current character height that meets a preset height condition from each current character height, and obtaining a current region height corresponding to the current standard position information set.

[0163] S808: Determine the merged region information corresponding to the current standard position information set based on the horizontal coordinate of the current starting character, the current region width, and the current region height.

[0164] Specifically, the terminal obtains each current character height from the current standard position information set, and then compares the sizes of each current character height, and selects the current character height that meets the preset height condition according to the size of each current character height, wherein the maximum current character height can be used as the current area height corresponding to the current standard position information set. Then the terminal uses the horizontal and vertical coordinates of the current starting character, the current area width and the current area height as the merged area information corresponding to the current standard position information set.

[0165] S810, traverse at least two standard location information sets to obtain merged area information corresponding to the at least two standard location information sets, and use the merged area information corresponding to the at least two standard location information sets as selected area information corresponding to the selection event.

[0166] Specifically, the terminal traverses and calculates the merged area information corresponding to each standard location information set, and then uses the merged area information corresponding to all the standard location information sets as the selected area information corresponding to the selection event.

[0167] In the above embodiment, when the vertical coordinates in the standard position information corresponding to the selected character are different, the merged area information of the standard position information set corresponding to each row is calculated to determine the selected area information corresponding to the selection event, that is, the selected area information is determined according to the row, thereby improving the accuracy of the selected area information.

[0168] In one embodiment, after step S210, that is, after performing selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page, the following further includes:

[0169] In response to the selection cancel event for the target selection document page, the canvas cleaning interface is called to clean up the selection drawing canvas corresponding to the target selection document page to obtain the target format document page.

[0170] Among them, the selection cancel event refers to an operation event for canceling the selected area. The operation event can be triggered by a trigger operation, and the trigger operation can be a pre-set operation behavior, including but not limited to click operation, slide operation, press operation, move operation, touch operation, voice operation and gesture operation, etc. The canvas clearing interface is an interface used to delete the content drawn in the canvas, which is pre-set.

[0171] Specifically, the terminal detects a selection cancellation event on the target selection document page, and in response to the selection cancellation event on the target selection document page, the terminal can call a canvas cleaning interface in the canvas drawing technology to clean up all contents drawn in the selection drawing canvas corresponding to the target selection document page to obtain the target format document page. In a specific embodiment, Fig. 9 As shown, it is a schematic diagram of the structural code of the content drawing canvas and the corresponding mirrored canvas, i.e., the selection drawing canvas, wherein the content drawing canvas and the selection drawing canvas have the same width and height, i.e., the width is 794px (pixel unit) and the height is 1123px. The selection drawing canvas is a mirrored canvas of the content drawing canvas of the first page.

[0172] In the above embodiment, by calling the canvas cleaning interface to clean the selection drawing canvas corresponding to the target selection document page, the content drawn in the selection drawing canvas can be directly and quickly cleaned, thereby improving the efficiency and accuracy of content cleaning.

[0173] In a specific embodiment, Fig.10 As shown, a specific flow chart of a document page processing method is provided, comprising the following steps:

[0174] S1002, responding to a selection event for a target format document page in a browser, and obtaining event start position information and event end position information.

[0175] S1004, obtaining zoom information, and restoring the event start position information and the event end position information to standard positions according to the zoom information to obtain the event start standard position information and the event end standard position information.

[0176] S1006, obtaining standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document.

[0177] S1008, matching the event start standard position information with the standard position information corresponding to each character to obtain the standard position information of the start selected character. Matching the event end standard position information with the standard position information corresponding to each character to obtain the standard position information of the end selected character.

[0178] S1010, calculating the selection area coordinate range according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the selection area coordinate range. Searching for standard position information within the selection area coordinate range from the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event.

[0179] S1012, when the vertical coordinates in the standard position information corresponding to the selected characters are the same, obtain the horizontal coordinate of the starting character, the horizontal coordinate of the ending character and the width of the ending character from the standard position information corresponding to the selected characters, calculate the fusion width of the horizontal coordinate of the ending character and the width of the ending character, and calculate the difference between the fusion width and the horizontal coordinate of the starting character to obtain the width of the selected area.

[0180] S1014, obtaining the height of each character from the standard position information corresponding to the selected character, selecting the character height that meets the preset height condition from the various character heights, and obtaining the height of the selected area. Determine the selected area information corresponding to the selection event based on the horizontal coordinate of the starting character, the width of the selected area, and the height of the selected area.

[0181] S1016, scaling the selected area information according to the scaling information to obtain the scaled selected area information, performing selection drawing according to the scaled selected area information in the selection drawing canvas corresponding to the target format document page to obtain the current selection document page.

[0182] In the above embodiment, by responding to the selection event for the target format document page in the browser, the standard position is restored according to the scaling information and then matched with the standard position information corresponding to each character, and the selected area information is determined. Finally, the selected area information is scaled according to the scaling information and then the selection is drawn on the selection drawing canvas to obtain the current selection document page, thereby improving the accuracy of the selection drawing and avoiding inconsistencies.

[0183] In a specific embodiment, Fig.11As shown, it is a schematic diagram of the framework of document page processing. Specifically, when the terminal displays the PDF document page in the browser, the standard position information of each character in the PDF page is obtained by selecting the processing engine for position calculation, including the position coordinates of each character and the width and height of the character. That is, the terminal establishes a standard coordinate system based on the standard file size of the current PDF page, collects the horizontal coordinates, vertical coordinates, width, height, font information, etc. of the drawn characters, and then stores the standard position information of each character sustainably. At the same time, the pdf.js framework is used to parse binary data and the PDF content is drawn in the original canvas corresponding to the target format document page through the rendering capability, so as to obtain the target format document page. Then, the terminal can check whether the selection event is triggered in the PDF page. When the selection event is detected, the selection event is responded to, the trigger position information of the selection event is obtained, and then the trigger position information is matched with the stored standard position information of each character to obtain the standard position information of each selected character, and then the standard position information of each selected character is combined and calculated to obtain the selected area information, and then the rendering capability is used to select and draw according to the selected area information in the mirrored canvas of the original canvas, so as to obtain the question and answer page of the selected area. That is, by using the selection drawing canvas for selection and drawing, there is no need to use the selection method natively supported by the browser for selection drawing, which can reduce the native nodes of the document page, thereby improving the performance of document page processing, and can ensure the consistency of the selection experience in various environments, providing a smoother and smoother selection operation experience, and at the same time ensure that the selection drawing can always be kept in the same position with its corresponding text, thereby greatly improving the accuracy of the selection and avoiding problems such as miscalculation and random calculation.

[0184] In a specific embodiment, the document page processing method is applied to a computer terminal. Specifically, the computer terminal displays a PDF document page in a browser. The left side of the browser displays a thumbnail of the PDF document page, and the right side displays the PDF document page. Then the user can select text in an area in the PDF document page by dragging the mouse, such as Fig.12As shown, it is a schematic diagram of the target selection document page in the computer terminal. Among them, the computer terminal detects the mouse drag operation on the target format document page in the browser, and obtains the event start position information and event end position information. Then, based on the event start position information and event end position information, it matches with the standard position information corresponding to each character to obtain the standard position information of the selected characters corresponding to the selection event, that is, the standard position information of the selected characters "P", "D" and F is obtained. Then, the standard position information of the selected characters "P", "D" and F is merged to obtain the selected area information where the character string "PDF" is located. Then, in the mirrored canvas of the content drawing canvas corresponding to the PDF document page, selection and drawing are performed according to the selected area information and the pre-set area drawing information to obtain the target format document page of the selected area.

[0185] In a specific embodiment, the document page processing method is applied to a mobile terminal. Specifically, the mobile terminal displays a PDF document page in a browser. Then the user can press a text in the PDF document page to select an area, and then drag the endpoints left and right to expand and reduce the area, such as Fig.13 As shown, it is a schematic diagram of the target selection document page in the mobile terminal. Among them, the mobile terminal detects the selection event for the target format document page in the browser, for example, when pressing the text operation, the event start position information and event end position information are obtained. Then, based on the event start position information and event end position information, the standard position information corresponding to each character is matched to obtain the standard position information of the selected characters corresponding to the selection event, that is, the standard position information of the selected characters "P", "D" and F is obtained. Then, the standard position information of the selected characters "P", "D" and F is merged to obtain the selected area information where the string "PDF" is located. Then, in the mirrored canvas of the content drawing canvas corresponding to the PDF document page, the selected area information and the area drawing information are selected and drawn to obtain the target format document page of the selected area. Then, further operations can be performed on the selected area, such as editing, marking, copying, etc. of the text in the selection, thereby improving the accuracy of subsequent operations.

[0186] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0187] Based on the same inventive concept, the embodiment of the present application also provides a document page processing device for implementing the document page processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more document page processing device embodiments provided below can refer to the limitations of the document page processing method above, and will not be repeated here.

[0188] In one embodiment, Fig.14 As shown, a document page processing device 1400 is provided, including: an event response module 1402, a position acquisition module 1404, a position matching module 1406, a region merging module 1408 and a selection and drawing module 1410, wherein:

[0189] An event response module 1402 is used to respond to a selection event for a target format document page in a browser, and obtain event start position information and event end position information;

[0190] The position acquisition module 1404 is used to acquire standard position information corresponding to each character in the target format document page, where the standard position information is obtained by drawing the page content in the content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document;

[0191] The position matching module 1406 is used to match the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event;

[0192] A region merging module 1408 is used to merge regions based on standard position information corresponding to the selected characters to obtain selected region information corresponding to the selection event;

[0193] The selection and drawing module 1410 is used to perform selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page.

[0194] In one embodiment, the document page processing apparatus 1400 further includes:

[0195] The content drawing module is used to respond to the display event of the target format document in the browser, obtain the original position information corresponding to each character in the target format document; convert the original position information corresponding to each character based on the content drawing canvas corresponding to the target format document page to obtain the standard position information corresponding to each character; draw the page content according to the standard position information corresponding to each character in the content drawing canvas corresponding to the target format document page to obtain the target format document page, and generate the selection area drawing canvas corresponding to the target format document page according to the content drawing canvas corresponding to the target format document page.

[0196] In one embodiment, the content drawing module is further used to obtain canvas conversion information corresponding to the content drawing canvas and content conversion information; convert the original position information corresponding to each character according to the canvas conversion information and the content conversion information to obtain the standard position information corresponding to each character.

[0197] In one embodiment, the standard position information includes standard character width and height information and standard character coordinate information; the content drawing module is also used to convert the original character coordinate information in the original position information according to the canvas conversion information and the content conversion information to obtain the standard character coordinate information; calculate the ratio based on the original character coordinate information and the corresponding standard character coordinate information to obtain the scaling ratio; scale the original character width and height information in the original position information according to the scaling ratio to obtain the standard character width and height information; determine the standard position information corresponding to each character based on the standard character coordinate information and the standard character width and height information.

[0198] In one embodiment, the position matching module 1406 is also used to obtain scaling information, restore the event start position information and the event end position information to the standard position according to the scaling information, and obtain the event start standard position information and the event end standard position information; match the event start standard position information and the event end standard position information with the standard position information corresponding to each character, and obtain the standard position information of the selected character corresponding to the selection event.

[0199] In one embodiment, the selection and drawing module 1410 is also used to scale the selected area information according to the scaling information to obtain the scaled selected area information; and perform selection drawing according to the scaled selected area information in the selection drawing canvas corresponding to the target format document page to obtain the current selection document page.

[0200] In one embodiment, the position matching module 1406 is also used to match the event starting position information with the standard position information corresponding to each character to obtain the standard position information of the starting selected character; match the event ending position information with the standard position information corresponding to each character to obtain the standard position information of the ending selected character; calculate the selection area coordinate range according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the selection area coordinate range; search for the standard position information within the selection area coordinate range from the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection area event.

[0201] In one embodiment, the position matching module 1406 is also used to use the horizontal coordinate in the standard position information of the starting selected character as the starting coordinate of the range, and the horizontal coordinate in the standard position information of the ending selected character as the ending coordinate of the range when the vertical coordinate in the standard position information of the starting selected character is the same as the vertical coordinate in the standard position information of the ending selected character, to obtain the horizontal coordinate range; and determine the selection area coordinate range based on the vertical coordinate and horizontal coordinate range in the standard position information of the starting selected character.

[0202] In one embodiment, the position matching module 1406 is also used to determine the starting row coordinate range based on the starting character's horizontal coordinate in the standard position information of the starting selected character and the horizontal coordinate greater than the starting character's horizontal coordinate when the vertical coordinate in the standard position information of the ending selected character is different; determine the ending row coordinate range based on the ending character's horizontal coordinate in the standard position information of the ending selected character and the horizontal coordinate less than the ending character's horizontal coordinate; determine the middle row coordinate range based on the vertical coordinate between the vertical coordinate in the standard position information of the starting selected character and the vertical coordinate in the standard position information of the ending selected character; determine the selection area coordinate range based on the starting row coordinate range, the ending row coordinate range and the middle row coordinate range.

[0203] In one embodiment, the vertical coordinates in the standard position information corresponding to the selected characters are the same; the area merging module 1408 is also used to obtain the starting character horizontal coordinate, the ending character horizontal coordinate and the ending character width from the standard position information corresponding to the selected characters, calculate the fusion width of the ending character horizontal coordinate and the ending character width, and calculate the difference between the fusion width and the starting character horizontal coordinate to obtain the selected area width; obtain each character height from the standard position information corresponding to the selected character, select the character height that meets the preset height condition from each character height, and obtain the selected area height; determine the selected area information corresponding to the selection event based on the starting character horizontal coordinate, the selected area width and the selected area height.

[0204] In one embodiment, the vertical coordinates in the standard position information corresponding to the selected characters are different; the region merging module 1408 is further used to divide the standard position information corresponding to the selected characters according to the vertical coordinates in the standard position information corresponding to the selected characters to obtain at least two standard position information sets, the vertical coordinates of the standard position information in the standard position information sets are the same, and the vertical coordinates of the standard position information in different standard position information sets are different; obtain the current starting character horizontal coordinate, the current ending character horizontal coordinate and the current ending character width from the current standard position information set in the at least two standard position information sets, calculate the current fusion width of the current ending character horizontal coordinate and the current ending character width, and calculate the current fusion width The difference between the horizontal coordinate of the current starting character and the horizontal coordinate of the current starting character is obtained to obtain the current area width corresponding to the current standard position information set; each current character height is obtained from the current standard position information set, and the current character height that meets the preset height condition is selected from each current character height to obtain the current area height corresponding to the current standard position information set; based on the horizontal coordinate of the current starting character, the current area width and the current area height, the merged area information corresponding to the current standard position information set is determined; traverse at least two standard position information sets to obtain the merged area information corresponding to at least two standard position information sets respectively, and use the merged area information corresponding to at least two standard position information sets respectively as the selected area information corresponding to the selection event.

[0205] In one embodiment, the document page processing apparatus 1400 further includes:

[0206] The cleaning module is used to respond to the selection cancel event for the target selection document page, call the canvas cleaning interface to clean the selection drawing canvas corresponding to the target selection document page, and obtain the target format document page.

[0207] Each module in the document page processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0208] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.15As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store standard position information of each character, target format document page data, etc. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a document page processing method is implemented.

[0209] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.16 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a document page processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0210] Those skilled in the art will understand that Fig.15 or Fig.16The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0211] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0212] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0213] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0214] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0215] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0216] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0217] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A document page processing method, It is characterized in that The method comprises: Responding to a selection event for a target format document page in a browser, obtaining event start position information and event end position information; Acquire standard position information corresponding to each character in the target format document page, wherein the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on original position information of each character in the target format document; Based on the event start position information and the event end position information, matching is performed with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event; Merging regions based on standard position information corresponding to the selected characters to obtain selected region information corresponding to the selection event; In the selected area drawing canvas corresponding to the target format document page, the selected area is drawn according to the selected area information to obtain the target selected area document page.

2. The method according to claim 1, It is characterized in that Before responding to the selection event of the target format document page in the browser, the method further includes: In response to a display event for a target format document in the browser, obtaining original position information corresponding to each character in the target format document; Drawing a canvas based on the content corresponding to the target format document page to convert the original position information corresponding to each character to obtain the standard position information corresponding to each character; In the content drawing canvas corresponding to the target format document page, the page content is drawn according to the standard position information corresponding to each character to obtain the target format document page, and the selection area drawing canvas corresponding to the target format document page is generated according to the content drawing canvas corresponding to the target format document page.

3. The method according to claim 2, It is characterized in that The converting the original position information corresponding to each character based on the content drawing canvas corresponding to the target format document page to obtain the standard position information corresponding to each character includes: Obtaining canvas conversion information corresponding to the content drawing canvas, and obtaining content conversion information; The original position information corresponding to each character is converted according to the canvas conversion information and the content conversion information to obtain the standard position information corresponding to each character.

4. The method according to claim 3, It is characterized in that The standard position information includes standard character width and height information and standard character coordinate information; The converting the original position information corresponding to each character according to the canvas conversion information and the content conversion information to obtain the standard position information corresponding to each character includes: Converting the original character coordinate information in the original position information according to the canvas conversion information and the content conversion information to obtain standard character coordinate information; Calculate the ratio of the original character coordinate information to the corresponding standard character coordinate information to obtain a scaling ratio; Scaling the original character width and height information in the original position information according to the scaling ratio to obtain standard character width and height information; The standard position information corresponding to each character is determined based on the standard character coordinate information and the standard character width and height information.

5. The method according to claim 1, It is characterized in that The matching based on the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event includes: Acquire the zoom information, and restore the event start position information and the event end position information to standard positions according to the zoom information to obtain the event start standard position information and the event end standard position information; The event start standard position information and the event end standard position information are matched with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event.

6. The method according to claim 5, It is characterized in that The step of performing selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page includes: Scaling the selected area information according to the scaling information to obtain scaled selected area information; In the selected area drawing canvas corresponding to the target format document page, the selected area drawing is performed according to the zoomed selected area information to obtain the current selected area document page.

7. The method according to claim 1, It is characterized in that The matching based on the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event includes: Based on the matching of the event start position information with the standard position information corresponding to each character, the standard position information of the start selected character is obtained; Based on the matching of the event termination position information with the standard position information corresponding to each character, the standard position information of the termination selected character is obtained; Calculate the coordinate range of the selected area according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the coordinate range of the selected area; The standard position information corresponding to each character is searched for the standard position information within the selection area coordinate range to obtain the standard position information of the selected character corresponding to the selection area event.

8. The method according to claim 7, It is characterized in that The calculating the coordinate range of the selected area according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the coordinate range of the selected area includes: When the ordinate in the standard position information of the start selected character is the same as the ordinate in the standard position information of the end selected character, the abscissa in the standard position information of the start selected character is used as the start coordinate of the range, and the abscissa in the standard position information of the end selected character is used as the end coordinate of the range, to obtain the abscissa range; The selection area coordinate range is determined based on the ordinate in the standard position information of the initially selected character and the abscissa range.

9. The method according to claim 7, It is characterized in that The calculating the coordinate range of the selected area according to the standard position information of the starting selected character and the standard position information of the ending selected character to obtain the coordinate range of the selected area includes: When the ordinate in the standard position information of the start selected character is different from the ordinate in the standard position information of the end selected character, determining the start row coordinate range based on the start character abscissa in the standard position information of the start selected character and abscissa greater than the start character abscissa; Determine a terminating row coordinate range based on a terminating character abscissa in the standard position information of the terminating selected character and abscissas smaller than the terminating character abscissa; Determine the middle row coordinate range based on the ordinate between the ordinate in the standard position information of the start selected character and the ordinate in the standard position information of the end selected character; The selected area coordinate range is determined based on the starting row coordinate range, the ending row coordinate range and the middle row coordinate range.

10. The method according to claim 1, It is characterized in that The vertical coordinates in the standard position information corresponding to the selected characters are the same; The performing of region merging based on the standard position information corresponding to the selected character to obtain the selected region information corresponding to the selection event includes: Obtaining the starting character horizontal coordinate, the ending character horizontal coordinate and the ending character width from the standard position information corresponding to the selected character, calculating the fusion width of the ending character horizontal coordinate and the ending character width, and calculating the difference between the fusion width and the starting character horizontal coordinate to obtain the selected area width; Acquire the height of each character from the standard position information corresponding to the selected character, select the character height that meets the preset height condition from the various character heights, and obtain the height of the selected area; The selected area information corresponding to the selection event is determined based on the starting character horizontal coordinate, the selected area width and the selected area height.

11. The method according to claim 1, It is characterized in that The vertical coordinates in the standard position information corresponding to the selected characters are different; The performing of region merging based on the standard position information corresponding to the selected character to obtain the selected region information corresponding to the selection event includes: Dividing the standard position information corresponding to the selected character according to the vertical coordinates in the standard position information corresponding to the selected character to obtain at least two standard position information sets, wherein the vertical coordinates of the standard position information in the standard position information sets are the same, and the vertical coordinates of the standard position information in different standard position information sets are different; Obtaining the current starting character horizontal coordinate, the current ending character horizontal coordinate and the current ending character width from the current standard position information set of the at least two standard position information sets, calculating the current fused width of the current ending character horizontal coordinate and the current ending character width, and calculating the difference between the current fused width and the current starting character horizontal coordinate, to obtain the current area width corresponding to the current standard position information set; Acquire each current character height from the current standard position information set, select a current character height that meets a preset height condition from the current character heights, and obtain a current area height corresponding to the current standard position information set; Determine the merged area information corresponding to the current standard position information set based on the current starting character horizontal coordinate, the current area width and the current area height; The at least two standard location information sets are traversed to obtain the merged area information corresponding to the at least two standard location information sets respectively, and the merged area information corresponding to the at least two standard location information sets respectively is used as the selected area information corresponding to the selection event.

12. The method according to claim 1, It is characterized in that After performing selection drawing in the selection drawing canvas corresponding to the target format document page according to the selected area information to obtain the target selection document page, the method further includes: In response to the selection cancel event for the target selection document page, a canvas cleaning interface is called to clean up the selection drawing canvas corresponding to the target selection document page to obtain the target format document page.

13. A document page processing device, It is characterized in that The device comprises: An event response module, used to respond to a selection event for a target format document page in a browser, and obtain event start position information and event end position information; A position acquisition module, used to acquire standard position information corresponding to each character in the target format document page, wherein the standard position information is obtained by drawing page content in a content drawing canvas corresponding to the target format document page based on the original position information of each character in the target format document; A position matching module, used to match the event start position information and the event end position information with the standard position information corresponding to each character to obtain the standard position information of the selected character corresponding to the selection event; A region merging module, used for merging regions based on the standard position information corresponding to the selected characters, to obtain selected region information corresponding to the selection event; The selection and drawing module is used to perform selection drawing according to the selected area information in the selection drawing canvas corresponding to the target format document page to obtain the target selection document page.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

15. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.