CN113642304A - Template-based document editing method and device - Google Patents

Template-based document editing method and device Download PDF

Info

Publication number
CN113642304A
CN113642304A CN202110808651.3A CN202110808651A CN113642304A CN 113642304 A CN113642304 A CN 113642304A CN 202110808651 A CN202110808651 A CN 202110808651A CN 113642304 A CN113642304 A CN 113642304A
Authority
CN
China
Prior art keywords
text
target
page
default
editing
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.)
Pending
Application number
CN202110808651.3A
Other languages
Chinese (zh)
Inventor
陆秀顺
陈欣琪
张泽鼎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Wuhan Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202110808651.3A priority Critical patent/CN113642304A/en
Publication of CN113642304A publication Critical patent/CN113642304A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Abstract

The application provides a document editing method and device based on a template. A template-based document editing method comprises the following steps: responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template; displaying the document template in a preset page; receiving a text editing request initiated aiming at a target default text based on the preset page, wherein the target default text is any default text in the document template; responding to the text editing request, and acquiring a target text; replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text. By adopting the method, the document can be quickly generated based on the document template, and the format is ensured to be unchanged in the document editing process.

Description

Template-based document editing method and device
Technical Field
The present application relates to the field of electronic document processing technologies, and in particular, to a template-based document editing method and apparatus.
Background
With the development of the technology, a user can process various matters in learning and working through an electronic document, and compared with a traditional paper document, the convenience and the efficiency can be greatly improved. In some fields, it is often desirable to use electronic documents in a particular format. For example, documents (official documents) are written materials which are formed and used by legal authorities and organizations in official activities according to specific styles and through certain processing procedures, and generally, the formats, the types and the rules of the documents are unified, which requires that relevant personnel strictly comply with the format requirements when writing the documents.
In the related art, the electronic document with the specific format is usually edited manually by a user, and the user needs to manually adjust the font size, the font type, the line spacing and the like in the process, so that the operation is complicated, and the efficiency is low. Or, an electronic document template conforming to the format specification may be generated in advance, and the user may modify the template directly, but the user may destroy the format of the original template in the modification process, which may result in the user needing to manually adjust the format.
Disclosure of Invention
In view of the above, the present application provides a template-based document editing method and apparatus.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of the present application, a template-based document editing method is provided, including:
responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
displaying the document template in a preset page;
receiving a text editing request initiated aiming at a target default text based on the preset page, wherein the target default text is any default text in the document template;
responding to the text editing request, and acquiring a target text;
replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text. According to a second aspect of the present application, there is provided a template-based document editing apparatus, comprising:
the template acquiring unit is used for responding to a document editing request and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
the display unit is used for displaying the document template in a preset page;
a receiving unit, configured to receive, based on the preset page, a text editing request initiated for a target default text, where the target default text is any default text in the document template;
a text acquisition unit configured to acquire a target text in response to the text editing request;
and the replacing unit is used for replacing the target default text in the document template with the target text and reserving the format of the target text as the fixed format of the target default text.
In an embodiment of the present application, in response to a document editing request, a document template specified by the document editing request may be obtained, and the document template may be displayed in a preset page. And a text editing request for the target default text may be received based on the preset page, the target text may be obtained in response to the text editing request, the target default text in the document template may be replaced with the target text, and the format of the target text may be maintained as the fixed format of the target default text. By adopting the method, the document can be edited based on the preset document template so as to quickly generate the document, thereby improving the document generation efficiency and the convenience. In addition, only the text content of the default text can be edited without editing the format of the default text in the text editing process, the original format of the document template can be ensured not to be damaged, compared with the prior art, the damaged format does not need to be readjusted by a user, and the user experience is improved. And the operation of manually editing the format by the user can be greatly reduced, so that the consumption of the performance of the equipment is reduced, and the computing resource of the equipment is saved.
Drawings
FIG. 1 is a flowchart illustrating a template-based document editing method according to an exemplary embodiment of the present application;
FIG. 2 is a schematic view of a page shown in an exemplary embodiment of the present application;
FIG. 3 is a flowchart illustrating another template-based document editing method according to an exemplary embodiment of the present application;
FIG. 4 is a schematic view of another page shown in an exemplary embodiment of the present application;
FIG. 5 is a flowchart illustrating another template-based document editing method, according to an exemplary embodiment of the present application;
FIG. 6 is a schematic view of another page shown in an exemplary embodiment of the present application;
FIG. 7 is a diagram illustrating a hardware configuration of an electronic device in which a template-based document editing apparatus according to an exemplary embodiment of the present application is located;
fig. 8 is a block diagram of a template-based document editing apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
With the development of the technology, a user can process various matters in learning and working through electronic documents, and the efficiency can be greatly improved. In some fields, it is often desirable to use electronic documents in a particular format, such as line spacing, font size and font type, distance of text from the beginning and end of a header, position of a header on a page, and so forth. These specific formats are usually edited manually by the user, and the operation is cumbersome. Especially, when different types of electronic documents are required to be generated, and each type of electronic document has a different format, the method using manual editing is inefficient and has poor user experience.
In the related art, an electronic document template may be preset, the electronic document template may include some default texts meeting format requirements, which are edited in advance, and a user may edit the template to quickly generate an electronic document meeting the format requirements. However, the format of the templates is not fixed, and the original format of the templates may be damaged by the user in the process of using the templates, for example, text from other places may be filled into the templates by copying and pasting, and if the original format of the text is different from the format specified by the templates, it is likely that the format of the template filled into the templates is the original format of the text, and the user is still required to manually adjust the format of the template to the format specified by the templates, which is still very inconvenient.
Based on the method, the electronic document which meets the format regulation can be automatically generated based on the template, and in the process of generating the electronic document, the default text in the template is limited to be edited, namely the text content of the default text can be edited but the format cannot be edited, so that the format is ensured not to be changed in the process of editing the document, the requirement of a user for editing based on the template to quickly generate the electronic document is met, the format change cannot be caused by editing, the convenience is greatly improved, and the user experience is improved. Furthermore, due to the limitation of format editing, the number of times of document operation by the user can be reduced, so that the consumption of the device performance caused by repeated editing in the document editing process is reduced, and the computing resources such as a Central Processing Unit (CPU), a memory or other processors can be saved.
Referring to fig. 1, fig. 1 is a flowchart illustrating a template-based document editing method according to an exemplary embodiment of the present application. The method can be applied to electronic equipment with a memory and a processor, such as a computer, a tablet computer, a mobile phone and the like. The electronic device may be loaded with a client, such as application software for document editing.
The template-based document editing method may include the steps of:
step 102, responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template.
And 104, displaying the document template in a preset page.
Step 106, receiving a text editing request initiated for a target default text based on the preset page, wherein the target default text is any default text in the document template.
And step 108, responding to the text editing request, and acquiring a target text.
Step 110, replacing the target default text in the document template with the target text, and reserving the format of the target text as the fixed format of the target default text.
The above steps are explained in detail below:
in this embodiment, a plurality of document templates may be preset, and the type and content of the document template may be set according to an actual service scenario, which is not particularly limited. Each document template may include several default texts, and the type and content of the default text may be preset, for example, the content matching the service scenario may be preset as the default text, or may also be default.
For example, taking a document template as an example of a document template, the document usually includes text elements such as a title, a version number, a security level, a body, and a signature, and default texts corresponding to the text elements may be set, that is, a default text corresponding to the title, a default text corresponding to the version number, a default text corresponding to the security level, a default text corresponding to the body, and a default text corresponding to the signature. The content of each default text may be a default, such as "xxx", or may be matched to a specific business scenario, such as the title corresponding to the default text may be "guangzhou citizens government documents".
When text editing is performed based on the document template, only the text content of the default text can be changed, and the fixed format of the default text is limited to be changed. Of course, fixed text may also be set in the document template, the type and content of the fixed text may also be set according to a specific application scenario, and the text content and format of the fixed text are fixed. Based on the document template, when the document template is edited subsequently, the fixed text can not be edited, that is, the text content and the text format of the fixed text are ensured to be edited in a limited manner. The fixed text is typically text that does not change in the document template. For example, in general, each document will include an element of "issuer," which may be fixed text. Of course, this example is merely illustrative and is not intended to limit the present application. Moreover, the document template may or may not include fixed text, and is not particularly limited.
In this embodiment, the electronic device may initiate a document editing request, and the document editing request may also carry a document template specified by a user. The client can respond to the document editing request, obtain the document template specified by the document editing request, and show the document template to the user in a preset page. The preset page may be, for example, a page specifically used for displaying the document template, and the preset page is used for shielding an editing operation on a format of the document template, and specifically, the preset page is used for shielding an editing operation on a format of the default text; and also for masking editing operations for the content or format of the fixed text, as will be described in detail in later embodiments.
The electronic device can set the display form of the default text to be distinguished from the fixed text, e.g., the default text can be marked in a specified form, such as a specified color, a specified ground color, a specified font, etc. Further, the electronic device may also detect the difference in the specified form to distinguish which texts are default texts and which texts are fixed texts.
The electronic device can initiate a text editing request for any default text (target default text) in the document template based on the preset page, such as by clicking or double clicking on the target default text to initiate the text editing request. The client may receive the text editing request and determine a target default text based on the text editing request.
In addition, the electronic device may further input a target text for replacing the target default text, where the target text may be carried in the text editing request or re-input by the electronic device, which is not particularly limited. The client can respond to the text editing request, acquire the target text, update the target default text in the document template into the target text, and reserve the format of the target text into the fixed format of the target default text, so as to implement editing with unchanged format based on the target document template. The specific method will be described in detail in the examples below. It should be noted that, in the above method, filling the target text into the document template refers to performing document editing on the basis of the document template to obtain the document required by the user quickly.
As can be seen from the above description, in an embodiment of the present application, a document template specified by a document editing request may be obtained in response to the document editing request, and the document template is displayed in a preset page. And a text editing request for the target default text may be received based on the preset page, the target text may be obtained in response to the text editing request, the target default text in the document template may be replaced with the target text, and the format of the target text may be maintained as the fixed format of the target default text. By adopting the method, the document can be directly edited based on the preset document template so as to quickly generate the document, and the document generation efficiency and the convenience can be improved. And the default text in the template can be edited in a limited manner through the document template, namely the text content can be edited but the format cannot be edited, so that the format invariance is ensured, and compared with the prior art, the format is not required to be adjusted manually by a user, and the user experience is improved. And the operation times of the user on the document can be reduced, so that the consumption of the equipment performance in the document editing process is reduced, and the computing resources are saved.
The following describes an embodiment of another template-based document editing method provided by the present application.
First, a method of generating a document template in the present embodiment will be described.
In this embodiment, a document may be edited by a relevant person according to a format requirement under a corresponding service scenario, and the document may include some preset text elements, such as a title, a version number, a security level, and the like mentioned in the foregoing example. And the format of these text elements should be in accordance with the specification, such as font, font size, margin, etc. After writing, the document template can be converted into a template file, namely, a file which cannot be edited in the whole document, so that an initial document template is obtained. The associated person may then specify that some text elements in the initial document template are to be determined as default text, some as fixed text, and of course, fixed text may be tables, images, shapes, etc., in addition to text elements.
Specifically, the relevant person may initiate a field setting request for a certain text element, and after receiving the request, the client may generate a field for the text element, take a text corresponding to the text element as a default text, and may bind a fixed format corresponding to the text element based on the field.
In one example, a text in which a field is set may be determined as a default text, a text in which a field is not set may be determined as a fixed text, and then whether the text belongs to the default text or the fixed text may be distinguished according to whether the text is set with a field.
In another example, fields may be set for both the default text and the fixed text, and labels may also be added to these fields, such as a field of the default text may be labeled as "1" and a field of the fixed text may be labeled as "0", and subsequently whether the text belongs to the default text or the fixed text may be distinguished based on the labels.
Of course, the default text and the fixed text may be distinguished in other ways, and this embodiment is not limited to this example.
After a domain is created for a certain content in a document, the content can be updated through the domain, for example, text content and format are updated. For a specific domain creation method, reference may be made to related technologies, which are not described herein in detail.
Taking a document template as an official document template as an example, referring to fig. 2, fig. 2 exemplarily shows a certain page in the official document template, where the page may include text elements such as a version number, a security level, related information of a issuing authority, a text title, and text content, and the font, font size, font color, position on the page, and the like of the text elements are in compliance with the specification. The page may include some default texts and fixed texts, for example, for the content of "issuer xxx", in which "issuer" is a fixed text and "xxx" is a default text, the user may edit the text content of the default text, for example, the user may input "zhang san", and may update the original "xxx" to "zhang san", and then "issuer xxx" may be updated to "zhang san". The format of "zhang san" is the same as the format of "xxx".
In order to help the user distinguish which text elements are default text and which are fixed text, a specified format may be set for the default text, such as a specified font color, a specified ground color (not shown), a specified font, and the like. Of course, the example shown in FIG. 2 is merely illustrative and is not intended to limit the present application.
After the method for generating the document template is elucidated, a document editing method based on the template will be described below.
Referring to fig. 3, fig. 3 is a flowchart illustrating another template-based document editing method according to an exemplary embodiment of the present application. The method can be applied to a client, such as a document editing plug-in loaded on a WPS client, and specifically includes the following steps:
step 302, in response to a document editing request, obtaining a document template specified by the document editing request.
In this embodiment, a button corresponding to the document editing plug-in may be displayed on the WPS client, and the user may click the button to enter a document editing page. Taking the official document template as an example, several kinds of official document templates can be displayed to the user on the page, for example, different types of official document templates can be generated in advance according to the official document, the commonly used official document types include regulations, decisions, commands, instructions, replies, notifications and the like, and the official document template can be generated in advance for each official document type. These types of document templates may be presented to the user (e.g., name of the document template, thumbnail, etc.) from which the user may select the desired document template to initiate the document editing request.
After receiving the document editing request, the document editing plug-in can obtain the document template carried in the request.
Step 304, displaying the document template in a preset page, where the preset page includes a template area and an editing area, displaying the document template in the template area, and displaying a text editing box corresponding to each default text in the document template in the editing area, so as to input a target text.
In this embodiment, the document template may be presented to the user in a visual preset page. Specifically, a template area and an editing area may be displayed in the preset page, where the template area is used to display the document template, and the template area is not editable, so as to shield the editing operation acting on the template area, that is, the preset page does not respond to a text editing request initiated by a user, and is only used to display a preview of the editing to the user. If a user wants to edit a document, a text editing request needs to be initiated in an editing area. The edit section is used to provide a user with entry for document editing, where the user can initiate a text editing request, which the edit section can respond to. The editing area can display text editing boxes corresponding to each default text included in the document template, the text input by the user can be collected based on the text editing boxes, the corresponding default text in the template area is edited, and the editing result can be displayed in the template area after editing.
Referring to fig. 4, fig. 4 is another schematic page diagram shown in an exemplary embodiment of the present application. The template area is on the left side of the page and the editing area is on the right side of the page in fig. 4. The template area shows a document template that includes several default pieces of text, such as "Guangzhou municipal government documents", "xxx", "text headline", outlined in FIG. 4 with a dashed box. The text content of the default texts can be editable through the preset page, and the format is fixed. The editing area is displayed with a text editing box corresponding to each default text for inputting the text. As shown in fig. 4, there are a text edit box of the issuing authority logo (i.e., corresponding to the "guangzhou citizen government document" in the template area), a text edit box of the issuer (i.e., corresponding to the "xxx" in the template area), and a text edit box of the body title (i.e., corresponding to the "body title" in the template area). The user can input text in the text edit boxes to update the corresponding default text in the template area to the text input by the user, and the format of the text is the same as that of the default text, so that the format is ensured to be unchanged. After the user input is finished, the template area can also display the updated document template, so that the editing preview is realized.
The editing area may be displayed persistently, or the editing area may be displayed by triggering after receiving a user's operation such as clicking or double-clicking on any target default text in the template area, which is not limited specifically.
In addition, in fig. 4, besides the text edit box for editing the default text, a related control for editing other non-text content in the document template may be displayed, for example, the control for editing the format head separation line in fig. 4 includes modifying the style, length, thickness, and the like of the format head separation line. Step 306, receiving a text editing request initiated for the target default text based on the preset page.
In the example of fig. 4, the edit status of the text edit box corresponding to the target default text in the edit area may be monitored; in a case where it is determined that the editing state is input with target text, it may be determined that a text editing request initiated for the target default text is initiated.
And 308, responding to the text editing request, and acquiring a target text.
In this embodiment, an editing request for a target default text, which acts on a preset page, may be received; a text editing request for a target default text is received based on the editing request.
For example, a user may initiate an editing request for any target default text in the document template in a preset page editing area, for example, the user may click a text editing box corresponding to any target default text in the editing area, and after the document editing plug-in monitors the click operation of the user, it is determined that the user initiates the editing request for the target default text. The user may then enter the target text in the input box to initiate a text editing request for the target default text, which the plug-in may retrieve in response to.
Wherein, when the text editing request is used for editing the format of the target default text, the text editing request can be masked to ensure that the format is unchanged. Besides, the text editing request can be shielded, and reminding information can be output to remind a user that the format cannot be edited.
Here, it is also possible to set an input condition for each default text, such as for the default text of "body title", it is possible to set the number of words of the input title not to exceed a specified number. If the number exceeds the specified number, an abnormal prompt can be output to prompt the user to re-input the target text.
For example, a "confirm" button (not shown) may be displayed on the page, and the user may confirm that the target text is completely input after clicking the button. For another example, the user may initially click on the region where the text editing box is located to input the target text, then may control the mouse cursor to leave the text editing box after the input is completed, and click on other regions outside the box, and after the monitoring user clicks on other regions, it is determined that the target text is completely input.
Step 310, replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text.
In this embodiment, the target default text in the document template may be updated with the target text input by the user. It should be noted that the actual editing based on the document template to obtain the document desired by the user is not meant here, and the template itself is not generated.
Specifically, in this embodiment, a mapping relationship between the default text and the fixed format thereof may be established, and after the target text input by the user for the target default text is obtained, the mapping relationship between the target default text and the fixed format thereof may be updated to the mapping relationship between the target text and the fixed format, so as to obtain the target text with the fixed format, and ensure that the format is unchanged.
The specific implementation method of the mapping relationship may be various. For example, a field may be set for default text in the template, and each default text may also be bound to its corresponding format based on the field. After the target text input by the user aiming at the target default text is acquired, a domain corresponding to the target default text can be determined, for example, the domain corresponding to the target default text can be found according to the name of the domain, then the value of the domain is updated to the target text from the target default text, and the fixed format bound to the domain is kept unchanged, that is, the target default text in the target document template can be updated to the target text, and the format of the target default text is the format specified by the template.
In this embodiment, the document template with the updated mapping relationship may also be displayed in the template region to implement preview of document editing, and a fixed format target text with a target default text may be displayed in the updated document template. Therefore, the user can clearly know the preview of the target text filled in the document template, and the user experience is improved.
In this embodiment, in the process of editing the target default text, the user may also delete the target default text.
In one example, the target default text may not be needed by the user, e.g., the user may not need the target default text of version number "000 xx" in fig. 4, a delete button (not shown) corresponding to the target default text may be displayed in the editing area, and the user may click the delete button to initiate a delete instruction. Of course, deletion may be performed in other ways, and is not described here.
In another example, default contents may exist in the text edit box corresponding to the target default text, where the default contents may be the target default text itself, or other contents, and if the user wants to replace the default contents with the target text, the user needs to delete the default contents before inputting the target text, which also causes the target default text to be temporarily deleted.
For example, the default content may exist in the edit box corresponding to the file authority flag in fig. 4 as "guangzhou city people government file", and if the user wants to replace the file with "shenzhen city people government file", the user may delete the "guangzhou city people government file" first, and then fill the "shenzhen city people government file" subsequently.
Further, there may be various methods for triggering the delete instruction, for example, the user may click an edit box corresponding to the sending-document flag, and then it may be determined that the instruction for deleting the "guangzhou city people government document" initiated by the user is received.
In this embodiment, after receiving a deletion instruction initiated by a user for a target default text, in response to the deletion instruction, a mapping relationship between the stored target default text and a fixed format thereof may be updated to a mapping relationship between a specified character and the fixed format, where the specified character may not be visible to the user, for example, may be a space with a width of 0 in the horizontal direction.
For an example that the user desires to delete a target default text, for example, delete the target default text of "000 xx", assuming that the fixed format corresponding to "000 xx" is "songxiang xiao five", the mapping relationship between "000 xx" and "songxiang xiao five" may be updated as follows: the mapping relation between the blank space and the small five songhua. See table 1 below:
Figure BDA0003167467600000131
TABLE 1
In this embodiment, after deleting the target default text, the user may want to resume deletion. In order to facilitate the user to restore the deleted target default text, a restoration manner may be preset. When a user wants to restore a deleted target default text, a restore operation for the deleted target default text can be sent according to a preset restore mode, for example, an edit box corresponding to the target default text is right-keyed and a restore button is clicked, and then the document editing plug-in can capture the restore operation, acquire the target default text, and update the mapping relationship between the designated characters and the fixed format into the mapping relationship between the target default text and the fixed format, so as to achieve the purpose of restoring the target default text.
For the above example that the target default text is deleted due to the need to input the alternative text, if the default content of the target default text, which is "000 xx", and the corresponding fixed format is "sons body small five", after receiving the deletion instruction, the mapping relationship between "000 xx" and "sons body small five" may be updated as follows: the mapping relation between the blank space and the small five songhua. After receiving the target text input by the user, if the target text is "00001", the designated character in the mapping relationship may be updated to the target text, that is, to the mapping relationship between "00001" and "songhua xiaowu". See table 2 below:
Figure BDA0003167467600000132
TABLE 2
When the text element is deleted, the specified character is used for replacing the text corresponding to the text element, and the essence is a hiding effect, so that the text element can be ensured to be kept at the specified position in the document template, and the fixed format bound by the text element can be ensured to be still stored in the document template. Furthermore, when the text element is restored, only the specified character corresponding to the text element needs to be replaced by the restored text, the restored text corresponding to the text element can be rapidly displayed at the specified position in the document template, and the fixed format bound by the text element is reserved.
Of course, if some non-deletable target default texts may be included in the document template, an add-delete tag may be set for each target default text, where the add-delete tag is used to identify the corresponding default text as a deletable and recoverable element. After initiating a deletion instruction for a target default text, a user can first judge whether the default text is provided with an add-delete tag, and if so, the deletion operation is executed; if not, an undeletable reminder may be output to the user.
In this embodiment, after the target default text is deleted, if there is no other text in the line where the target default text is located, the line height of the line may be adjusted to 0, which is equivalent to deleting a blank line. Therefore, the line can be prevented from being a blank line due to the fact that no text exists, and the national standard requirement of the official document is not met. Of course, if there is another text in the line, it is not necessary to adjust the line height of the line to 0.
In the above case, when the deletion operation of the target default text is resumed, the line height corresponding to each default text may be stored in advance so that the line height meets the national standard requirement. When the recovery deletion is performed, whether the line height of the corresponding row is 0 or not can be judged, and if not, the recovery deletion operation based on the mapping relation updating is executed; if the line height is 0, the line height of the line may be first adjusted to the line height corresponding to the target default text, and the above-mentioned deletion recovery operation based on the update of the mapping relationship may be performed.
By adopting the method, the target default text in the mapping relation is updated into the designated character after the target default text is deleted by setting the designated character, so that the phenomenon that the mapping relation between the target default text and the fixed format is also deleted due to the deletion of the target default text can be avoided, the fixed format can be saved, a subsequent user can find the fixed format and generate the text conforming to the fixed format if the deletion is cancelled or the replacement text is input, and the unchanged format is realized.
It can be seen from the above description that, in an embodiment of the present application, a user may be helped to quickly generate a required document through a document template, the user may edit text content of a default text in the document template to input a replacement text, and the format is not required to be modified by the user autonomously, and a target text may be automatically filled in the template in a format meeting the specification, so that editing with a constant format is realized, and the format is not required to be modified by the user manually, thereby improving the document generation efficiency.
And the target document template can be displayed for the user in a preset page, a template area and an editing area can be displayed in the preset page, the template area is used for displaying the template, and the editing area is used for providing a text editing box corresponding to the default text for the user so as to input the target text based on the text editing boxes. In addition, after the target text is input by the user, the target text can be converted into a corresponding format and displayed in the document template, so that the preview of text editing is realized, and the user experience can be greatly improved.
The following describes an embodiment of another template-based document editing method provided by the present application.
Referring to fig. 5, fig. 5 is a flowchart illustrating another template-based document editing method according to an exemplary embodiment of the present application. The method can be applied to a client, such as a document editing plug-in loaded on a WPS client, and specifically includes the following steps:
step 502, responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template.
In this embodiment, the specific method of step 502 may refer to the foregoing embodiments, and is not described herein again.
Step 504, generating a first page, displaying the document template on the first page, and generating a second page, wherein the second page is a transparent page and covers the first page.
In this embodiment, the document template may be presented to the user in a visual preset page. The preset page may include a first page and a second page.
Specifically, a first page may be generated first, and the first page is used for displaying the document template. A second page may also be generated, overlaid on the first page, for receiving a user-initiated editing operation based on the second page. In order not to affect the reading experience of the user, the second page may be a transparent page, and of course, other types of pages may also be used, such as a page with a specific color and low transparency, which is not particularly limited.
The following description will be given with reference to a specific example. FIG. 6 is another page schematic shown in an exemplary embodiment of the present application. See the left page in fig. 6, which includes a first page in which a document template is shown. The first page is overlaid with a transparent second page, which may be, for example, a cover layer. In one example, the second page may be the same size as the first page, covering the entire first page (not shown).
In another example, the second page may be used to cover only a portion of the area in the first page, such as the area marked by the dashed box in fig. 6. In general, the area covered by the second page may comprise several default texts, and the text content of these default texts may be edited. While the area not covered by the second page may not include any text, such as the blank portion in fig. 6.
Step 506, receiving an editing operation acting on the second page, and determining the default text of the first page at the acting position as a target default text based on the acting position of the editing operation on the second page.
Step 508, receiving a text editing request for the target default text.
Step 510, responding to the text editing request, and acquiring a target text.
In this embodiment, the user may initiate an editing operation. Since the second page is overlaid on the first page, the editing operation of the user is directly acted on the second page, and whether the editing operation is legal or not can be judged based on the second page, for example, the editing operation on the text content is legal, the operation on the format is illegal, and the editing operation on the format can be shielded.
Specifically, an editing operation acting on a second page may be received, and a default text in the first page at the acting position may be determined as a target default text based on the acting position of the editing operation on the second page. A text editing request for the target default text may then be received. For example, the region of the second page where the target default text is mapped may be set as an editable region, the editing region may be set to an editable state, and the user may input the target text in the editable state in the editable region to initiate the text editing request for the target default text. The client may acquire, as the target text, the text input to the editable area in response to the text editing request.
The editable area only supports the input target text but does not support the format of the input target text, and the editable area shields the editing request of the format.
And if so, shielding the editing operation.
For example, referring to fig. 6, a region 601 in fig. 6 is covered with a second page, a user may click any text in the region to initiate an editing operation on the second page, for example, the user may click "first, first hierarchical title", after receiving the editing operation, the client may first determine whether the text in the first page corresponding to the action position is a default text, and if "first, first hierarchical title" belongs to the default text, the text may be determined as a target default text, and the region 601 is set as an editable region and adjusted to an editable state, referring to the right page in fig. 6, after being adjusted to the editable state, a text editing box may be presented to the user, and the user may input a target text in the text editing box to initiate a text editing request for the target default text.
Of course, the example shown in fig. 6 is merely an illustrative illustration, and other ways may be adopted in practical applications, and no particular limitation is made to this.
Step 512, replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text.
In this embodiment, the corresponding target default text in the document template may be updated according to the target text input by the user, and the updated document template may also be displayed to the user, so as to implement preview of document editing.
The format of the target text can be the same as the fixed format of the preset default text binding, so that the replacement text in the fixed format is shown to the user. For a specific implementation method, reference may be made to the foregoing embodiments, which are not described herein again.
Alternatively, the user may also perform a custom format setting for the target texts, for example, the user may click a right mouse button to perform a format setting, which includes a font type, a font size, a font color, and the like, which is not limited in this embodiment.
Similarly, the user may also initiate a deletion instruction for the target default text, and then the stored mapping relationship may be updated based on the specified characters, and it is determined that the format of the target default text is not lost.
As can be seen from the above description, in an embodiment of the present application, a document template may be presented to a user in a preset page, where the preset page includes a first page and a second page overlaid on the first page, and the user may initiate an editing request acting on the second page, so that it may be determined that the editing request is in an editing format or an editing text, and the request for the editing format may be masked, and only the editing text is allowed. By adopting the method, the format is unchanged in the document editing process, and compared with the prior art that the format of the text is not required to be manually adjusted by the user, the document meeting the format specification can be automatically generated by the user only by inputting the target text, so that the document editing efficiency is improved, and the user experience is improved.
Corresponding to the embodiment of the document editing method based on the template, the application also provides an embodiment of a document editing device based on the template.
The embodiment of the document editing device based on the template can be applied to electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 7, the present application is a hardware structure diagram of an electronic device in which a template-based document editing apparatus is located, where, in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, the electronic device in which the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Referring to fig. 8, fig. 8 is a block diagram of a template-based document editing apparatus according to an exemplary embodiment of the present application. The template-based document editing apparatus may be used in the electronic device shown in fig. 7, and includes: a template acquisition unit 800, a presentation unit 810, a receiving unit 820, a text acquisition unit 830, and a replacement unit 840.
The template acquiring unit 800 is configured to, in response to a document editing request, acquire a document template specified by the document editing request, where the document template is provided with a default text;
a presentation unit 810, configured to present the document template in a preset page;
a receiving unit 820, configured to receive, based on the preset page, a text editing request initiated for a target default text, where the target default text is any default text in the document template;
a text obtaining unit 830, configured to obtain a target text in response to the text editing request;
a replacing unit 840, configured to replace the target default text in the document template with the target text, and reserve the format of the target text as the fixed format of the target default text.
Optionally, the preset page includes a template region and an editing region, and the display unit 810 is specifically configured to:
displaying the document template in the template area;
and displaying a text editing box corresponding to each default text in the document template in the editing area so as to input a target text.
Optionally, the preset page includes a first page and a second page, and the display unit 810 is specifically configured to:
generating a first page;
displaying the document template on the first page;
and generating a second page, wherein the second page is a transparent page and is covered on the first page.
Optionally, the receiving unit 820 is specifically configured to:
receiving an editing operation acting on the second page;
determining the default text in the first page at the action position as a target default text based on the action position of the editing operation on the second page;
a text editing request for the target default text is received.
Optionally, after the receiving the editing operation applied to the second page, the receiving unit 820 is further configured to:
and in the case that the text positioned at the action position in the first page is fixed text, shielding the editing operation.
Optionally, when receiving the text editing request for the target default text, the receiving unit 820 is specifically configured to:
setting the mapping area of the target default text on the second page as an editable area; receiving a text editing request for the target default text based on the editable area;
the obtaining of the target text in response to the text editing request includes:
and taking the text input into the editable area as target text.
Optionally, after receiving the text editing request initiated for the target default text based on the preset page, the receiving unit 820 is further configured to:
and shielding the text editing request when the text editing request is used for editing the format.
Optionally, a mapping relationship exists between the default text and its fixed format, and the replacing unit 840 is specifically configured to:
and updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the target text and the fixed format so as to obtain the target text with the fixed format.
Optionally, a domain for the default text is set in the document template, the domain is bound with a fixed format of the default text, and the replacing unit 840 is specifically configured to:
determining a domain corresponding to the target default text;
and updating the value of the domain from the target default text to the target text, and keeping the fixed format of the domain binding unchanged.
Optionally, the replacing unit 840 is further configured to:
and displaying the updated document template in the preset page.
Optionally, after receiving a text editing request initiated for the target default text based on the preset page, the receiving unit 820 is further configured to:
and in the case that the text editing request comprises a deletion instruction aiming at the target default text, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified characters and the fixed format in response to the deletion instruction.
Optionally, the replacing unit 840 is specifically configured to:
determining whether the target default text can be deleted or not based on an add-delete tag preset in the target default text; the add-delete tag is used for identifying the corresponding default text as a deletable and recoverable element;
and if so, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified character and the fixed format.
Optionally, the replacing unit is further configured to:
and in response to a recovery request for the deleted target default text, updating the mapping relationship between the specified characters and the fixed format into the mapping relationship between the target default text and the fixed format.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the embodiment of the template-based document editing method, the present specification further provides a template-based document editing apparatus, including: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
displaying the document template in a preset page;
receiving a text editing request initiated aiming at a target default text based on the preset page, wherein the target default text is any default text in the document template;
responding to the text editing request, and acquiring a target text;
replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text.
Optionally, the preset page includes a template area and an editing area, and when the document template is displayed in the preset page, the processor is caused to:
displaying the document template in the template area;
and displaying a text editing box corresponding to each default text in the document template in the editing area so as to input a target text.
Optionally, the preset page includes a first page and a second page, and when the document template is displayed in the preset page, the processor is caused to:
generating a first page;
displaying the document template on the first page;
and generating a second page, wherein the second page is a transparent page and is covered on the first page.
Optionally, when receiving a text editing request initiated for the target default text based on the preset page, the processor is caused to:
receiving an editing operation acting on the second page;
determining the default text in the first page at the action position as a target default text based on the action position of the editing operation on the second page;
a text editing request for the target default text is received.
Optionally, after the receiving an edit operation on the second page, the processor is further caused to:
and in the case that the text positioned at the action position in the first page is fixed text, shielding the editing operation.
Optionally, upon receiving a text editing request for the target default text, the processor is caused to:
setting the mapping area of the target default text on the second page as an editable area; receiving a text editing request for the target default text based on the editable area;
the obtaining of the target text in response to the text editing request includes:
and taking the text input into the editable area as target text.
Optionally, after receiving a text editing request initiated for the target default text based on the preset page, the processor is further caused to:
and shielding the text editing request when the text editing request is used for editing the format.
Optionally, there is a mapping relationship between the default text and its fixed format, and when the target default text in the document template is replaced by the target text and the format of the target text is retained as the fixed format of the target default text, the processor is caused to:
and updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the target text and the fixed format so as to obtain the target text with the fixed format.
Optionally, a field for the default text is set in the document template, the field is bound with a fixed format of the default text, and when the mapping relationship between the target default text and the fixed format thereof is updated to the mapping relationship between the target text and the fixed format, the processor is caused to:
determining a domain corresponding to the target default text;
and updating the value of the domain from the target default text to the target text, and keeping the fixed format of the domain binding unchanged.
Optionally, after replacing the target default text in the document template with the target text and preserving the format of the target text as the fixed format of the target default text, the processor is further caused to:
and displaying the updated document template in the preset page.
Optionally, after receiving a text editing request initiated for the target default text based on the preset page, the processor is further caused to:
and in the case that the text editing request comprises a deletion instruction aiming at the target default text, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified characters and the fixed format in response to the deletion instruction.
Optionally, when the mapping relationship between the target default text and its fixed format is updated to the mapping relationship between the designated character and the fixed format, the processor is caused to:
determining whether the target default text can be deleted or not based on an add-delete tag preset in the target default text; the add-delete tag is used for identifying the corresponding default text as a deletable and recoverable element;
and if so, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified character and the fixed format.
Optionally, the processor is further caused to:
and in response to a recovery request for the deleted target default text, updating the mapping relationship between the specified characters and the fixed format into the mapping relationship between the target default text and the fixed format.
In correspondence with the foregoing embodiment of the template-based document editing method, the present specification also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of:
responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
displaying the document template in a preset page;
receiving a text editing request initiated aiming at a target default text based on the preset page, wherein the target default text is any default text in the document template;
responding to the text editing request, and acquiring a target text;
replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text.
Optionally, the preset page includes a template area and an editing area, and displaying the document template in the preset page includes:
displaying the document template in the template area;
and displaying a text editing box corresponding to each default text in the document template in the editing area so as to input a target text.
Optionally, the displaying the document template in a preset page includes:
generating a first page;
displaying the document template on the first page;
and generating a second page, wherein the second page is a transparent page and is covered on the first page.
Optionally, the receiving, based on the preset page, a text editing request initiated for the target default text includes:
receiving an editing operation acting on the second page;
determining the default text in the first page at the action position as a target default text based on the action position of the editing operation on the second page;
a text editing request for the target default text is received.
Optionally, after the receiving the editing operation applied to the second page, the method further includes:
and in the case that the text positioned at the action position in the first page is fixed text, shielding the editing operation.
Optionally, the receiving a text editing request for the target default text includes:
setting the mapping area of the target default text on the second page as an editable area; receiving a text editing request for the target default text based on the editable area;
the obtaining of the target text in response to the text editing request includes:
and taking the text input into the editable area as target text.
Optionally, after receiving a text editing request initiated for the target default text based on the preset page, the method further includes:
and shielding the text editing request when the text editing request is used for editing the format.
Optionally, there is a mapping relationship between the default text and its fixed format, and the replacing the target default text in the document template with the target text and preserving the format of the target text as the fixed format of the target default text includes:
and updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the target text and the fixed format so as to obtain the target text with the fixed format.
Optionally, a domain for the default text is set in the document template, the domain is bound with a fixed format of the default text, and the updating of the mapping relationship between the target default text and the fixed format thereof to the mapping relationship between the target text and the fixed format includes:
determining a domain corresponding to the target default text;
and updating the value of the domain from the target default text to the target text, and keeping the fixed format of the domain binding unchanged.
Optionally, after replacing the target default text in the document template with the target text and preserving the format of the target text as the fixed format of the target default text, the method further includes:
and displaying the updated document template in the preset page.
Optionally, after receiving a text editing request initiated for the target default text based on the preset page, the method further includes:
and in the case that the text editing request comprises a deletion instruction aiming at the target default text, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified characters and the fixed format in response to the deletion instruction.
Optionally, the updating the mapping relationship between the target default text and the fixed format thereof to the mapping relationship between the designated character and the fixed format includes:
determining whether the target default text can be deleted or not based on an add-delete tag preset in the target default text; the add-delete tag is used for identifying the corresponding default text as a deletable and recoverable element;
and if so, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified character and the fixed format.
Optionally, the method further includes:
and in response to a recovery request for the deleted target default text, updating the mapping relationship between the specified characters and the fixed format into the mapping relationship between the target default text and the fixed format.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (16)

