CN113158619B - Document processing method and device, computer readable storage medium and computer equipment - Google Patents
Document processing method and device, computer readable storage medium and computer equipment Download PDFInfo
- Publication number
- CN113158619B CN113158619B CN202110414484.4A CN202110414484A CN113158619B CN 113158619 B CN113158619 B CN 113158619B CN 202110414484 A CN202110414484 A CN 202110414484A CN 113158619 B CN113158619 B CN 113158619B
- Authority
- CN
- China
- Prior art keywords
- document
- preview image
- area
- shared
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 35
- 238000000034 method Methods 0.000 claims abstract description 50
- 238000012545 processing Methods 0.000 claims abstract description 38
- 230000004044 response Effects 0.000 claims abstract description 26
- 238000012986 modification Methods 0.000 claims description 10
- 230000004048 modification Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 8
- 230000000875 corresponding effect Effects 0.000 claims 20
- 230000002596 correlated effect Effects 0.000 claims 2
- 230000006870 function Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 14
- 238000007726 management method Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention discloses a document processing method, a document processing device, a computer readable storage medium and computer equipment, wherein the method comprises the steps of displaying a document editing page, wherein the document editing page comprises a document editing area and a functional area, the document editing area comprises document contents of a shared document, and the shared document can be operated by at least two users with permission simultaneously or non-simultaneously; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content. Thus, by automatically identifying the document content in the document editing area, a preview image containing the document content without containing the functional area is quickly generated. Compared with the method for manually intercepting the preview image of the document, the method provided by the application can improve the generation efficiency of the preview image of the document and greatly improve the efficiency of document processing.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a document processing method, a document processing device, a computer readable storage medium and computer equipment.
Background
Electronic documents are already a very common means of working today in modern office scenarios. Electronic documents, as an effective carrier for information storage and transmission, play an important role in the development of the internet society.
When editing files by using electronic documents daily, people often use document templates to improve the efficiency of editing the files. In order to facilitate the user to quickly find a desired template, the document template often displays preview images of a plurality of templates for the user to select.
However, at present, the generation of the preview image of the document template still depends on manual screenshot generation, and the efficiency of document processing is low.
Disclosure of Invention
The embodiment of the application provides a document processing method, a document processing device, a computer readable storage medium and computer equipment. Compared with the method that the document content of the shared document is determined manually and the preview image is generated through manual screenshot, the method improves the generation efficiency of the document preview image and further improves the document processing efficiency.
A first aspect of the present application provides a document processing method, including:
displaying a document editing page, wherein the document editing page comprises a document editing area and a functional area, the document editing area comprises document content of a shared document, and the shared document can be operated by at least two authorized users at the same time or non-simultaneously;
in response to an image preview operation on the shared document, identifying the document content to generate a preview image containing the document content.
Accordingly, a second aspect of the present application provides a document processing apparatus comprising:
the system comprises a first display unit, a second display unit and a third display unit, wherein the first display unit is used for displaying a document editing page, the document editing page comprises a document editing area and a functional area, the document editing area comprises document content of a shared document, and the shared document can be operated by at least two users with permission at the same time or non-simultaneously;
and the identification unit is used for identifying the document content in response to the image preview operation of the shared document so as to generate a preview image containing the document content.
In some embodiments, the identification unit includes:
the display subunit is used for displaying a preview image generation control on the document editing page;
the first identification subunit is used for identifying the document content in response to the touch operation of the preview image generation control so as to generate a preview image containing the document content.
In some embodiments, the apparatus further comprises:
the second display unit is used for displaying a display page of the preview image, and the display page comprises a modification control;
the third display unit is used for responding to the touch operation aiming at the modification control and displaying the editing page of the preview image;
the determining unit is used for receiving image area selection operation aiming at the editing page of the preview image and determining an area corresponding to the image area selection operation as a target area;
and the first generation unit is used for generating a target preview image corresponding to the target area and updating the preview image by using the target preview image.
In some embodiments, the apparatus further comprises:
the fourth display unit is used for displaying a storage control on the display page;
and the first storage unit is used for responding to a touch instruction aiming at the saving control and storing the preview image and the shared document in an associated manner.
In some embodiments, the apparatus further comprises:
the second generating unit is used for generating a link corresponding to the shared document, and the shared document is a template document;
the first storage unit is further configured to: and associating the link corresponding to the shared document with the preview image and storing the link and the preview image in a template library so as to update the template library.
In some embodiments, the identification unit includes:
the first determining subunit is used for opening the shared document and determining a target document object model node corresponding to the document editing area;
the second determining subunit is used for determining a target area corresponding to the target document object model node;
and the screenshot subunit is used for screenshot the target area to obtain a preview image corresponding to the shared document.
In some embodiments, the second determining subunit includes:
the first acquisition module is used for acquiring the margin of the shared document when detecting that the document type of the shared document is a text document;
and the first determining module is used for determining a target area according to the margin and the area corresponding to the target document object model node.
In some embodiments, the first obtaining module includes:
the obtaining submodule is used for obtaining a first margin corresponding to the text content of the shared document and a second margin corresponding to the non-text content when the document content of the shared document is detected to contain the non-text content;
and the determining submodule is used for determining the minimum page margin of the first page margin and the second page margin as the page margin of the shared document.
In some embodiments, the apparatus further comprises:
a third determining subunit, configured to determine that the width of the preview image is a first target width;
the calculating subunit is used for calculating to obtain a first target height according to the first target width and a first preset aspect ratio;
and the intercepting subunit is configured to intercept, from the preview image, a thumbnail image corresponding to the shared document according to the first target height.
In some embodiments, the apparatus further comprises:
an acquisition unit configured to acquire a link of the shared document;
and the second storage unit is used for storing the link in association with the preview image and the thumbnail image.
In some embodiments, the apparatus further comprises:
the fifth display unit is used for responding to a preset template calling instruction and displaying the thumbnail image;
the sixth display unit is used for receiving a touch instruction aiming at the thumbnail image, displaying the preview image and calling a control;
and the seventh display unit is used for displaying the document editing page when the touch operation aiming at the calling control is detected.
In some embodiments, the second determining subunit includes:
the second acquisition module is used for acquiring the width of a content area corresponding to each line in the shared document when the document type of the shared document is detected to be a table document, wherein the width of the content area is the accumulated width of an area containing cells with data in one line;
the second determining module is used for determining that the maximum value in the width of the content area corresponding to each row is a second target width;
the calculating module is used for calculating to obtain a second target height according to the second target width and a second preset aspect ratio;
and the third determining module is used for determining a target area according to the area corresponding to the target document object model node, the second target width and the second target height.
In some embodiments, the identification unit includes:
the acquisition subunit is used for responding to the image preview operation on the shared document and acquiring the user account information of the currently logged-in user;
and the second identification subunit is used for identifying the document content when detecting that the user account information meets a preset condition so as to generate a preview image containing the document content.
The third aspect of the present application further provides a computer-readable storage medium, which stores a plurality of instructions adapted to be loaded by a processor to perform the steps of the document processing method provided in the first aspect of the present application.
A fourth aspect of the present application provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the document processing method provided by the first aspect of the present application when executing the computer program.
A fifth aspect of the present application provides a computer program product or computer program comprising computer instructions stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions to cause the computer device to execute the steps of the document processing method provided by the first aspect.
According to the document processing method provided by the embodiment of the application, a document editing page is displayed, the document editing page comprises a document editing area and a function area, the document editing area comprises document contents of a shared document, and the shared document can be operated by at least two users with permission at the same time or non-same time; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content. Thus, by automatically recognizing the document content in the document editing area, a preview image containing the document content but not the functional area is quickly generated. Compared with the method for manually intercepting the preview image of the document, the method provided by the application can improve the generation efficiency of the preview image of the document and greatly improve the efficiency of document processing.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a document processing scenario provided herein;
FIG. 2 is a schematic flow chart diagram of a document processing method provided herein;
FIG. 3 is a schematic view of a document editing interface for a text document;
FIG. 4 is a schematic illustration of a preview image generated for the shared document shown in FIG. 3;
FIG. 5 is another schematic view of a document editing page corresponding to a text document;
FIG. 6 is a schematic view of a presentation page of preview images;
FIG. 7 is a schematic diagram of an interface for generating a template preview image in the template management platform;
FIG. 8 is another schematic flow diagram of a document processing method provided herein;
FIG. 9 is a schematic diagram of a document processing apparatus provided herein;
fig. 10 is a schematic structural diagram of a computer device provided in the present application.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a document processing method, a document processing device, a computer readable storage medium and computer equipment. The document processing method can be used in a document processing device. The document processing apparatus may be integrated in a computer device, which may be a terminal or a server. The terminal can be a mobile phone, a tablet Computer, a notebook Computer, an intelligent television, a wearable intelligent device, a Personal Computer (PC), and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Network acceleration service (CDN), big data and an artificial intelligence platform.
Please refer to fig. 1, which is a schematic view of a document processing scenario provided in the present application; as shown, the computer device obtains a shared document and opens the shared document, displaying a document editing interface for the shared document. An editing interface for sharing a document includes a document editing area and a functional area. The document editing area includes document contents of a shared document, which is a document that can be operated by at least two authorized users simultaneously or non-simultaneously. Then, in response to an image preview operation for the shared document, document contents of the shared document are identified and a preview image containing the document contents is generated.
It should be noted that the scenario diagram of document processing shown in fig. 1 is only an example, and the document processing scenario described in the embodiment of the present application is for more clearly illustrating the technical solution of the present application, and does not constitute a limitation on the technical solution provided by the present application. As can be seen by those skilled in the art, with the evolution of document processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.
Based on the above-described implementation scenarios, detailed descriptions will be given below.
Embodiments of the present application will be described from the perspective of a document processing device that may be integrated into a computer device. The computer device may be a terminal or a server, among others. As shown in fig. 2, a schematic flow chart of a document processing method provided by the present application is shown, where the method includes:
In the embodiment of the present application, a document may be an electronic document, and specifically, may be any editable document such as a word (text document), an excel (table document), or a ppt (powerpoint). Further, the electronic document in the embodiment of the present application may be an offline document or an online document, and the online document may also be referred to as a shared document. The shared document is a document which can be operated by at least two authorized users simultaneously or non-simultaneously, and compared with the traditional offline document which can be operated by only one person, the shared document can be operated by multiple persons in an online cooperation manner. Moreover, the shared document can export the document content to an offline document at any time for document saving. Therefore, the document processing work involving multiple people, such as data collection, is greatly facilitated, and the document processing efficiency is improved.
For the shared document, the link of the shared document can be clicked in the application program to open the shared document, and the link of the shared document can also be input in the browser to open the shared document in the browser. And after the shared document is opened, displaying a document editing interface of the shared document. The document editing interface comprises a document editing area and a functional area. For different types of shared documents, the document editing area and the functional area are also different, and the functional area includes editing controls provided by an editor that supports the target type. For example, a text document provides a blank document editing area, while a form document provides a document editing area with form lines; and most of the functional areas provided by the text document are functional controls for processing texts and paragraphs, and most of the functional areas provided by the form document are functional controls for processing forms.
In the following, taking a document as a text document as an example, a document editing area and a functional area included in a document editing page are further described in detail by using an illustration. As shown in fig. 3, a schematic diagram of a document editing interface for a text document. As can be seen from fig. 3, the document editing page includes a document editing area 100 and a functional area 200. Wherein the ribbon area 200 generally includes at least a first ribbon control area 210 and a second ribbon control area 230, and may also include a catalog area 220. By clicking a control in the first functionality control area 210 or the second functionality control area 230, a corresponding functional operation may be performed on part or all of the document content in the document editing area 100. The directory control in the directory area 220 may also be clicked to quickly locate or search specific content corresponding to a directory in the document content. Similarly, in a table document or a presentation document, a document editing area and a function area may be determined in the document editing page thereof in accordance with the above illustration.
In the actual use of shared documents, for example, in a scenario of data statistics using shared documents, some statistical templates are often used to improve statistical efficiency. Specifically, when creating a new document, the user may click on an enabled template control in the document creation page to create a new shared document through the template. After the user clicks the enabled template control, the application program is generally switched to a template display interface, a preview image of the template is displayed in the template display interface, the user can further click the preview image of the template, and the application program can open the template document corresponding to the selected preview image. In order to display more effective data, the preview image generally only includes the document content of the template document, and does not include the contents of other functional areas of the template document. For example, a preview image is generated for a shared document corresponding to the document editing page shown in fig. 3, the preview image contains only the contents in the document editing area 100 and does not contain the contents in the functional area 200. At present, preview images of templates displayed in application programs are manually identified in document editing areas in template documents, then image capturing is manually performed and uploaded and stored in the application programs, and the efficiency of manual image capturing is low.
In order to solve the problem that the efficiency of generating the preview image of the template document by the manual screenshot is low, the document processing method is provided, and the preview image of the document can be automatically generated. Specifically, any document in which a preview image needs to be generated may be opened to display a document editing page corresponding to the document. In the document editing page, a document can be edited. Wherein the document editing page includes a document editing area, which may be the document editing area 100 in the example of fig. 3, and a functional area, which may be the functional area 200 in the example of fig. 3. In the document editing area 100, the document contents of the document are included. In the document processing method provided by the embodiment of the application, the document may be a shared document.
Wherein after the shared document is opened and the document editing page of the shared document is displayed. The user can confirm the document content displayed in the document editing area in the document editing page, and if the document content is confirmed to have a part needing to be adjusted, the document content can be adjusted on the document editing page. After the adjustment is completed, an image preview operation can be further performed on the shared document. If the document content is confirmed to have no part needing to be adjusted, the image preview operation can be directly carried out on the shared document. The image preview operation is an operation of generating a preview image of a shared document with respect to the shared document. Specifically, the image preview operation may be a touch operation for a preset control in the document editing interface, a double-click operation or a preset sliding operation for any position in the document editing interface, or a voice control instruction for generating a preview image.
Then, in response to an image preview operation for the shared document, the document contents of the shared document are identified, and a preview image containing the document contents of the shared document is generated. Wherein, in response to the condition or state indicating that the executed operation depends on, when the dependent condition or state is satisfied, the executed operation or operations may be in real time or may have a set delay; there is no restriction on the order of execution of the operations performed unless otherwise specified.
In order to make the preview image of the shared document present the document content of the shared document to the maximum extent and reduce other invalid content, the preview image may show only the document content portion of the shared document. FIG. 4 is a schematic diagram of a preview image generated for the shared document shown in FIG. 3. Fig. 4 can be understood as an image obtained by capturing a screen in the document editing area 100 of fig. 3, the preview image may be an image formed by sharing all contents of a document in its entirety, and may be scrolled to be viewed, and the preview image automatically removes useless portions such as a functional area and some blank areas, and is quick and effective.
In some embodiments, identifying document content in response to an image preview operation on a shared document to generate a preview image containing the document content comprises:
1. displaying a preview image generation control on a document editing page;
2. and identifying the document content in response to the touch operation of the preview image generation control to generate a preview image containing the document content.
In the embodiment of the present application, a preview image generation control may be further displayed on the document editing page, and the preview image generation control may be set at any position of the document editing page, for example, the control may be set in the document editing area, may also be set in the function area, and may also be set in the document editing area and a position outside the function area in the document editing page.
Still taking the shared document as a text document as an example for detailed description, as shown in fig. 5, the shared document is another schematic diagram of a document editing page corresponding to the text document, as shown in the figure, the first preview image generating control 300 may be disposed in the document editing area 100, and specifically may be disposed at any position in the document editing area 100 that does not affect the display of the document content; the first preview image generation control 300 may also be disposed in the functional area 200, specifically, in the first functionality control area 210, in the catalog area 220, or in the second functionality control area 230; the first preview image generation control 300 may also be disposed at any other location in the document editing page outside of the document editing area 100 and the functional area 200. The text content such as the text "click to generate preview image" or "immediately generate preview image" can be displayed in the preview image generation control to indicate the function of the control.
Then, when a touch operation for the first preview image generation control 300 is received, the document contents of the shared document are identified, and a preview image containing the document contents of the shared document is generated. Specifically, the generation of the preview image of the document content including the shared document may be performed by screenshot of the document editing area 100 in the document editing page to obtain the preview image of the shared document. When the first preview image generation control 300 is arranged in the document editing area 100, the first preview image generation control 300 is not included in the preview image of the shared document generated by screenshot of the document editing area 100.
In some embodiments, the document processing method provided by the embodiment of the present application further includes, after identifying document content to generate a preview image containing the document content:
1.1, displaying a display page of the preview image, wherein the display page comprises a modification control;
1.2, responding to the touch operation aiming at the modification control, and displaying an editing page of the preview image;
1.3, receiving an image area selection operation aiming at an editing page of a preview image, and determining an area corresponding to the image area selection operation as a target area;
and 1.4, generating a target preview image corresponding to the target area, and updating the preview image by using the target preview image.
After the preview image of the shared document is generated, the preview image of the shared document may be displayed. As shown in fig. 6, a schematic diagram of a presentation page for a preview image is shown. As shown in the figure, the display page of the preview image includes a modification control 400, and when the user clicks the modification control 400, the edit page of the preview image is displayed. In the page, the user can perform an image editing operation on the preview image, such as adding characters, watermarks or icons. Or performing an image area selection operation, such as a frame selection operation, on the preview image, determining the area selected by the frame as a target area, generating a target preview image according to the target area, and determining the target preview image as a final preview image of the shared document. Alternatively, the screenshot operation may be directly performed on the edit page of the preview image, and the image obtained by the screenshot may be determined as the final preview image of the shared document. Or updating the preview image with the generated target preview image. In this way, when the automatically generated preview image includes too many blank areas, for example, a certain distance still exists between the document content display area in the document editing area and the edge of the document editing area due to the setting of the margin, the blank areas may be further removed by capturing the generated preview image, so that the preview image of the shared document displays as much document content as possible.
In some embodiments, the document processing method provided by the present application further includes:
A. displaying a storage control on a display page;
B. and responding to a touch instruction aiming at the saving control, and storing the preview image and the shared document in an associated manner.
Referring to fig. 6, as shown in fig. 6, a save control 500 may be further disposed in the display page of the preview image. When the user clicks the save control 500, the preview image of the shared document and the shared document are associated and stored in the storage location corresponding to the shared document. In this way, when the user views the preview image and selects the document template, the user can open the link of the shared document by clicking the preview image, so as to enter the editing page of the shared document.
Further, in some embodiments, the document processing method provided by the present application may further include:
generating a link corresponding to a shared document, wherein the shared document is a template document;
storing the preview image in association with the shared document as described above may include:
and storing the link corresponding to the shared document and the preview image in the template library in an associated manner so as to update the template library.
In the embodiment of the present application, the shared document is a template document, and the document may be applicable to a plurality of scenes of a certain type of scenes. Such as the "intern contract" template document shown in fig. 3, which may be applicable to a scenario in which a plurality of interns make a contract. In general, a plurality of template documents are stored in a shared document application program, so that a user can quickly create a new shared document by calling the template document. These multiple template documents constitute a template library of the current shared document application. In actual use, when a user selects to create a shared document through a template, a preview image corresponding to the template document in the template library is displayed to the user, and the user can open the template document corresponding to the preview image by clicking any one preview image.
For any shared document, after creation, a link corresponding to the shared document may be generated, and the link may be referred to as a document link. The user may share the link to other users in the internet. The user who receives the link can open the shared document through the link, and the user who meets the preset condition can edit the shared document. In the embodiment of the application, a link corresponding to the shared document can also be created. The link may then be stored in association with the shared document and the preview image corresponding to the shared document in a template library of the application to enable updating of the application template library. After updating, the user may open the shared document by entering a link corresponding to the shared document, or by clicking on a preview image of the shared document presented to the user.
In some embodiments, identifying document content to generate a preview image containing the document content comprises:
a. opening a shared document, and determining a target document object model node corresponding to a document editing area;
b. determining a target area corresponding to a target document object model node;
c. and performing screenshot on the target area to obtain a preview image corresponding to the shared document.
In the embodiment of the application, when the user finishes editing the shared document and desires to generate the corresponding preview image of the edited shared document. A link to the shared document, i.e., a document link to the shared document, may be obtained. The document link is then sent to a template management platform in the shared document application. As shown in fig. 7, which is an interface schematic diagram of generating a template preview image in a template management platform, as shown in the figure, the interface for generating the template preview image includes a document link input box 600 and a second preview image generation control 700, and a user can input a document link of a shared document therein, and then click the second preview image generation control 700, so as to automatically generate a preview image of a document corresponding to the document link. Of course, in some embodiments, the user may not need to manually input the document link into the document link input box 600, and the user may click the preview image generation control on the document editing page of the shared document and then switch to the interface for generating the template preview image, at this time, the document link corresponding to the shared document is automatically generated in the document link input box in the interface for generating the template preview image.
After a user uploads a template document to the template management platform by inputting a document link of the template document or directly by a method of inserting the template document in the template management platform, the user can automatically trigger the template document to be subjected to screenshot to generate a preview image corresponding to the template document. After the preview image corresponding to the template document is generated, a link corresponding to the preview image may be generated, where the link corresponds to a storage address of the preview image. The links of the preview image are then associated with the links of the template document. Therefore, when a user views the preview image of the template document, the user can obtain the link of the template document by clicking the template calling control in the preview image, and further find the template document according to the link of the template document and open the template document. After the preview image corresponding to the template document is generated, the template document and the preview image corresponding to the template document may be further stored in a template library of the shared document application program in an associated manner, so as to update the template library of the shared document application program.
In one embodiment, when a preview image corresponding to a template document is generated, it may be detected whether the template document exists in a template library, and when it is detected that the template document exists in the template library, the preview image that is newly generated may be replaced with the original preview image. When the template document is detected not to exist in the template library, the template document and the preview image can be associated and added to the template library, so that the template document containing the preview image is newly added to the template library.
In the template management platform, a browser can be used to open a document link of the shared document, and a shared document application program can be used to open a document link of the shared document. The embodiment of the present application is described by taking an example of opening a document link of a shared document using a browser. Here, some details of the process of opening the link by the browser are described. When a link is input in the browser, the browser performs DNS (Domain Name system) resolution on the input link to obtain a corresponding server address. The browser then initiates an HTTP (hypertext Transfer Protocol) request to the server. After confirming the link through TCP/IP (Transmission Control Protocol/Internet Protocol) three-way handshake, the server sends the code to the browser. After the browser receives the code, three steps are needed: the DOM (Document Object Model) constructs, lays out, and draws a page. In the DOM construction process, the browser analyzes the received codes through the parser to construct a DOM tree, and the DOM tree comprises a plurality of DOM nodes. And then, laying out the DOM nodes in the webpage, and determining the corresponding position of each DOM node in the webpage. And finally, drawing and rendering the whole webpage according to the layout condition.
In the application, when a browser opens a document link of a shared document, a target DOM node corresponding to a document editing area can be determined according to a code corresponding to document content, and then position information of the target DOM node in a display page of a webpage determined in a layout process is further determined, that is, a target area corresponding to the target DOM node is determined. Then, the target area is subjected to screenshot, so that a preview image of the shared document, which contains the document content of the shared document, is obtained.
In some embodiments, identifying document content in response to an image preview operation on a shared document to generate a preview image containing the document content comprises:
responding to an image preview operation of a shared document, and acquiring user account information of a currently logged-in user;
when the fact that the user account information meets the preset conditions is detected, identifying the document content to generate a preview image containing the document content.
In the embodiment of the application, when an image preview operation for a shared document is received, user account information of a user currently logging in a shared document application program needs to be further acquired, and whether the user has a right to generate a document preview image is further judged based on the user account information. When it is detected that the user account information meets a preset condition, for example, a user corresponding to the user account information has a preset right, the document content is identified and a preview image containing the document content is generated. Specifically, for example, for a shared document application that is partially paid for use, a general user only has the right to read and edit the shared document, and does not have the right to create a template and generate a preview image corresponding to the template. The application opens the authority to create the template and generate the preview image corresponding to the template only to the member user. Therefore, only when the user is detected to be a member user, the preview image corresponding to the shared document is generated in response to the image preview operation of the user on the shared document.
According to the above description, in the document processing method provided in the embodiment of the present application, a document editing page is displayed, where the document editing page includes a document editing area and a functional area, the document editing area includes document content of a shared document, and the shared document can be operated by at least two authorized users simultaneously or non-simultaneously; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content. Thus, by automatically recognizing the document content in the document editing area, a preview image containing the document content but not the functional area is quickly generated. Compared with the method for manually capturing the preview image of the document, the method provided by the application can improve the generation efficiency of the document preview image and greatly improve the document processing efficiency.
Accordingly, the document processing method provided by the present application will be further described in detail in the embodiments of the present application from the perspective of a computer device, where the computer device may be a terminal or a server. As shown in fig. 8, another schematic flow chart of the document processing method provided by the present application includes:
in step 201, a computer device displays a document editing page of a shared document.
The shared document, i.e. the online document, is a document that can be operated by at least two authorized users simultaneously or non-simultaneously. The document processing method provided by the application is a method for automatically generating the template document preview image, and the template document needs to be made before the template document preview image is generated. In particular, a shared document may be opened in a computer device that displays a document editing page of the shared document. The document editing page of the shared document comprises a document editing area and a function area, and a user can edit the template document in the document editing area and can also use a function control of the function area to assist in editing the template document.
In the embodiment of the application, the user can independently edit the shared document and share the shared document to multiple users, so that the shared document can be edited by multiple users, the editing efficiency of the shared document can be improved, the advantages of people can be obtained, and the quality of the template document is improved. The template document is the shared document after editing determination.
In some embodiments, the user may also not be required to edit the template document starting from a blank shared document. The user can directly open other edited documents on the document editing interface of the shared document, and the edited documents can be shared documents or offline documents. And then, correcting the document to obtain a template document needing to be edited. Thus, the editing efficiency of the template document can be further improved.
At step 202, the computer device obtains a document link for a template document.
Wherein each shared document has a document link corresponding thereto. The user can share the document link with other network users, so that the other network users can open the shared document according to the document link, and the user with corresponding authority can also perform editing operation on the shared document. The document link is typically generated when the shared document is created, and the document link may be a URL (Uniform Resource Locator) corresponding to the shared document. The computer equipment can acquire the document link of the currently opened shared document to obtain the document link corresponding to the template document needing to be subjected to preview image generation.
In step 203, the computer device opens a document link using a browser.
After the computer equipment acquires the document link of the template document, the document link of the template document is opened by using a browser, and the access to the code of the template document stored in the server is realized. Specifically, the browser performs DNS resolution on the document link to obtain a corresponding server address. And then the browser initiates an HTTP request to the server, and after confirming the link through TCP/IP three-way handshake, the browser acquires a code corresponding to the template document. And then the browser carries out DOM construction according to the codes of the template document, and DOM nodes corresponding to different areas of the template document are determined. Specifically, a DOM node corresponding to a functional region in the template document, a DOM node corresponding to the document content, and the like may be determined. For example, when there are a plurality of DOM nodes corresponding to the functional region, the DOM nodes may include a DOM node corresponding to an edit bar, a DOM node corresponding to a menu bar, a DOM node corresponding to a directory, a DOM node corresponding to a control bar, and the like. Further, the browser lays out the display position of each DOM node in the browser, and finally, the content corresponding to each DOM node is rendered and displayed in the browser according to the layout position.
In some embodiments, a headless browser, such as puppeteer, may also be used to open a document link. The use steps of the browser which is daily used by us are generally as follows: and starting a browser, opening a link and displaying an interactive interface for interaction. And the headless browser refers to a browser which uses script codes to execute the above process, and can simulate a real browser using scene but does not display the interactive interface of the browser for the user to interact. The headless browser may take all or part of the screenshot of the web page and save the screenshot to a picture or file in pdf format. Specifically, in the embodiment of the present application, a headless browser opens a document link corresponding to a template document, acquires a code corresponding to the template document from a server, then determines a target DOM node corresponding to document content of the template document and a target display area laid out for the DOM node from the code, and then further determines display content corresponding to the target display area in a background and generates an image corresponding to the display content, where the image is a preview image corresponding to the template document.
In the embodiment of the present application, essential differences between the scheme of the embodiment of the present application and the current method for generating a preview image by using a screenshot method are further explained. At present, screen capture can be achieved by manually capturing a screen of an interface and by identifying a certain area in the interface through a keyword, for example, screen capture software is used to select a screen capture area, and an image is generated according to image content collected in the screen capture area. However, in the automatic screenshot of the mobile terminal, a certain content picture is displayed in the display screen of the mobile terminal, then, in response to a shortcut key touch operation for screenshot, the display content picture in the display screen of the mobile terminal is automatically acquired, and a corresponding image is generated according to the display content picture, and some invalid areas cannot be automatically shielded, for example, some functional areas or blank areas in a document editing interface are automatically removed, and in the case of requiring a large number of screenshots, a manual operation mode is complicated, labor cost is high, and efficiency is low. That is, in the current preview image generation methods, a picture to be captured needs to be displayed first, and then an image in a region to be captured is captured to generate a captured image. According to the method provided by the embodiment of the application, related code content can be directly obtained according to the link of the shared document, the target DOM node corresponding to the document content is identified according to the code content, the display content of the target DOM node on the display screen is determined according to the code content, the display content does not need to be actually displayed, and then the preview image of the shared document is generated according to the determined display content. Therefore, the content area of the shared document is directly identified in the background according to the code content without displaying the picture to be captured, the image only containing the content area but not containing the functional area is generated, the image capturing efficiency is improved, and particularly when a large number of shared documents are captured, manual intervention is not needed, and a large number of preview images can be quickly and accurately obtained. Further, the thumbnail images can be further automatically generated for the preview images according to the preset size proportion, so that the thumbnail images, the preview images and the document links can be bound in the later period, the document template library is quickly established, other users can quickly find the required shared document based on the thumbnail images to edit, and the document processing efficiency is greatly improved. And the whole process is realized in the background according to the code content and the function code of the shared document, manual interaction intervention is not needed, and the efficiency is higher.
In step 204, the computer device determines a target area where a DOM node corresponding to the document content of the template document is located.
And the DOM node corresponding to the document content of the template document is the DOM node corresponding to the document editing area in the document editing interface of the template document. The computer device can determine a target DOM node corresponding to the document content of the template document according to the code corresponding to the document content. And then determining a target area of the target DOM node in a display interface of the browser according to the layout condition of the browser. And the target area can be accurately defined in the browser according to specific data parameters, such as determining the width, height, left offset and upper offset of the target DOM node. Specifically, the distance from the left side of the target area to the left side of the display interface of the browser may be determined according to the left offset, and the distance from the upper side of the target area to the upper side of the display interface of the browser may be determined according to the upper offset. And then the target region can be accurately determined by combining the width and the height of the target DOM node.
Specifically, for template documents of different document types, the method for determining the target area where the DOM node corresponding to the document content of the template document is located is not exactly the same. Specifically, determining a target region corresponding to a target document object model node includes:
1. when the document type of the shared document is detected to be a text document, acquiring the margin of the shared document;
2. and determining a target area according to the margin and the area corresponding to the target document object model node.
After determining a target area where a target DOM node corresponding to the document content of the template document is located, the document type of the template document can be further detected, and when the document type of the template document is detected to be a text document, the margin set by the template document can be further obtained. And then, re-determining a target area according to the margin set by the template document and the area where the target DOM node is located.
The margins of the template document may include an upper margin, a lower margin, a left margin, and a right margin, among others. The four margins of the template document can be the same or different, and can be set as required. When the left page margin of the template document is 1 cm, a rectangular area 1 cm wide to the right from the left side in the area corresponding to the target DOM node is an uneditable area, that is, the area is a blank area. Similarly, the upper margin, the lower margin and the right margin of the template document respectively define a blank area in the area corresponding to the target DOM node. The target area is an area excluding the blank areas in the area corresponding to the target DOM node. When the preview image of the template document is presented to a user, the preview images of a plurality of template documents are often presented on one presentation interface, so that the presentation area of the preview image of each template document is relatively small. In order to clearly display the document content in the preview image, the display area needs to be fully utilized to display the document content, so as to avoid displaying a blank area in the preview image. Therefore, the unexpected part of the hollow area in the area corresponding to the target DOM node is determined to be the target area, so that the document content in the generated preview image can be displayed more clearly.
The determination of the target area is described in detail below with a specific example. Assume that the target DOM node is determined to have a left offset of 5 cm, an upper offset of 10 cm, a height of 20 cm, and a width of 15 cm. Thus, the area corresponding to the target DOM node can be determined according to the data. Then, the left margin and the right margin of the template document are both 1 cm, and the upper margin and the lower margin are both 2 cm. Then the left offset of the target area can be calculated to be 6 cm according to the left offset of the target DOM node and the left margin of the template document, and the top offset of the target area can be calculated to be 12 cm according to the top offset of the target DOM node and the top margin of the template document. Further, the width of the target area is 13 cm according to the width of the target DOM node and the left and right margins of the template document, and the height of the target area is 16 cm according to the height of the target DOM node and the upper and lower margins of the template document. Finally, the target area was determined to have a left offset of 6 cm, an upper offset of 12 cm, a width of 13 cm and a height of 16 cm. Therefore, the specific position of the target area on the browser display page can be accurately determined according to the data.
In some embodiments, obtaining a margin of a shared document comprises:
A. when detecting that the document content of the shared document contains non-text content, acquiring a first margin corresponding to the text content of the shared document and a second margin corresponding to the non-text content;
B. and determining the smallest page margin of the first page margin and the second page margin as the page margin of the shared document.
In some cases, non-text content such as tables or pictures may also exist in the template document, and the non-text content may exceed an editable range defined by the set text margins due to an oversize. If the target area is still determined according to the text margin and the area corresponding to the target DOM node, the interception of the non-text contents such as the table or the picture in the template document is incomplete, and further the content is lost.
Therefore, in this case, in order to ensure that the intercepted content is complete, the margins corresponding to the non-text content need to be further acquired. And then selecting the minimum margin of the margins corresponding to the text content and the margins corresponding to the non-text content as a target margin. And finally, determining a final target area according to the target margin and the area corresponding to the target DOM node.
In some embodiments, determining a target region corresponding to a target document object model node comprises:
a. when the document type of the shared document is detected to be a table document, acquiring the width of a content area corresponding to each line in the shared document, wherein the width of the content area is the accumulated width of an area containing cells with data in one line;
b. determining the maximum value in the width of the content area corresponding to each line as a second target width;
c. calculating to obtain a second target height according to the second target width and a second preset width-to-height ratio;
d. and determining a target area according to the area corresponding to the target document object model node, the second target width and the second target height.
When the document type of the template document is detected and determined to be a table document, determining the width of the content area in each row of tables. Wherein the content area width is an accumulated width of an area including cells having data in one row. Specifically, each row of the table document can be viewed from left to right in a traversal manner, the width is accumulated if the cells have content data, and the width of the merged cell is accumulated if the cells are merged. Thus, the width of the content area of each row of table is obtained, and then the width of the content area of the table document is determined according to the maximum value in the width of the content area of each row of table and is used as the width of the target area.
Then, since the table-type template document generally has less contents in the height direction, if only a part of the contents is cut, the preview image appears to have a longer width and a lower height, and thus it is not aesthetically pleasing. Therefore, for the form type template document, after the width of the content area is determined, the height of the content area, that is, the height of the target area can be calculated according to a preset aspect ratio. And then further determining a target area by combining the left offset and the upper offset of the target DOM node.
After a target area needing to be subjected to screenshot is determined for a template document of any document type, the computer equipment conducts screenshot on the target area, and accordingly a preview image corresponding to the template document is generated. It can be understood that the preview image corresponding to the template document obtained by screenshot of the target area only includes the image in the target area in the target DOM node. Images corresponding to useless DOM nodes in a display interface of the template document are removed, and the useless DOM nodes comprise DOM nodes corresponding to an edit bar, DOM nodes corresponding to a menu bar, DOM nodes corresponding to a catalog, DOM nodes corresponding to a control bar and other DOM nodes corresponding to functional areas. Moreover, the content of the blank area defined by the margin in the target DOM node is further removed, so that the generated preview image contains the blank area as little as possible. So that clearer document contents can be displayed when the preview image of the template document is displayed to a user in the display interface of the preview image.
In some embodiments, after screenshot the target area to obtain a preview image corresponding to the shared document, the method further includes:
1. determining the width of the preview image as a first target width;
2. calculating to obtain a first target height according to the first target width and a first preset aspect ratio;
3. and intercepting a thumbnail image corresponding to the shared document from the preview image according to the first target height.
In the embodiment of the present application, after the preview image of the template document is generated, the thumbnail image of the template document may be further generated on the basis of the preview image. As can be seen from the foregoing description, the preview image is an image corresponding to the document content of the template document, and when the template document is a text document, the preview image is a long image when the content of the template document is large, so that the preview image occupies a large space when displayed, and is inconvenient to display. In this way, a thumbnail image can be further generated on the basis of the preview image for easy presentation.
Specifically, the width of the generated preview image may be set as a target width, and the width of the thumbnail image may be determined as a target height. And then calculating the target height of the thumbnail image according to the target width and a preset aspect ratio. And finally, intercepting the thumbnail image of the template document from the preview image according to the target height. Here, it is understood that the upper edges of the preview image and the thumbnail image of the template document are the same.
Similarly, for a form document, a thumbnail image may be formed from a preview image by the method described above.
In some embodiments, the document processing method provided by the present application may further include:
1.1, acquiring a document link of a shared document;
and 1.2, storing the document link in association with the preview image and the thumbnail image.
In the embodiment of the application, after the preview image and the thumbnail image of the template document are generated, the document link of the template document is acquired, and the document link of the template document, the preview image and the thumbnail image of the template document are stored in an associated manner, so as to update the template library of the shared document application program.
In some embodiments, the document processing method provided in the embodiments of the present application further includes:
A. responding to a preset template calling instruction, and displaying a thumbnail image;
B. receiving a touch instruction aiming at the thumbnail image, displaying a preview image and calling a control;
C. and when the touch operation aiming at the calling control is detected, displaying a document editing page.
After the preview image and the thumbnail image of the template document are stored in association with the document link of the template document and the template library is updated, when a user invokes a template to create a shared document, the thumbnail image corresponding to the template document can be displayed on a template display page, and the thumbnail image of the template document generally contains a template name and a part of document contents of the template document. So that the user can understand the applicable scene of the template document. The user may click on a thumbnail image of the template document, enter a preview image of the template document, and invoke a control. The user can view the preview image of the template document in the interface, and further can know the specific document content of the template document. When the user determines that the template document is indeed the template document which needs to be called by the user according to the document content of the template document, the user can further click the calling control and then can transfer to the document editing page corresponding to the template document. The user can edit the specific scene of the template document on the page, and then the calling of the template document by the user is completed.
When a user clicks the template calling control to call the template to create a new shared document, the shared document application program displays a template display interface, and thumbnail images corresponding to the template document are displayed in the template display interface. The thumbnail images corresponding to the plurality of template documents can be simultaneously displayed in the template display interface, and specifically, the sorting mode of the thumbnail images corresponding to the plurality of template documents can be determined according to the generation time of the thumbnail images. For example, a target thumbnail image whose generation time is closest to the current time may be displayed at the uppermost or leftmost position on the template presentation interface, and a thumbnail image whose generation time is earlier than the target thumbnail image generation time may be displayed at the lower or right position of the target thumbnail image.
In some embodiments, the thumbnail images corresponding to a plurality of template documents may also be displayed in a classified manner according to the type of the template document, and the type of the template document may be determined by classification according to the document content of the template document. For example, the template documents of the contract category can be classified into one category for display, the template documents of the protocol category can be classified into one category for display, and the user can also switch and display thumbnail images corresponding to template documents of other types through sliding operation on the template display interface, so that the template documents of the required category can be quickly found.
In some embodiments, the presentation order of the thumbnail images may also be determined comprehensively according to the calling frequency of the template document and the creation time of the thumbnail images. For example, the template presentation interface may be divided into a first display area and a second display area, and the first display area may be disposed above the second display area. In the first display area, thumbnail images corresponding to three template documents with the highest calling frequency may be displayed. In the second display area, thumbnail images other than the three thumbnail images in the first display area may be presented in the aforementioned generation time order.
According to the above description, the document processing method provided by the application displays the document editing page, where the document editing page includes a document editing area and a functional area, the document editing area includes document content of a shared document, and the shared document can be operated by at least two authorized users simultaneously or non-simultaneously; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content. Thus, by automatically identifying the document content in the document editing area, a preview image containing the document content without containing the functional area is quickly generated. Compared with the method for manually capturing the preview image of the document, the method provided by the application can improve the generation efficiency of the document preview image and greatly improve the document processing efficiency.
In order to better implement the method, the embodiment of the invention also provides a document processing device which can be integrated in the server.
For example, as shown in fig. 9, for a schematic structural diagram of a document processing apparatus provided in an embodiment of the present application, the document processing apparatus may include a first display unit 301 and an identification unit 302, as follows:
a first display unit 301 that displays a document editing page, the document editing page including a document editing region and a functional region, the document editing region including document contents of a shared document, the shared document being operable by at least two authorized users simultaneously or non-simultaneously;
an identifying unit 302, configured to identify document content in response to an image preview operation on a shared document, to generate a preview image containing the document content.
In some embodiments, the identification unit comprises:
the display subunit is used for displaying the preview image generation control on the document editing page;
and the first identification subunit is used for identifying the document content in response to the touch operation aiming at the preview image generation control so as to generate a preview image containing the document content.
In some embodiments, the apparatus further comprises:
the second display unit is used for displaying a display page of the preview image, and the display page comprises a modification control;
the third display unit is used for responding to the touch operation aiming at the modification control and displaying an editing page of the preview image;
the image processing device comprises a determining unit, a processing unit and a display unit, wherein the determining unit is used for receiving image area selection operation aiming at an editing page of a preview image and determining an area corresponding to the image area selection operation as a target area;
and the first generation unit is used for generating a target preview image corresponding to the target area and updating the preview image by using the target preview image.
In some embodiments, the apparatus further comprises:
the fourth display unit is used for displaying the storage control on the display page;
and the first storage unit is used for responding to a touch instruction aiming at the saving control and storing the preview image and the shared document in an associated manner.
In some embodiments, the apparatus further comprises:
the second generation unit is used for generating a link corresponding to a shared document, and the shared document is a template document;
a first storage unit further to: and storing the link corresponding to the shared document and the preview image in the template library in an associated manner so as to update the template library.
In some embodiments, the identification unit comprises:
the first determining subunit is used for opening the shared document and determining a target document object model node corresponding to the document editing area;
the second determining subunit is used for determining a target area corresponding to the target document object model node;
and the screenshot subunit is used for screenshot the target area to obtain a preview image corresponding to the shared document.
In some embodiments, the second determining subunit includes:
the first acquisition module is used for acquiring the margin of the shared document when detecting that the document type of the shared document is a text document;
and the first determining module is used for determining a target area according to the margin and the area corresponding to the target document object model node.
In some embodiments, the first obtaining module comprises:
the obtaining submodule is used for obtaining a first margin corresponding to the text content of the shared document and a second margin corresponding to the non-text content when the document content of the shared document is detected to contain the non-text content;
and the determining submodule is used for determining the minimum page margin of the first page margin and the second page margin as the page margin of the shared document.
In some embodiments, the apparatus further comprises:
a third determining subunit, configured to determine that the width of the preview image is the first target width;
the calculating subunit is used for calculating to obtain a first target height according to the first target width and a first preset aspect ratio;
and the intercepting subunit is used for intercepting the thumbnail image corresponding to the shared document from the preview image according to the first target height.
In some embodiments, the apparatus further comprises:
an acquisition unit configured to acquire a document link of a shared document;
and a second storage unit for storing the document link in association with the preview image and the thumbnail image.
In some embodiments, the apparatus further comprises:
the fifth display unit is used for responding to a preset template calling instruction and displaying the thumbnail image;
the sixth display unit is used for receiving a touch instruction aiming at the thumbnail image, displaying the preview image and calling the control;
and the seventh display unit is used for displaying the document editing page when the touch operation aiming at the calling control is detected.
In some embodiments, the second determining subunit includes:
the second acquisition module is used for acquiring the width of a content area corresponding to each line in the shared document when the document type of the shared document is detected to be a table document, wherein the width of the content area is the accumulated width of an area containing cells with data in one line;
the second determining module is used for determining that the maximum value in the width of the content area corresponding to each row is a second target width;
the calculation module is used for calculating to obtain a second target height according to the second target width and a second preset aspect ratio;
and the third determining module is used for determining a target area according to the area corresponding to the target document object model node, the second target width and the second target height.
In some embodiments, the identification unit comprises:
the acquisition subunit is used for responding to image preview operation on the shared document and acquiring user account information of a currently logged-in user;
and the second identification subunit is used for identifying the document content when detecting that the user account information meets the preset condition so as to generate a preview image containing the document content.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, the document processing apparatus provided in this embodiment displays, via the first display unit 301, a document editing page, where the document editing page includes a document editing area and a functional area, the document editing area includes document contents of a shared document, and the shared document is available for simultaneous or non-simultaneous operation by at least two authorized users; the identifying unit 302 identifies document contents in response to an image preview operation for a shared document to generate a preview image containing the document contents. Thus, by automatically recognizing the document content in the document editing area, a preview image containing the document content but not the functional area is quickly generated. Compared with the method for manually intercepting the preview image of the document, the method provided by the application can improve the generation efficiency of the preview image of the document and greatly improve the document processing efficiency.
An embodiment of the present application further provides a computer device, where the computer device may be a terminal or a server, as shown in fig. 10, and is a schematic structural diagram of the computer device provided in the present application. Specifically, the method comprises the following steps:
the computer device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the computer device architecture illustrated in FIG. 10 is not intended to be limiting of computer devices and may include more or less components than those illustrated, or combinations of certain components, or different arrangements of components. Wherein:
the processor 401 is a control center of the computer device, links various parts of the entire computer device by various interfaces and lines, performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the computer device as a whole. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and document processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, a web page access, and the like), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 via a power management system, so that functions of managing charging, discharging, and power consumption are implemented via the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 404, the input unit 404 being operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions as follows:
displaying a document editing page, wherein the document editing page comprises a document editing area and a function area, the document editing area comprises document contents of a shared document, and the shared document can be operated by at least two users with permission simultaneously or non-simultaneously; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content.
It should be noted that the computer device provided in the embodiment of the present application and the document processing method in the foregoing embodiment belong to the same concept, and specific implementation of the above operations may refer to the foregoing method embodiment, which is not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present invention provide a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute steps in any one of the document processing methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
displaying a document editing page, wherein the document editing page comprises a document editing area and a functional area, the document editing area comprises document contents of a shared document, and the shared document can be operated by at least two users with permission at the same time or non-simultaneously; in response to an image preview operation on a shared document, document content is identified to generate a preview image containing the document content.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any document processing method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any document processing method provided in the embodiments of the present invention can be achieved, and detailed descriptions are omitted here for the sake of detail in the foregoing embodiments.
According to an aspect of the application, there is provided, among other things, a computer program product or computer program comprising computer instructions stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions to enable the computer device to execute the document processing method provided in the various optional implementation modes in the embodiment.
The document processing method, the document processing apparatus, the storage medium, and the computer device provided in the embodiments of the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (15)
1. A method of document processing, the method comprising:
displaying a document editing page, wherein the document editing page comprises a document editing area and a functional area, the document editing area comprises document content of a shared document, and the shared document can be operated by at least two authorized users at the same time or non-simultaneously;
in response to an image preview operation on the shared document, identifying document content in the document editing area to generate a preview image containing the document content, wherein the preview image does not contain the functional area and a blank area in the document editing area;
storing the shared document and the preview image of the shared document in a template library in a correlated manner, wherein the template library comprises the preview images of a plurality of template documents for a user to view and select for newly building the shared document;
the identifying document content in the document editing region to generate a preview image containing the document content includes:
screenshot is carried out on a document editing area in a document editing page to obtain a preview image of a shared document; or determining a target document object model node corresponding to the document editing area, determining a target area corresponding to the target document object model node, and performing screenshot on the target area to obtain a preview image corresponding to the shared document.
2. The method of claim 1, wherein identifying document content in the document editing region in response to an image preview operation on the shared document to generate a preview image containing the document content comprises:
displaying a preview image generation control on the document editing page;
and identifying the document content in response to the touch operation of the preview image generation control to generate a preview image containing the document content.
3. The method of claim 1 or 2, wherein after identifying the document content to generate a preview image containing the document content, further comprising:
displaying a display page of the preview image, wherein the display page comprises a modification control;
responding to the touch operation aiming at the modification control, and displaying an editing page of the preview image;
receiving an image area selection operation aiming at an editing page of the preview image, and determining an area corresponding to the image area selection operation as a target area;
and generating a target preview image corresponding to the target area, and updating the preview image by using the target preview image.
4. The method of claim 3, further comprising:
displaying a saving control on the display page;
and responding to a touch instruction aiming at the saving control, and performing associated storage on the preview image and the shared document.
5. The method of claim 4, further comprising:
generating a link corresponding to the shared document, wherein the shared document is a template document;
the associating and storing the preview image and the shared document comprises:
and associating the link corresponding to the shared document with the preview image and storing the link and the preview image in a template library so as to update the template library.
6. The method of claim 1, wherein determining the target region corresponding to the target document object model node comprises:
when the document type of the shared document is detected to be a text document, acquiring the margin of the shared document;
and determining a target area according to the margin and the area corresponding to the target document object model node.
7. The method of claim 6, wherein obtaining the margin of the shared document comprises:
when detecting that the document content of the shared document contains non-text content, acquiring a first margin corresponding to the text content of the shared document and a second margin corresponding to the non-text content;
and determining the smallest page margin of the first page margin and the second page margin as the page margin of the shared document.
8. The method according to claim 6 or 7, wherein after the screenshot of the target area and the preview image corresponding to the shared document are obtained, the method further comprises:
determining the width of the preview image as a first target width;
calculating to obtain a first target height according to the first target width and a first preset aspect ratio;
and intercepting a thumbnail image corresponding to the shared document from the preview image according to the first target height.
9. The method of claim 8, further comprising:
acquiring a link of the shared document;
and storing the link in association with the preview image and the thumbnail image.
10. The method of claim 8, further comprising:
responding to a preset template calling instruction, and displaying the thumbnail image;
receiving a touch instruction aiming at the thumbnail image, displaying the preview image and calling a control;
and when the touch operation aiming at the calling control is detected, displaying the document editing page.
11. The method of claim 1, wherein determining the target region corresponding to the target document object model node comprises:
when the document type of the shared document is detected to be a table document, acquiring the width of a content area corresponding to each line in the shared document, wherein the width of the content area is the accumulated width of an area containing cells with data in one line;
determining the maximum value in the width of the content area corresponding to each line as a second target width;
calculating to obtain a second target height according to the second target width and a second preset width-to-height ratio;
and determining a target area according to the area corresponding to the target document object model node, the second target width and the second target height.
12. The method of claim 1, wherein identifying the document content in response to an image preview operation on the shared document to generate a preview image containing the document content comprises:
responding to image preview operation of the shared document, and acquiring user account information of a currently logged-in user;
and when the user account information is detected to meet the preset condition, identifying the document content to generate a preview image containing the document content.
13. A document processing apparatus, characterized in that the apparatus comprises:
the display unit is used for displaying a document editing page, the document editing page comprises a document editing area and a functional area, the document editing area comprises document content of a shared document, and the shared document can be operated by at least two authorized users at the same time or non-simultaneously;
an identifying unit configured to identify a document content in the document editing region in response to an image preview operation on the shared document to generate a preview image containing the document content, wherein the preview image does not contain the functional region and a blank region in the document editing region; the identifying document content in the document editing region to generate a preview image containing the document content includes: screenshot is carried out on a document editing area in a document editing page to obtain a preview image of a shared document; or determining a target document object model node corresponding to the document editing area, determining a target area corresponding to the target document object model node, and performing screenshot on the target area to obtain a preview image corresponding to the shared document;
and the storage unit is used for storing the shared document and the preview image of the shared document in a template library in a correlated manner, wherein the template library comprises the preview images of a plurality of template documents for a user to view and select to newly create the shared document.
14. A computer-readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the document processing method of any one of claims 1 to 12.
15. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the document processing method of any one of claims 1 to 12 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110414484.4A CN113158619B (en) | 2021-04-16 | 2021-04-16 | Document processing method and device, computer readable storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110414484.4A CN113158619B (en) | 2021-04-16 | 2021-04-16 | Document processing method and device, computer readable storage medium and computer equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113158619A CN113158619A (en) | 2021-07-23 |
CN113158619B true CN113158619B (en) | 2022-05-17 |
Family
ID=76868494
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110414484.4A Active CN113158619B (en) | 2021-04-16 | 2021-04-16 | Document processing method and device, computer readable storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113158619B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609834B (en) * | 2021-08-18 | 2024-11-12 | 北京字跳网络技术有限公司 | Information processing method, device, equipment and medium |
CN113849102B (en) * | 2021-09-26 | 2023-08-08 | 网易(杭州)网络有限公司 | Document processing method, device, computer equipment and storage medium |
CN114153905B (en) * | 2021-11-05 | 2024-08-02 | 海南航众科技有限公司 | Document preview realization system |
CN114880059B (en) * | 2022-05-19 | 2024-09-13 | 中国银行股份有限公司 | Software environment installation method and device, storage medium and electronic equipment |
CN118568134B (en) * | 2024-08-01 | 2024-11-05 | 浪潮软件科技有限公司 | Method, system, equipment and medium for converting structured data and time sequence data |
CN119047422B (en) * | 2024-11-04 | 2025-01-24 | 优视科技(中国)有限公司 | Document operation method based on picture display, electronic device and readable storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2003254737A1 (en) * | 1999-06-30 | 2003-11-13 | Silverbrook Research Pty Ltd | Method and systems for collaborative document markup using processing |
JP2010218466A (en) * | 2009-03-18 | 2010-09-30 | Ricoh Co Ltd | Device, method and program for editing document image, and computer readable recording medium storing program for making computer execute the method |
CN102004779A (en) * | 2010-11-19 | 2011-04-06 | 百度在线网络技术(北京)有限公司 | Document sharing platform and document processing method |
CN103353886A (en) * | 2013-06-28 | 2013-10-16 | 优视科技有限公司 | Method and system for previewing webpage |
CN109101145A (en) * | 2017-06-20 | 2018-12-28 | 夏普株式会社 | Content cooperative system, content reception apparatus and content collaboration method |
CN110020261A (en) * | 2018-02-06 | 2019-07-16 | 中国平安人寿保险股份有限公司 | Document converts sharing method, device, equipment and readable storage medium storing program for executing |
CN112632919A (en) * | 2020-09-28 | 2021-04-09 | 腾讯科技(深圳)有限公司 | Document editing method and device, computer equipment and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007328489A (en) * | 2006-06-07 | 2007-12-20 | Fuji Xerox Co Ltd | Document management device and program |
CN107992465A (en) * | 2017-12-13 | 2018-05-04 | 广州阿里巴巴文学信息技术有限公司 | The method, apparatus and terminal device that a kind of reading content is shared |
CN110968374A (en) * | 2018-09-29 | 2020-04-07 | 珠海金山办公软件有限公司 | Document information display method and device, electronic equipment and storage medium |
CN110196971A (en) * | 2019-04-23 | 2019-09-03 | 平安科技(深圳)有限公司 | Online document edit methods, device, terminal device and storage medium |
CN111817946B (en) * | 2020-06-28 | 2022-03-15 | 北京字节跳动网络技术有限公司 | Processing method, device, equipment, medium and system for document sharing |
CN112631997B (en) * | 2020-11-26 | 2021-09-28 | 腾讯科技(深圳)有限公司 | Data processing method, device, terminal and storage medium |
-
2021
- 2021-04-16 CN CN202110414484.4A patent/CN113158619B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2003254737A1 (en) * | 1999-06-30 | 2003-11-13 | Silverbrook Research Pty Ltd | Method and systems for collaborative document markup using processing |
JP2010218466A (en) * | 2009-03-18 | 2010-09-30 | Ricoh Co Ltd | Device, method and program for editing document image, and computer readable recording medium storing program for making computer execute the method |
CN102004779A (en) * | 2010-11-19 | 2011-04-06 | 百度在线网络技术(北京)有限公司 | Document sharing platform and document processing method |
CN103353886A (en) * | 2013-06-28 | 2013-10-16 | 优视科技有限公司 | Method and system for previewing webpage |
CN109101145A (en) * | 2017-06-20 | 2018-12-28 | 夏普株式会社 | Content cooperative system, content reception apparatus and content collaboration method |
CN110020261A (en) * | 2018-02-06 | 2019-07-16 | 中国平安人寿保险股份有限公司 | Document converts sharing method, device, equipment and readable storage medium storing program for executing |
CN112632919A (en) * | 2020-09-28 | 2021-04-09 | 腾讯科技(深圳)有限公司 | Document editing method and device, computer equipment and storage medium |
Non-Patent Citations (4)
Title |
---|
A usability study of awareness widgets in a shared workspace groupware system;Gutwin Carl 等;《Proceedings of the 1996 ACM conference on Computer supported cooperative work》;19961130;258-267 * |
Histomages: fully synchronized views for image editing;Chevalier Fanny 等;《Proceedings of the 25th annual ACM symposium on User interface software and technology》;20121031;281-286 * |
企业文档管理系统的设计与实现;谢佳明;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20130515(第05期);I138-1607 * |
我国科研数据管理与共享政策保障研究;邢文明;《中国优秀博硕士学位论文全文数据库(博士)经济与管理科学辑》;20170615(第06期);J168-2 * |
Also Published As
Publication number | Publication date |
---|---|
CN113158619A (en) | 2021-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113158619B (en) | Document processing method and device, computer readable storage medium and computer equipment | |
US10380235B2 (en) | Method and system for annotation and connection of electronic documents | |
EP2819035B1 (en) | Systems and methods for presentations with live application integration | |
US20220342518A1 (en) | Card-based information management method and system | |
JP7407928B2 (en) | File comments, comment viewing methods, devices, computer equipment and computer programs | |
US11797258B2 (en) | Conversational analytics with data visualization snapshots | |
CN112632919B (en) | Document editing method and device, computer equipment and storage medium | |
EP2909739A1 (en) | Methods and systems for managing spreadsheet models | |
CN104166514A (en) | Information processing apparatus, information processing system, and information display method | |
US20200287861A1 (en) | Method and system for processing information in social network system | |
CN113220381B (en) | A click data display method and device | |
JP2017220221A (en) | Information processing device, information processing method, and program | |
JP2012064207A (en) | Host device and content display method of the same | |
CN114327709A (en) | Control page generation method and device, intelligent device and storage medium | |
CN114065765A (en) | Weapon equipment text processing method and device combining AI and RPA and electronic equipment | |
CN113296775A (en) | Page generation method and device, computer equipment and storage medium | |
CN113268232B (en) | Page skin generation method and device and computer readable storage medium | |
CN113901360A (en) | A data processing method, device and electronic device | |
JP2017097686A (en) | Information processing unit, control method thereof and program | |
JP2007233698A (en) | Web display terminal and annotation processing module | |
JP2004326626A (en) | Structured document file management apparatus and structured document file management method | |
CN113590564B (en) | Data storage method, device, electronic equipment and storage medium | |
CN101676905A (en) | Layout for modifying resource contents based on customized rules | |
KR102303335B1 (en) | Method for generating presentation content using data binding, and apparatus using said method, and system for providing presentation content using data binding | |
CN113706209B (en) | Operation data processing method and related device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40048331 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |