Document operation method based on picture display, electronic device and readable storage medium
By obtaining the data model data after the document is converted into a picture on the user device, and performing selection operations and drawing target selections in the document preview interface, the problem of users being unable to make effective text selections on document pages displayed in the form of pictures is solved, and the problem is improved. Improve the display effect and user experience of text processing.
Patent Information
- Application Number
- CN202411554455.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In preview document mode, users cannot perform effective text selection and operation on document pages displayed in the form of pictures, resulting in poor text processing effects.
By obtaining the data model data after the document is converted into an image, including line models and page models, the user device can perform selection operations in the document preview interface, and draw the target selection and cursor based on the selection model data, simulating the selection effect of text processing software .
In the picture display documentation scene, the text selection effect of the text processing software is simulated, and the display effect and user operation experience of text processing are improved.
Smart Images

Figure CN119047422B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a document operation method based on image display, an electronic device, and a readable storage medium. Background Art
[0002] With the rapid development of terminal technology, there are more and more scenarios where users use terminal devices to process documents. Users open and view documents on terminal devices, edit document content, and complete document processing.
[0003] In the preview document mode, the terminal device can display one or more pages in the document, and the user can quickly browse the document pages to learn the document content. In the preview document mode, the terminal device can display the document in the form of pictures, that is, convert the pages in the document into pictures, and in the preview document mode, the terminal device displays the pictures corresponding to the pages.
[0004] When a user needs to operate a page displayed in the preview document mode, for example, copy text, the page is displayed as a picture, so the text selection display effect cannot be achieved, resulting in a poor text display processing effect. Summary of the invention
[0005] In view of this, embodiments of the present application provide a document operation method based on image display, an electronic device, and a readable storage medium to at least partially solve the above problems.
[0006] According to the first aspect of an embodiment of the present application, a document operation method based on image display is provided, comprising: obtaining data model data of the image after the document is converted into the image; the data model comprises a row model and a page model; displaying a document preview interface; the document preview interface comprises an image of at least one page of the document; obtaining a user's selection operation in the document preview interface and position information of the selection operation; if it is determined that the selection operation hits text based on the position information of the selection operation and the data model data, then determining the selection model data of the target selection corresponding to the selection operation; based on the selection model data, drawing the target selection and the cursor in the document preview interface.
[0007] According to a second aspect of an embodiment of the present application, a document operation method based on image display is provided, comprising: a user device obtains a document uploaded by a user through a document management interface displayed by the user device, and sends the document to a server; the user device receives image information sent by the server, wherein the image information is obtained by the server converting the document into an image; the user device receives a document preview operation by the user, and displays a document preview interface in response to the document preview operation; wherein the document preview interface includes an image of at least one page of the document; the user device receives a selection operation by the user in the document preview interface, and in response to the selection operation, draws a target selection and a cursor in the document preview interface when it is determined that the selection operation hits text.
[0008] According to the third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect or the second aspect.
[0009] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0010] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the method described in the first aspect or the second aspect.
[0011] A document operation method based on image display provided in an embodiment of the present application is applicable to a scenario in which a user device displays a page in a document in the form of an image in a display interface. The data model data of the image after the document is converted into an image is obtained, and the user performs a selection operation in the document preview interface to obtain the location information of the selection operation. If the selection operation hits the text, the selection model data of the target selection corresponding to the selection operation is determined, and the target selection and cursor are drawn in the document preview interface according to the selection model data. By predefining the data model and the selection model, the user device can render and display the target selection and cursor in the image, simulating the display effect of the selection operation such as text selection using text processing software, and improving the text processing display effect in the image display document scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0013] Figure 1 A schematic diagram of an exemplary system for a document operation method based on picture display applicable to an embodiment of the present application;
[0014] Figure 2 A flowchart of a document operation method based on image display according to an embodiment of the present application;
[0015] Figure 3 is a flowchart of another method for operating a document based on picture display according to an embodiment of the present application;
[0016] Figure 4 and Figure 5 A set of scene example diagrams in the embodiments of the present application;
[0017] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0019] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0020] Figure 1 An exemplary system of a document operation method based on picture display applicable to an embodiment of the present application is shown. Figure 1 As shown, the system 100 may include a cloud service end 102, a communication network 104 and / or one or more user devices 106. Figure 1 The example in FIG. 1 is a plurality of user devices.
[0021] The cloud server 102 may be any suitable device for storing information, data, programs and / or any other suitable type of content, including but not limited to a distributed storage system device, a server cluster, a computing cloud server cluster, etc. In some embodiments, the cloud server 102 may perform a document-to-image conversion operation to obtain information about the image after the document is converted to the image, and the image information includes text in the image and coordinate information of the text. The cloud server 102 sends the image information to the user device 106.
[0022] In some embodiments, the communication network 104 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 104 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN) and / or any other suitable communication network. The user device 106 can be connected to the communication network 104 via one or more communication links (e.g., a first communication link 112), and the communication network 104 can be linked to the cloud service end 102 via one or more communication links (e.g., a second communication link 114). The communication link can be any communication link suitable for transmitting data between the user device 106 and the cloud service end 102, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link, or any suitable combination of such links.
[0023] The user device 106 may include any one or more user devices suitable for interacting with a user. In some embodiments, the user device 106 may include any suitable type of device. For example, in some embodiments, the user device 106 includes a mobile device, a tablet computer, a laptop computer, a desktop computer, a wearable computer, a game console, a media player, a vehicle entertainment system, and / or any other suitable type of user device. In some embodiments, the user device 106 may obtain the data model data of the image after the document is converted into an image, and display a document preview interface, including an image of at least one page of the document. The user device 106 may obtain the user's selection operation in the document preview interface and the location information of the selection operation, determine the selection model data of the target selection corresponding to the selection operation when the selection operation hits the text, and draw the target selection and cursor in the document preview interface according to the selection model data.
[0024] Based on the above system, an embodiment of the present application provides a document operation method based on image display, which is described below through multiple embodiments.
[0025] Figure 2 is a flowchart of a document operation method based on image display according to an embodiment of the present application, which can be Figure 1 The user equipment shown is executed. Figure 2 As shown, the document operation method based on picture display provided in this embodiment may include:
[0026] Step S202: Obtain data model data of the image after the document is converted into the image. The data model includes a row model and a page model.
[0027] The types of documents include but are not limited to Office documents and PDF documents. Office documents include word documents, excel documents, Visio drawing files, etc.
[0028] In this embodiment, a data model is predefined, and the data model includes a row model and a page model. By predefining the data structure of the data model, the image and the data model data of the image can be associated after the document is converted into an image. The data model data is used to determine the target selection area and the text in the target selection area when the user performs operations such as text selection on the image corresponding to the document.
[0029] In a feasible implementation, the page model includes: the page index, the page width, the page height, the text list in the page, and the coordinate information of the page. Optionally, the coordinate information of the page includes the coordinate information of the text in the page. In addition to text, the page can also include other types of data, such as images. Optionally, the page model also includes the uniform resource locator (URL) of the image, the width and height of the image.
[0030] In a feasible implementation, the row model includes: the row ID, the page ID of the page where the row is located, the text list in the row, and the coordinate information of the row. Optionally, the coordinate information of the row includes: the coordinate information of the text in the row and / or the coordinate information of the entire row.
[0031] The document conversion operation can be performed by the user device or by Figure 1 The cloud service side (also referred to as server) shown is executed.
[0032] In one possible implementation, Figure 3 As shown, in step S202, the data model data of the picture after the document is converted into the picture is obtained, including:
[0033] Step S2022: The user device receives the picture information of the picture after the document is converted into a picture and sent by the server.
[0034] Step S2024: The user device performs protocol conversion on the image information to generate data model data of the image.
[0035] Optionally, the user device communicates with the server based on Hypertext Transfer Protocol (HTTP), and the user device receives image information of the image after the document sent by the server is converted into the image according to the HTTP protocol.
[0036] In this implementation, the server performs the operation of converting the document into a picture. Optionally, the user device displays a document management interface, and the user can perform relevant operations on the document management interface to upload a document. The user device obtains the document uploaded by the user through the document management interface and sends the document to the server. After receiving the document uploaded by the user, the server converts the document into a picture and obtains the picture information of the picture. The server sends the picture information of the picture to the user device so that the user device can subsequently display the document in the form of a picture according to the picture information of the picture. Since the server has a stronger processing capability, the processing burden of the user device to convert the document into a picture is reduced.
[0037] The image information includes the image corresponding to the page, the text in the image, and the coordinate information of the text.
[0038] Perform protocol conversion on the image information to generate the data model data of the image, including:
[0039] Merge text lines and coordinate lines according to the text and text coordinate information in the picture to generate the line model data of the picture;
[0040] The pages are merged according to the row model data of the picture to generate the page model data of the picture.
[0041] By comparing the coordinate information of the text, the text in the same line can be identified, and then all the text included in a line can be obtained by merging the line text, and the coordinates of a whole line can be obtained by merging the line coordinates to generate the line model data of the image. The page includes one or more lines of text, and the page model data of the image is generated by merging the line model data.
[0042] In a feasible implementation, in step S202, obtaining data model data of the image after the document is converted into the image includes:
[0043] The user device performs image conversion on the document to obtain images and image information corresponding to the pages in the document;
[0044] Perform protocol conversion on the image information to generate data model data of the image.
[0045] In this implementation, the document conversion image is processed by the user device, which is flexible and avoids dependence on other devices.
[0046] Step S204: display a document preview interface, which includes a picture of at least one page of the document.
[0047] Specifically, the user device receives a document preview operation from the user. In response to the document preview operation, the user device renders the document according to a picture after the document is converted into a picture or according to the data model data of the picture, and displays a document preview interface. The document preview interface displays the document in the form of a picture, making it convenient for the user to quickly browse the document information.
[0048] This embodiment does not limit the layout of the document preview interface, nor does it limit the number of documents displayed in the document preview interface or the number of pages in the document. For example, the document preview interface displays one page per screen at a time, that is, displays one picture at a time. For another example, the document preview interface displays four pages per screen at a time, that is, displays four pictures at a time. The user can display different pages in the document by pulling up or pulling down. For another example, the document preview interface displays all pages in the document per screen at a time.
[0049] Step S206: Acquire the user's selection operation and location information of the selection operation in the document preview interface.
[0050] The selection operation is used by the user to select an area or text in a target document or target page, so that the user device highlights the selected area or text and intuitively presents the text selection result to the user.
[0051] This embodiment does not limit the selection operation performed by the user, and it may be different according to the type of user device. For example, if the user device is a mobile phone or a tablet computer, the selection operation performed by the user may be a single-finger long press operation or a two-finger long press operation. If the user device is a desktop computer, the selection operation performed by the user may be a long press of the left mouse button and dragging.
[0052] When a user performs a selection operation in the document preview interface, the position information of the selection operation obtained by the user device is determined based on the screen coordinate system. Specifically, the user device detects the operation point of the selection operation on the screen. For example, if the user long presses with one finger in the document preview interface displayed on the mobile phone, the operation point is the contact point between the user's finger and the screen. The position information of the selection operation is determined in the screen coordinate system.
[0053] Optionally, the document operation method based on image display provided in this embodiment further includes:
[0054] Bind to predefined user events.
[0055] In step S206, the user's selection operation in the document preview interface is obtained, including:
[0056] Receive the user's first operation in the document preview interface;
[0057] The first operation is compared with a predefined user event to determine that the first operation is a selection operation.
[0058] By predefining user events and binding them, you can identify and distinguish different user operations and avoid processing user erroneous operations.
[0059] Optionally, the user device is a mobile phone or a tablet computer, and the predefined user events include predefined touch events. The user device is a desktop computer, and the predefined user events include predefined mouse events.
[0060] Step S208: If the selection operation hits the text according to the position information of the selection operation and the data model data, the selection model data of the target selection area corresponding to the selection operation is determined.
[0061] It is understood that in addition to text, a document page may also include images and blank areas, and in addition to images corresponding to the page, a document preview interface may also include blank areas. The selection operation performed by the user may hit text or may not hit text. Therefore, in the case where the selection operation hits text, the selection model data of the target selection corresponding to the selection operation is determined.
[0062] In this embodiment, a selection area model is predefined, and the selection area model can be used by the user device to render and highlight the target selection area or the text in the target selection area in the image later.
[0063] Among them, the selection model includes node data (SelectionNode) and selection data (SelectionStore). Node data includes anchorNode data and focusNode data. The anchor node is the first text of the first line of all the lines in the selection. The anchor node data includes: the identifier of the page where the anchor node is located, the identifier of the line where the anchor node is located, and the text of the anchor node. The tail node is the last text of the last line of all the lines in the selection. The tail node data includes: the identifier of the page where the tail node is located, the identifier of the line where the tail node is located, and the text of the first node. The selection data includes the coordinates of the selection and the text in the selection. The selection is usually rectangular, and the coordinates of the selection can include the identifier of the line occupied by the rectangular selection in the page, specifically including the identifiers of the lines at the left, right, top, and bottom boundaries.
[0064] The selection model may also include selection operation data (SelectionPos). The selection operation data includes: an identifier of the page where the selection operation position is located, and an identifier of the row where the selection operation position is located.
[0065] Step S210: Draw the target selection area and cursor in the document preview interface according to the selection area model data.
[0066] Specifically, the document preview interface displays an image corresponding to the page of the document, and according to the selection model data, the target selection area and the cursor can be rendered in the image to achieve a display effect similar to text selection in text processing software. For example, the display effect is similar to the effect of highlighting the selected text when the user selects part of the text in Office software.
[0067] It can be seen that the document operation method based on image display provided in this embodiment is suitable for the scenario where the user device displays the page in the document in the form of an image in the display interface. The data model data of the image after the document is converted into an image is obtained, including the row model data and the page model data. When the user performs a selection operation in the document preview interface, the location information of the selection operation is obtained. If the selection operation hits the text, the selection model data of the target selection corresponding to the selection operation is determined, and the target selection and cursor are drawn in the document preview interface according to the selection model data. Through the predefined data model, the image converted from the document is associated with the page data and the row data. Through the predefined selection model, the target selection and cursor are rendered and displayed in the image corresponding to the page according to the selection model data of the target selection corresponding to the user's selection operation, which simulates the selection display effect such as text selection in the text processing process using text processing software, and improves the text processing display effect in the image display document scenario.
[0068] In a feasible implementation, in step S208, determining the hit text of the selection operation according to the location information of the selection operation and the data model data includes:
[0069] Convert the position information of the selection operation from screen coordinates to page coordinates to obtain the coordinates of the selection operation in the page coordinate system;
[0070] Determine a target image hit by the selection operation and a target selection in the target image according to the selection operation and the coordinates of the selection operation in the page coordinate system;
[0071] Determine that the target selection includes text based on the data model data of the target image.
[0072] Specifically, the location information of the selection operation is determined based on the screen coordinate system of the user device. It is necessary to perform a coordinate system conversion on the location information of the selection operation, from the screen coordinate system to the page coordinate system, to obtain the coordinates of the selection operation in the page coordinate system. According to the selection operation and the coordinates of the selection operation in the page coordinate system, the target image hit by the selection operation and the target selection in the target image are determined. For example, the selection operation is a user's single-finger long press operation, which is used to select the text in the area near the user's finger in the page. Then, for the user's single-finger long press operation, the target image can be determined from the multiple images displayed in the document preview interface according to the coordinates of the contact point between the user's finger and the screen in the page coordinate system, that is, the target page in the document is determined, and the preset area range centered on the contact point between the user's finger and the screen is used as the target selection. According to the data model data of the target image, it is determined whether the target selection includes text. If it is determined that the target selection includes text, the selection operation hits the text, and the selection model data of the target selection corresponding to the selection operation is continued to be determined.
[0073] In a feasible implementation, in step S208, determining the selection area model data of the target selection area corresponding to the selection operation includes:
[0074] Acquire the first node text and the last node text in the text included in the target selection area according to the data model data of the target image;
[0075] Generate node data according to the first node text and the last node text;
[0076] Generate district data according to the target district;
[0077] Determine the district model data of the target district according to the node data and the district data.
[0078] Through the data structure of the predefined data model, the data model data of the target image includes the page information, row information, text in the target image, and the coordinate information of the page, row, and text. According to the data model data of the target image, the first node text, the last node text, the coordinate information of the target selection and the text in the target selection can be obtained, and the selection model data of the target selection is generated, so that the subsequent user device can render and highlight the target selection or the text in the target selection in the image to improve the display effect.
[0079] Optionally, the document operation method based on image display provided in this embodiment may further include:
[0080] Receive the user's document zoom operation;
[0081] In response to a document zoom operation, determining a text zoom factor corresponding to the document zoom operation;
[0082] Update the selection model data of the target selection according to the text zoom factor;
[0083] According to the updated selection model data of the target selection, the target selection and cursor are updated in the document preview interface.
[0084] Optionally, update the selection model data of the target selection according to the text scaling factor, including:
[0085] Perform scaling coordinate conversion on the target selection according to the text scaling factor and update the selection data;
[0086] Update the district model data of the target district according to the updated district data and node data.
[0087] Specifically, the document zoom operation can be a two-finger pinch-to-expand operation performed by the user in the document preview interface, or a user's finger double-click operation, etc. This embodiment does not limit this, and it may vary according to the type of user device. Determine the text zoom factor corresponding to the document zoom operation. For example, for the two-finger pinch-to-expand operation, the text zoom factor can be determined according to the moving distance and direction of the user's two fingers. Generally, the greater the moving distance of the user's two fingers, the greater the text zoom factor; when the user's two fingers are extended or moved away, it is used to zoom in on the document; when the user's two fingers are pinched, it is used to zoom out on the document. Optionally, in order to ensure the text zoom display effect, the range of the text zoom factor can be preset. For another example, the user's finger double-click operation can correspond to a preset text zoom factor. Generally, if the document is currently in a normal display state, the user's finger double-click operation is used to zoom in on the document; on the contrary, if the document is currently in an enlarged display state, the user's finger double-click operation is used to zoom out on the document, so that the document returns to a normal display state. The selection model data of the target selection is updated according to the text scaling factor, and the target selection and cursor are updated in the document preview interface based on the updated selection model data of the target selection, so as to simulate the display effect of text scaling during text processing using text processing software, thereby improving the text processing display effect in the image display document scenario.
[0088] Optionally, the document operation method based on image display provided in this embodiment may further include:
[0089] The boundary of the target selection is detected to determine that the target selection is within the display range of the image corresponding to the target selection.
[0090] According to the data model data of the target image where the target selection is located, it can be determined whether the target selection exceeds the display range of the image corresponding to the page, thereby improving the document operation and display effects.
[0091] The following, combined Figure 4 and Figure 5 , the above process is exemplarily described from the perspective of the document preview interface displayed on the user device and the perspective of the user's operation on the user device.
[0092] Figure 4 This is an example of a scenario in an embodiment of the present application. Figure 4 As shown in (a) of FIG. 4 , the user device displays a document preview interface 401, which includes 4 pictures, that is, 4 pages in the document are displayed. Figure 4 As shown in (b) in FIG. 4 , the user performs a long press operation 402 on the lower left picture displayed in the document preview interface 401. The user device determines that the long press operation 402 hits the text, and determines the target selection area and the text in the target selection area, that is, the first two lines of text in the lower left picture in the document preview interface 401. Figure 4 As shown in (c) in FIG. 1 , the user device draws the target selection (the gray background portion in the figure) and the first cursor 403 and the second cursor 404 based on the selection model data. It can be seen that in the scenario where the user device displays the pages in the document in the form of pictures, the selection display effect such as text selection in the text processing process using text processing software is simulated, which improves the text processing display effect in the scenario of displaying documents in pictures.
[0093] Figure 5 This is another example of a scenario in the embodiment of the present application. Figure 5 As shown in (a) in the figure, the user device displays a document preview interface 401, which includes two pictures, that is, two pages in the document are displayed. The user performs a long press operation 402 on the upper picture displayed in the document preview interface 401. The user device determines that the long press operation 402 hits the text, and determines the target selection and the text in the target selection. For the convenience of display, the text in the target selection is represented by "Y", and the other text in the picture is represented by "X". For the display effect of the target selection, see Figure 5 As shown in (b) of FIG. 1 , the target selection area is displayed with a gray background color, and a first cursor 403 of the first node text and a second cursor 404 of the last node text are displayed. Figure 5 As shown in (c) of FIG. 4 , the user performs a quick double-click operation 405 with a finger in the upper picture displayed in the document preview interface 401 to enlarge the text. In response to the quick double-click operation 405 with a finger, the user device obtains a preset text zoom factor, for example, to enlarge the display by 1.2 times. The user device updates the drawing target selection area and the cursor in the document preview interface 401 according to the preset text zoom factor, see Figure 5As shown in (d) in the figure, after zooming in, the upper picture in the document preview interface 401 displays part of the enlarged content of the document, for example, the first cursor 403 of the first node text is displayed, but the second cursor 404 of the tail node text is not displayed. The user can view other contents of the document by moving his finger left and right in the picture. The lower picture in the document preview interface 401 still maintains the previous display. It can be seen that in the scenario where the user device displays the pages in the document in the form of pictures, the selection display effect such as text selection in the process of zooming in and displaying the text using text processing software is simulated, which improves the text processing display effect in the picture display document scenario.
[0094] Reference Figure 6 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0095] like Figure 6 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0096] in:
[0097] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0098] The communication interface 504 is used to communicate with other electronic devices or servers.
[0099] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned document operation method embodiment based on image display.
[0100] Specifically, the program 510 may include program codes, which include computer operation instructions.
[0101] The processor 502 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0102] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0103] The program 510 may include multiple computer instructions. Specifically, the program 510 may enable the processor 502 to execute operations corresponding to the document operation method based on image display described in any of the aforementioned multiple method embodiments through the multiple computer instructions.
[0104] The specific implementation of each step in program 510 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0105] The present application also provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above-mentioned multiple method embodiments is implemented. The computer storage medium includes, but is not limited to: a compact disc read-only memory (CD-ROM), a random access memory (RAM), a floppy disk, a hard disk, or a magneto-optical disk, etc.
[0106] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any one of the document operation methods based on image display in the above-mentioned multiple method embodiments.
[0107] In addition, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present 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 the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0108] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0109] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., a random access memory (RAM), a read-only memory (ROM), a flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.
[0110] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0111] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A document operation method based on image display, comprising: Obtain data model data of the image after the document is converted into the image; The data model includes a row model and a page model; the row model includes: a row identifier, a page identifier of the page where the row is located, a text list in the row, and coordinate information of the row; Displaying a document preview interface; the document preview interface includes a picture of at least one page of the document; Acquire a user's selection operation in the document preview interface and location information of the selection operation; If the selection operation hits the text according to the position information of the selection operation and the data model data, then the selection model data of the target selection area corresponding to the selection operation is determined; Drawing the target selection area and the cursor in the document preview interface according to the selection area model data; The determining the hit text of the selection operation according to the position information of the selection operation and the data model data includes: The position information of the selection operation is converted from screen coordinates to page coordinates to obtain the coordinates of the selection operation in the page coordinate system; based on the selection operation and the coordinates of the selection operation in the page coordinate system, the target image hit by the selection operation and the target selection in the target image are determined; based on the data model data of the target image, it is determined that the target selection includes text.
2. The method according to claim 1, wherein: The determining of the selection area model data of the target selection area corresponding to the selection area operation includes: Acquire the first node text and the last node text in the text included in the target selection area according to the data model data of the target image; Generate node data according to the first node text and the last node text; Generate selection area data according to the target selection area; The selection area model data of the target selection area is determined according to the node data and the selection area data.
3. The method according to claim 2, wherein: The method further comprises: Receive the user's document zoom operation; In response to the document zooming operation, determining a text zoom factor corresponding to the document zooming operation; Performing scaling coordinate conversion on the target selected area according to the text scaling coefficient, and updating the selected area data; Update the selection area model data of the target selection area according to the updated selection area data and the node data; The target selection area and the cursor are updated and drawn in the document preview interface according to the updated selection area model data of the target selection area.
4. The method according to any one of claims 1 to 3, wherein: The method further comprises: Boundary detection is performed on the target selection area to determine that the target selection area is within a display range of the image corresponding to the target selection area.
5. The method according to any one of claims 1 to 3, wherein: The method further comprises: Bind predefined user events; The obtaining of the user's selection operation in the document preview interface includes: Receiving a first operation of a user in the document preview interface; The first operation is compared with the predefined user event to determine that the first operation is the area selection operation.
6. The method according to any one of claims 1 to 3, wherein: The acquiring of the data model data of the picture after the document is converted into the picture includes: receiving image information of the image after the document sent by the server is converted into the image; The image information is subjected to protocol conversion to generate data model data of the image.
7. The method according to claim 6, wherein: The picture information includes the text in the picture and the coordinate information of the text; The performing protocol conversion on the picture information to generate data model data of the picture includes: Merging text rows and coordinate rows according to the text in the picture and the coordinate information of the text to generate row model data of the picture; Pages are merged according to the row model data of the picture to generate page model data of the picture.
8. The method according to claim 6, wherein: The image information of the image after the document sent by the receiving server is converted into the image includes: According to the hypertext transfer protocol HTTP, the image information of the image after the document sent by the server is converted into the image is received.
9. A document operation method based on image display, comprising: The user device obtains a document uploaded by the user through the document management interface displayed by the user device, and sends the document to the server; The user device receives the picture information sent by the server, wherein the picture information is obtained by the server converting the document into a picture; The user device receives a document preview operation of the user, and displays a document preview interface in response to the document preview operation; wherein the document preview interface includes a picture of at least one page of the document; The user device receives a selection operation of the user in the document preview interface, and in response to the selection operation, draws a target selection area and a cursor in the document preview interface when it is determined that the selection operation hits text; The determining that the selection operation hits the text includes: Convert the position information of the selection operation from screen coordinates to page coordinates to obtain the coordinates of the selection operation in the page coordinate system; determine the target image hit by the selection operation and the target selection in the target image based on the selection operation and the coordinates of the selection operation in the page coordinate system; determine whether the target selection includes text based on the data model data of the target image; the data model data includes a row model and a page model, and the row model includes: a row identifier, a page identifier of the page where the row is located, a text list in the row, and row coordinate information.
10. The method according to claim 9, wherein: The method further comprises: The user device receives a two-finger pinch-to-expand operation performed by the user in the document preview interface; In response to the two-finger pinch-expand operation, acquiring a two-finger moving distance and direction of the user, and determining a text zoom factor according to the two-finger moving distance and direction; Update the selection area model data of the target selection area according to the text scaling factor; The target selection area and the cursor are updated and drawn in the document preview interface according to the updated selection area model data of the target selection area.
11. The method according to claim 9, wherein: The method further comprises: The user device receives a double-click operation performed by the user in the document preview interface; In response to the double-click operation, obtaining a preset text zoom factor; Update the selection area model data of the target selection area according to the preset text scaling factor; The target selection area and the cursor are updated and drawn in the document preview interface according to the updated selection area model data of the target selection area.
12. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1-11.
13. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
14. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to execute operations corresponding to the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Printing processing method, device and equipment
CN118051192A
File online operation scene conversion method, device and system and storage medium
CN118152346A