1. A document editing method based on a template is characterized by comprising the following steps:
responding to a document editing request, and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
displaying the document template in a preset page;
receiving a text editing request initiated aiming at a target default text based on the preset page, wherein the target default text is any default text in the document template;
responding to the text editing request, and acquiring a target text;
replacing the target default text in the document template with the target text, and preserving the format of the target text as the fixed format of the target default text.
2. The method of claim 1, wherein the preset page comprises a template area and an editing area, and the displaying the document template in the preset page comprises:
displaying the document template in the template area;
and displaying a text editing box corresponding to each default text in the document template in the editing area so as to input a target text.
3. The method of claim 1, wherein the preset page comprises a first page and a second page, and wherein the displaying the document template in the preset page comprises:
generating a first page;
displaying the document template on the first page;
and generating a second page, wherein the second page is a transparent page and is covered on the first page.
4. The method of claim 3, wherein receiving a text editing request initiated for target default text based on the pre-set page comprises:
receiving an editing operation acting on the second page;
determining the default text in the first page at the action position as a target default text based on the action position of the editing operation on the second page;
a text editing request for the target default text is received.
5. The method of claim 4, further comprising, after the receiving an editing operation on the second page:
and in the case that the text positioned at the action position in the first page is fixed text, shielding the editing operation.
6. The method of claim 4, wherein receiving a text editing request for the target default text comprises:
setting the mapping area of the target default text on the second page as an editable area; receiving a text editing request for the target default text based on the editable area;
the obtaining of the target text in response to the text editing request includes:
and taking the text input into the editable area as target text.
7. The method of claim 1, after receiving a text editing request initiated for target default text based on the preset page, further comprising:
and shielding the text editing request when the text editing request is used for editing the format.
8. The method of claim 7, wherein a mapping relationship exists between the default text and its fixed format, and wherein replacing the target default text in the document template with the target text and preserving the format of the target text as the fixed format of the target default text comprises:
and updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the target text and the fixed format so as to obtain the target text with the fixed format.
9. The method of claim 8, wherein a field for the default text is set in the document template, the field is bound with a fixed format of the default text, and the updating the mapping relationship between the target default text and the fixed format thereof into the mapping relationship between the target text and the fixed format comprises:
determining a domain corresponding to the target default text;
and updating the value of the domain from the target default text to the target text, and keeping the fixed format of the domain binding unchanged.
10. The method of claim 1, wherein after replacing the target default text in the document template with the target text and preserving the format of the target text as a fixed format of the target default text, the method further comprises:
and displaying the updated document template in the preset page.
11. The method of claim 1, wherein after receiving a text editing request initiated for target default text based on the pre-defined page, the method further comprises:
and in the case that the text editing request comprises a deletion instruction aiming at the target default text, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified characters and the fixed format in response to the deletion instruction.
12. The method of claim 11, wherein updating the mapping relationship between the target default text and its fixed format to the mapping relationship between the specified character and the fixed format comprises:
determining whether the target default text can be deleted or not based on an add-delete tag preset in the target default text; the add-delete tag is used for identifying the corresponding default text as a deletable and recoverable element;
and if so, updating the mapping relation between the target default text and the fixed format thereof into the mapping relation between the specified character and the fixed format.
13. The method according to claim 11 or 12, characterized in that the method further comprises:
and in response to a recovery request for the deleted target default text, updating the mapping relationship between the specified characters and the fixed format into the mapping relationship between the target default text and the fixed format.
14. An apparatus for template-based document editing, the apparatus comprising:
the template acquiring unit is used for responding to a document editing request and acquiring a document template specified by the document editing request, wherein default texts are set in the document template;
the display unit is used for displaying the document template in a preset page;
a receiving unit, configured to receive, based on the preset page, a text editing request initiated for a target default text, where the target default text is any default text in the document template;
a text acquisition unit configured to acquire a target text in response to the text editing request;
and the replacing unit is used for replacing the target default text in the document template with the target text and reserving the format of the target text as the fixed format of the target default text.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 13.
16. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 1 to 13 are performed when the program is executed by the processor.
CN202110808651.3A 2021-07-16 2021-07-16 Template-based document editing method and device Pending CN113642304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110808651.3A CN113642304A (en) 2021-07-16 2021-07-16 Template-based document editing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110808651.3A CN113642304A (en) 2021-07-16 2021-07-16 Template-based document editing method and device

