Picture display-based document operation method, electronic device, and readable storage medium
By acquiring the data model data after the document is converted into an image, recognizing the user's selection operation, and drawing the selection area and cursor, the problem of difficult text selection in the document preview mode of the terminal device is solved, and the text processing effect in the document displayed as an image is improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- UC MOBILE CHINA CO LTD
- Filing Date
- 2025-08-27
- Publication Date
- 2026-05-07
AI Technical Summary
When a document is displayed as an image in the preview mode on a terminal device, users cannot effectively select or manipulate text, resulting in poor text display quality.
By acquiring the data model data after the document is converted into an image, including the line model and page model, the system recognizes the user's selection operation, determines the target selection area, draws the selection area and cursor, and simulates the selection display effect of text processing software.
It improves the text processing and display effects in scenarios where images are displayed as documents, and realizes the simulation of text selection and scaling, thereby enhancing the user experience.
Smart Images

Figure CN2025117240_07052026_PF_FP_ABST
Abstract
Description
Image-based document manipulation methods, electronic devices, and readable storage media
[0001] This disclosure claims priority to Chinese Patent Application No. 202411554455.8, filed with the China Patent Office on November 4, 2024, entitled "Document Operation Method Based on Image Display, Electronic Device and Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This disclosure relates to the field of computer technology, and more particularly to a document operation method, electronic device, and readable storage medium based on image display. Background Technology
[0003] With the rapid development of terminal technology, users are increasingly using terminal devices to process documents. Users open, view, and edit document content on their terminal devices to complete document processing.
[0004] In document preview mode, the terminal device can display one or more pages from a document, allowing users to quickly browse the document and understand its content. The terminal device can also display the document as images in preview mode; that is, the pages in the document are converted into images, and the terminal device displays the corresponding images in preview mode.
[0005] When users need to perform operations on the page displayed in the preview document mode, such as copying text, the text selection effect cannot be achieved because the page is displayed as an image, resulting in poor text display processing. Summary of the Invention
[0006] In view of the above, embodiments of this disclosure provide a document operation method, electronic device, and readable storage medium based on image display to at least partially solve the above problems.
[0007] According to a first aspect of the present disclosure, a document operation method based on image display is provided, comprising: acquiring data model data of the image after the document is converted into an image; the data model including a line model and a page model; displaying a document preview interface; the document preview interface including an image of at least one page of the document; acquiring a selection operation performed by a user in the document preview interface and the 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 area corresponding to the selection operation; and drawing the target selection area and a cursor in the document preview interface based on the selection model data.
[0008] According to a second aspect of the present disclosure, a document operation method based on image display is provided, comprising: a user device acquiring a document uploaded by a user through a document management interface displayed on the user device, and sending the document to a server; the user device receiving image information sent by the server, wherein the image information is obtained by the server converting the document into an image; the user device receiving a document preview operation from the user, and displaying 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 receiving a selection operation from the user in the document preview interface, and drawing a target selection area and a cursor in the document preview interface in response to the selection operation, when it is determined that the selection operation hits text.
[0009] According to a third aspect of the present disclosure, an electronic device is provided, 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, wherein the executable instruction causes the processor to perform an operation corresponding to the method described in the first or second aspect.
[0010] According to a fourth aspect of the present disclosure, a computer storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method as described in the first or second aspect.
[0011] According to a fifth aspect of the present disclosure, a computer program product is provided, including computer instructions that instruct a computing device to perform an operation corresponding to the method described in the first or second aspect.
[0012] A document operation method based on image display, provided by an embodiment of this disclosure, is applicable to scenarios where user devices display pages from a document as images on a display interface. The method involves acquiring the data model data of the image after the document is converted into an image, allowing the user to perform a selection operation in the document preview interface, obtaining the position information of the selection operation, and determining the selection model data of the target selection area if the selection operation hits text. Based on the selection model data, the target selection area and cursor are then drawn in the document preview interface. By predefining the data model and selection model, the user device can render and display the target selection area and cursor within the image, simulating the display effect of selection operations such as text selection using text processing software, thus improving the text processing display effect in image-display document scenarios. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.
[0014] Figure 1 is a schematic diagram of an exemplary system for a document operation method based on image display applicable to embodiments of the present disclosure;
[0015] Figure 2 is a flowchart of a document operation method based on image display according to an embodiment of the present disclosure;
[0016] Figure 3 is a flowchart of another document operation method based on image display according to an embodiment of the present disclosure;
[0017] Figures 4 and 5 are a set of scenario example diagrams in the embodiments of this disclosure;
[0018] Figure 6 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions in the embodiments of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art should fall within the protection scope of this disclosure.
[0020] The specific implementation of the embodiments of this disclosure will be further described below with reference to the accompanying drawings.
[0021] Figure 1 illustrates an exemplary system for a document manipulation method based on image display applicable to embodiments of this disclosure. As shown in Figure 1, the system 100 may include a cloud server 102, a communication network 104, and / or one or more user devices 106, with multiple user devices being an example in Figure 1.
[0022] The cloud server 102 can be any suitable device for storing information, data, programs, and / or any other suitable type of content, including but not limited to distributed storage system devices, server clusters, computing cloud server clusters, etc. In some embodiments, the cloud server 102 can perform a document-to-image conversion operation to obtain information about the converted image, including text in the image and its coordinates. The cloud server 102 then sends the image information to the user device 106.
[0023] 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 equipment 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 server 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 equipment 106 and the cloud server 102, such as a network link, a dial-up link, a wireless link, a hardwired link, any other suitable communication link, or any suitable combination of such links.
[0024] User device 106 may include any one or more user devices suitable for interacting with a user. In some embodiments, user device 106 may include any suitable type of device. For example, in some embodiments, user device 106 includes mobile devices, tablet computers, laptop computers, desktop computers, wearable computers, game consoles, media players, vehicle entertainment systems, and / or any other suitable type of user device. In some embodiments, user device 106 may acquire data model data of an image after a document has been converted into an image, and display a document preview interface, including an image of at least one page of the document. User device 106 may acquire the user's selection operation and the location information of the selection operation in the document preview interface, determine the selection model data of the target selection area corresponding to the selection operation when the selection operation hits text, and draw the target selection area and cursor in the document preview interface based on the selection model data.
[0025] Based on the above system, this disclosure provides a document operation method based on image display, which will be described below through several embodiments.
[0026] Figure 2 is a flowchart of a document operation method based on image display according to an embodiment of the present disclosure, which can be executed by the user device shown in Figure 1. As shown in Figure 2, the document operation method based on image display provided in this embodiment may include:
[0027] Step S202: Obtain the data model data of the image after the document has been converted into an image. The data model includes the row model and the page model.
[0028] The document types include, but are not limited to, Office documents and PDF documents. Office documents include Word documents, Excel documents, Visio drawing files, etc.
[0029] In this embodiment, a predefined data model is provided, which includes a row model and a page model. Using the predefined data structure of the data model, the images and their data model data can be associated after the document is converted into images. This data model data is used to determine the target selection area and the text within that selection area when a user performs operations such as text selection on the images corresponding to the document.
[0030] In one feasible implementation, the page model includes: a page index, page width, page height, a list of text within the page, and page coordinate information. Optionally, the page coordinate information includes the coordinates of the text within the page. Besides text, the page may also include other types of data, such as images. Optionally, the page model also includes the image's Uniform Resource Locator (URL), and the image's width and height.
[0031] In one feasible implementation, the row model includes: a row identifier (id), a page identifier of the page containing the row, a list of text within the row, and the row's coordinate information. Optionally, the row's coordinate information includes: the coordinates of the text within the row and / or the coordinates of the entire row.
[0032] The process of converting a document into an image can be performed by the user's device or by the cloud server (also known as the server) shown in Figure 1.
[0033] In one feasible implementation, as shown in Figure 3, step S202 involves obtaining the data model data of the image after the document has been converted into an image, including:
[0034] Step S2022: The user equipment receives the image information of the document converted into an image from the server.
[0035] Step S2024: The user equipment performs protocol conversion on the image information to generate image data model data.
[0036] Optionally, the user equipment communicates with the server based on the Hypertext Transfer Protocol (HTTP), and the user equipment receives image information of the document sent by the server after it has been converted into an image according to the HTTP protocol.
[0037] In this implementation, the server performs the document-to-image conversion operation. Optionally, the user device displays a document management interface where the user can upload documents. The user device receives the document uploaded by the user through the document management interface and sends it to the server. After receiving the uploaded document, the server converts it into an image and obtains the image information. The server then sends the image information to the user device so that the user device can subsequently display the document as an image based on the image information. Because the server has greater processing power, the processing burden of converting documents into images on the user device is reduced.
[0038] The image information includes the image corresponding to the page, the text in the image, and the coordinate information of the text.
[0039] The image information is converted using a protocol to generate the image's data model data, including:
[0040] Based on the text and coordinate information in the image, line text merging and line coordinate merging are performed to generate the image's line model data;
[0041] Page merging is performed based on the row model data of the images to generate page model data for the images.
[0042] By comparing the coordinate information of the text, text within the same line can be identified. Then, by merging the text within each line, all the text in that line can be obtained. Similarly, by merging the coordinates of the entire line, the coordinates of the whole line can be obtained, generating the line model data for the image. If a page contains one or more lines of text, page model data for the image can be generated by merging the line model data.
[0043] In one feasible implementation, step S202 involves obtaining the data model data of the image after the document has been converted into an image, including:
[0044] The user device converts the document into images to obtain the images and image information corresponding to the pages in the document.
[0045] The image information is converted using a protocol to generate the image's data model.
[0046] In this implementation, the user device processes the document-to-image conversion, which is flexible and avoids dependence on other devices.
[0047] Step S204: Display the document preview interface. The document preview interface includes an image of at least one page of the document.
[0048] Specifically, the user device receives the user's document preview operation and, in response, renders the document based on the image converted from the document or based on the image's data model data, displaying the document preview interface as an image, which facilitates the user's quick browsing of document information.
[0049] This embodiment does not limit the layout of the document preview interface, nor does it limit the number of documents or pages displayed in the document preview interface. For example, the document preview interface may display one page at a time, i.e., one image at a time. Alternatively, it may display four pages at a time, i.e., four images at a time. Users can display different pages in the document by pulling up or down. Another example is that the document preview interface may display all pages of the document at a time.
[0050] Step S206: Obtain the user's selection operation and the location information of the selection operation in the document preview interface.
[0051] The selection operation allows users to select a region or text within a target document or page, highlighting the selected region or text on the user's device and providing a clear visual representation of the text selection result.
[0052] This embodiment does not limit the selection operation performed by the user, and it can vary depending on the type of user device. For example, if the user device is a mobile phone or tablet, the selection operation can be a single-finger long press or a two-finger long press. When the user device is a desktop computer, the selection operation can be a long press of the left mouse button and drag.
[0053] When a user makes a selection in the document preview interface, the location information of the selection operation obtained by the user's device is determined based on the screen coordinate system. Specifically, the user's device detects the operation point of the selection operation on the screen. For example, if the user long-presses a single finger in the document preview interface displayed on the phone, the operation point is the contact point between the user's finger and the screen, and the location information of the selection operation is determined in the screen coordinate system.
[0054] Optionally, the document operation method based on image display provided in this embodiment further includes:
[0055] Bind predefined user events.
[0056] In step S206, the user's selection operation in the document preview interface is obtained, including:
[0057] Receive the user's first action in the document preview interface;
[0058] The first operation is compared with a predefined user event to determine that the first operation is a selection operation.
[0059] By predefining and binding user events, different user operations can be identified and distinguished, avoiding the need to handle user errors.
[0060] Optionally, the user device is a mobile phone or tablet, and the predefined user events include predefined touch events. If the user device is a desktop computer, the predefined user events include predefined mouse events.
[0061] Step S208: If the text hit by the selection operation is determined based on the location information and data model data of the selection operation, then the selection model data of the target selection area corresponding to the selection operation is determined.
[0062] It's understandable that a document page can include not only text but also images and blank areas, and a document preview interface can include not only the images on the page but also blank areas. A user's selection operation may or may not hit text. Therefore, when a selection operation hits text, the selection model data for the target selection area corresponding to the selection operation is determined.
[0063] In this embodiment, a selection model is predefined. The selection 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.
[0064] The selection model includes node data (SelectionNode) and selection data (SelectionStore). Node data includes anchor node data and focus node data. The anchor node is the first text of the first line in the selection, and its data includes the page identifier, the line identifier, and the anchor text. The focus node is the last text of the last line in the selection, and its data includes the page identifier, the line identifier, and the anchor text. Selection data includes the coordinates of the selection and the text within it. The selection is typically rectangular, and its coordinates can include the row identifiers of the rectangular selection on the page, specifically the row identifiers of its left, right, top, and bottom boundaries.
[0065] The selection model can also include selection operation data (SelectionPos). Selection operation data includes: the identifier of the page where the selection operation is located, and the identifier of the row where the selection operation is located.
[0066] Step S210: Based on the selection model data, draw the target selection area and cursor in the document preview interface.
[0067] Specifically, the document preview interface displays images corresponding to the document's pages. Based on the selection model data, the target selection area and cursor can be rendered and displayed within the image, achieving a display effect similar to text selection in text processing software. For example, the display effect is similar to the highlighting of selected text in Office software when a user selects a portion of the text.
[0068] As can be seen, the document operation method based on image display provided in this embodiment is applicable to scenarios where user devices display pages in a document as images on the display interface. The method acquires the data model data of the image after the document is converted into an image, including line model data and page model data. When the user performs a selection operation in the document preview interface, the position information of the selection operation is obtained. If the selection operation hits text, the selection model data of the target selection area corresponding to the selection operation is determined, and the target selection area and cursor are drawn in the document preview interface according to the selection model data. By using a predefined data model, the image converted from the document is associated with the page data and line data. By using a predefined selection model, the target selection area and cursor are rendered and displayed in the image corresponding to the page according to the selection model data of the target selection area corresponding to the user's selection operation. This simulates the selection display effect of text selection in text processing software, improving the text processing display effect in image-display document scenarios.
[0069] In one feasible implementation, step S208, determining the selected area operation hit text based on the location information of the selection operation and the data model data, includes:
[0070] 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;
[0071] Based on the selection operation and its coordinates in the page coordinate system, determine the target image hit by the selection operation and the target selection area in the target image;
[0072] Based on the data model of the target image, it is determined that the target selection area includes text.
[0073] Specifically, the location information for selection operations is determined based on the user's device's screen coordinate system. This requires coordinate system transformation, converting the selection operation from the screen coordinate system to the page coordinate system to obtain the selection operation's coordinates within the page coordinate system. Based on the selection operation and its coordinates in the page coordinate system, the target image and the target selection area within that image are determined. For example, a single-finger long-press operation is used to select text within a region near the user's finger on the page. For this operation, the target image (i.e., the target page in the document) is determined from among multiple images displayed in the document preview interface, based on the coordinates of the user's finger's contact point with the screen in the page coordinate system. A preset area centered on the user's finger's contact point is then used as the target selection area. The target image's data model is used to determine if the target selection area includes text. If it does, the selection operation hits the text, and the selection model data for the corresponding target selection area is further determined.
[0074] In one feasible implementation, step S208, determining the selection model data of the target selection area corresponding to the selection operation, includes:
[0075] Based on the data model data of the target image, obtain the first and last node texts of the text included in the target selection area;
[0076] Generate node data based on the first and last node text;
[0077] Generate selection data based on the target selection area;
[0078] Based on the node data and the selected area data, determine the selection area model data for the target selection area.
[0079] Through the predefined data model structure, the target image's data model data includes the target image's page information, line information, text in the target image, and coordinate information of the page, lines, and text. Based on the target image's data model data, the first node text, last node text, coordinate information of the target selection area, and text in the target selection area can be obtained, generating the target selection area's selection model data. This facilitates subsequent rendering and highlighting of the target selection area or text in the target selection area on the user device, improving the display effect.
[0080] Optionally, the document operation method based on image display provided in this embodiment may further include:
[0081] Receive document zooming commands from users;
[0082] In response to a document scaling operation, determine the text scaling factor corresponding to the document scaling operation;
[0083] Update the selection model data of the target selection area based on the text scaling factor;
[0084] Based on the updated selection model data of the target selection area, update the drawing target selection area and cursor in the document preview interface.
[0085] Optionally, update the selection model data of the target selection area according to the text scaling factor, including:
[0086] The target selection area is scaled and its coordinates are transformed according to the text scaling factor, and the selection area data is updated.
[0087] Update the selection model data of the target selection area based on the updated selection area data and node data.
[0088] Specifically, document zooming operations can be a two-finger pinch-to-expand operation performed by the user in the document preview interface, or a rapid double-tap operation, etc. This embodiment does not limit this and may vary depending on the user's device type. The text scaling factor corresponding to the document zooming operation is determined. For example, for a two-finger pinch-to-expand operation, the text scaling factor can be determined based on the distance and direction of the user's two fingers. Generally, the greater the distance the user's two fingers move, the larger the text scaling factor. When the user's two fingers expand or move away, it is used to zoom in on the document; when the user's two fingers pinch, it is used to zoom out on the document. Optionally, to ensure the text zooming display effect, a preset range of text scaling factors can be set. For another example, a rapid double-tap operation can correspond to a preset text scaling factor. Generally, if the document is currently in normal display mode, a rapid double-tap operation is used to zoom in on the document; conversely, if the document is currently in zoomed-in display mode, a rapid double-tap operation is used to zoom out on the document, restoring it to normal display mode. The selection model data of the target selection area is updated based on the text scaling factor. Based on the updated selection model data of the target selection area, the target selection area and cursor are updated and drawn in the document preview interface to simulate the display effect of text scaling during text processing using text processing software, thereby improving the text processing display effect in the context of displaying documents as images.
[0089] Optionally, the document operation method based on image display provided in this embodiment may further include:
[0090] Boundary detection is performed on the target selection area to determine whether the target selection area is within the display range of the image corresponding to the target selection area.
[0091] Based on the data model of the target image where the target selection area is located, it can be determined whether the target selection area exceeds the display range of the corresponding image on the page, thereby improving document operation and display effects.
[0092] The above process will be illustrated below with reference to Figures 4 and 5, from the perspective of the document preview interface displayed on the user device and from the perspective of the user's operation on the user device.
[0093] Figure 4 is a scenario example diagram of an embodiment of this disclosure. As shown in Figure 4(a), the user device displays a document preview interface 401, which includes four images, i.e., displays four pages of the document. As shown in Figure 4(b), the user performs a long press operation 402 on the image displayed in the lower left corner of the document preview interface 401. The user device determines that the long press operation 402 hits the text, identifying the target selection area and the text within it, i.e., the first two lines of text in the lower left corner image of the document preview interface 401. As shown in Figure 4(c), the user device draws the target selection area (the gray background area 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 pages in the document in the form of images, the selection display effect, such as text selection in the text processing process using text processing software, is simulated, improving the text processing display effect in the scenario of displaying documents in images.
[0094] Figure 5 is an example of another scenario in an embodiment of this disclosure. As shown in Figure 5(a), the user device displays a document preview interface 401, which includes two images, representing two pages from the document. The user performs a long press operation 402 on the image displayed at the top of the document preview interface 401. The user device determines that the long press operation 402 hits the text, identifying the target selection area and the text within it. For ease of display, the text in the target selection area is represented by "Y", and the other text in the image is represented by "X". The display effect of the target selection area is shown in Figure 5(b), where the target selection area is displayed with a gray background and displays a first cursor 403 for the first node text and a second cursor 404 for the last node text. As shown in Figure 5(c), the user performs a quick double-tap operation 405 on the image displayed at the top of the document preview interface 401 to zoom in on the text. In response to the quick double-tap operation 405, the user device obtains a preset text scaling factor, for example, a 1.2x zoom. The user device updates the target selection area and cursor in the document preview interface 401 according to the preset text scaling factor, as shown in Figure 5(d). After zooming in, the image at the top of the document preview interface 401 displays a portion of the zoomed-in document content, such as the first cursor 403 of the first node text, but not the second cursor 404 of the last node text. The user can move their finger left and right in the image to view other content of the document. The image at the bottom of the document preview interface 401 remains as before. It is evident that in the scenario where the user device displays pages in a document as an image, the selection effect, such as text selection, during the zooming process of text in text processing software is simulated, improving the text processing display effect in the scenario of displaying a document as an image.
[0095] Referring to FIG6, a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. The specific embodiments of the present disclosure do not limit the specific implementation of the electronic device.
[0096] As shown in Figure 6, the electronic device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.
[0097] in:
[0098] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
[0099] Communication interface 504 is used to communicate with other electronic devices or servers.
[0100] The processor 502 is used to execute program 510, specifically to perform the relevant steps in the above-described embodiment of the document operation method based on image display.
[0101] Specifically, program 510 may include program code that includes computer operation instructions.
[0102] Processor 502 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of this disclosure. The smart device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0103] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0104] Program 510 may include multiple computer instructions. Specifically, program 510 may use multiple computer instructions to cause processor 502 to perform the operations corresponding to the image-based document operation method described in any of the foregoing multiple method embodiments.
[0105] The specific implementation of each step in program 510 can be found in the corresponding steps and units described in the above method embodiments, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0106] This disclosure also provides a computer storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any of the foregoing method embodiments. The computer storage medium includes, but is not limited to, compact disc read-only memory (CD-ROM), random access memory (RAM), floppy disk, hard disk, or magneto-optical disk.
[0107] This disclosure also provides a computer program product, including computer instructions that instruct a computing device to perform any of the image-based document operation methods described in the above-described method embodiments.
[0108] Furthermore, 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 for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0109] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this disclosure can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this disclosure.
[0110] The methods described above according to embodiments of this disclosure can be implemented in hardware, firmware, or 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 as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded over a network. Thus, the methods described herein can be stored 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 is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., Random Access Memory (RAM), Read-Only Memory (ROM), Flash Memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for performing the methods shown herein.
[0111] Those skilled in the art will recognize that the units and method steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments disclosed herein.
[0112] The above embodiments are only used to illustrate the embodiments of this disclosure, and are not intended to limit the embodiments of this disclosure. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this disclosure. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this disclosure, and the patent protection scope of the embodiments of this disclosure should be defined by the claims.
Claims
1. A document manipulation method based on image display, comprising: Obtain the data model data of the image after the document has been converted into an image; the data model includes a row model and a page model; Displays the document preview interface; The document preview interface includes an image of at least one page of the document; Obtain the user's selection operation in the document preview interface and the location information of the selection operation; If the text hit by the selection operation is determined based on the location 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. Based on the selection model data, draw the target selection area and cursor in the document preview interface.
2. The method according to claim 1, wherein, Determining the hit text of the selection operation based on the location 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 its coordinates in the page coordinate system, determine the target image hit by the selection operation and the target selection area in the target image; Based on the data model data of the target image, it is determined that the target selection area includes text.
3. The method according to claim 1 or 2, wherein, The selection model data for determining the target selection area corresponding to the selection operation includes: Based on the data model data of the target image, obtain the first node text and the last node text of the text included in the target selection area; Node data is generated based on the first node text and the last node text; Generate selection area data based on the target selection area; Based on the node data and the selected area data, the selection area model data of the target selected area is determined.
4. The method according to claim 3, wherein, The method further includes: Receive document zooming commands from users; In response to the document scaling operation, determine the text scaling factor corresponding to the document scaling operation; The target selection area is scaled and its coordinates are transformed according to the text scaling factor, and the selection area data is updated accordingly. The selection model data of the target selection area is updated based on the updated selection area data and the node data. Based on the updated selection model data of the target selection area, the target selection area and cursor are updated and drawn in the document preview interface.
5. The method according to any one of claims 1-4, wherein, The method further includes: Boundary detection is performed on the target selection area to determine whether the target selection area is within the display range of the image corresponding to the target selection area.
6. The method according to any one of claims 1-5, wherein, The method further includes: Bind to predefined user events; The step of obtaining the user's selection operation in the document preview interface includes: Receive the user's first action in the document preview interface; The first operation is compared with the predefined user event to determine that the first operation is the selection operation.
7. The method according to any one of claims 1-6, wherein, The process of obtaining the data model data of the image after converting the document into an image includes: Receive the image information of the image after the document sent by the server has been converted into an image; The image information is converted using a protocol to generate the image's data model data.
8. The method according to claim 7, wherein, The image information includes the text in the image and the coordinate information of the text; The step of performing protocol conversion on the image information to generate the image's data model data includes: Based on the text in the image and the coordinate information of the text, line text merging and line coordinate merging are performed to generate the line model data of the image; Page merging is performed based on the row model data of the image to generate the page model data of the image.
9. The method according to claim 7, wherein, The image information of the image after the document sent by the receiving server is converted into an image includes: According to the Hypertext Transfer Protocol (HTTP), the system receives image information of the image after the document sent by the server has been converted into an image.
10. A document manipulation method based on image display, comprising: The user equipment obtains documents uploaded by the user through the document management interface displayed on the user equipment and sends the documents to the server; The user equipment receives image information sent by the server, wherein the image information is obtained by the server converting the document into an image; The user equipment receives a document preview operation from the user and, in response to the document preview operation, displays a document preview interface; wherein the document preview interface includes an image of at least one page of the document; The user equipment receives the user's selection operation in the document preview interface, and in response to the selection operation, when it is determined that the selection operation hits text, draws the target selection area and cursor in the document preview interface.
11. The method according to claim 10, wherein, The method further includes: The user equipment receives the two-finger pinch-to-expand operation performed by the user in the document preview interface; In response to the two-finger pinch-to-expand operation, the distance and direction of the user's two-finger movement are obtained, and the text scaling factor is determined based on the distance and direction of the two-finger movement. Update the selection model data of the target selection area according to the text scaling factor; Based on the updated selection model data of the target selection area, the target selection area and the cursor are updated and drawn in the document preview interface.
12. The method according to claim 10 or 11, wherein, The method further includes: The user equipment receives the double-click operation performed by the user in the document preview interface; In response to the double-click operation, a preset text scaling factor is obtained; Update the selection model data of the target selection area according to the preset text scaling factor; Based on the updated selection model data of the target selection area, the target selection area and the cursor are updated and drawn in the document preview interface.
13. An electronic device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the method as described in any one of claims 1-12.
14. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-12.
15. A computer program product comprising computer instructions that instruct a computing device to perform an operation corresponding to any one of the methods described in claims 1-12.
Citation Information
Patent Citations
Method and application system for annotating PDF (Portable Document Format) file
CN112800727A
Printing processing method, device and equipment
CN118051192A
File online operation scene conversion method, device and system and storage medium
CN118152346A
File operation method based on picture display, electronic equipment and readable storage medium
CN119047422A
Method of displaying of pages at preview
RU2348975C1