Publications (1)

Publication Number Publication Date
CN113642304A true CN113642304A (en) 2021-11-12

Family

ID=78417624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110808651.3A Pending CN113642304A (en) 2021-07-16 2021-07-16 Template-based document editing method and device

Country Status (1)

Country Link
CN (1) CN113642304A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114995699A (en) * 2022-06-17 2022-09-02 拉扎斯网络科技(上海)有限公司 Interface interaction method and device
CN115688733A (en) * 2022-12-29 2023-02-03 南方电网科学研究院有限责任公司 Method and system for writing standard document

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114995699A (en) * 2022-06-17 2022-09-02 拉扎斯网络科技(上海)有限公司 Interface interaction method and device
CN114995699B (en) * 2022-06-17 2024-02-27 拉扎斯网络科技(上海)有限公司 Interface interaction method and device
CN115688733A (en) * 2022-12-29 2023-02-03 南方电网科学研究院有限责任公司 Method and system for writing standard document

Similar Documents

Publication Publication Date Title
US11709823B2 (en) Real time visual validation of digital content using a distributed ledger
US9280544B2 (en) Methods, systems, and computer program products for automatically associating data with a resource as metadata based on a characteristic of the resource
US10742844B2 (en) Hiding sensitive data
CN113642304A (en) Template-based document editing method and device
US20150026549A1 (en) Method and system for copying and pasting webpage content, and computer storage medium
EP2319008A2 (en) Tagging images with labels
US20150121196A1 (en) Browser-based image processing
CN107408242B (en) Providing interactive previews of content within communications
US20170011483A1 (en) System and method for electronic signature creation and application
US20220345498A1 (en) Shared image sanitization method and system
WO2020114280A1 (en) Notebook page processing method for notebook, computer device and storage medium
CN113076731A (en) Report file generation method and device, computer equipment and storage medium
EP3816838A1 (en) Stored image privacy violation detection method and system
US10133639B2 (en) Privacy protection of media files for automatic cloud backup systems
CN110543450A (en) Electronic document generation method and device, computer equipment and storage medium
US20170228292A1 (en) Privacy Protection of Media Files For Automatic Cloud Backup Systems
CN111784326B (en) Picture processing method and device and computer equipment
US10846328B2 (en) Digital asset association with search query data
CA2934963A1 (en) Document and object manipulation
US11972025B2 (en) Stored image privacy violation detection method and system
KR101458155B1 (en) Apparatus and method for generating edited document
JP2019095858A (en) Slip image processing device, slip image processing system, slip image processing method, and program
EP4027674A1 (en) Method and apparatus for document processing
US20170046027A1 (en) Electronic document management device, electronic document management system, and electronic document management program
JP7011912B2 (en) Document processing system, processing system and document processing program

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