Method, device and electronic equipment for processing document element content in document template

By generating control panels and controls, users can edit or delete official document elements in official document templates, solving the problem that official document templates do not support editing in the prior art, and improving the convenience and efficiency of official document writing.

CN114065721BActive Publication Date: 2025-08-22ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111401189.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-08-22
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

The existing official document templates do not support users to edit the default content of official document elements, which makes it inconvenient for users to write official document documents.

Method used

Provides a method and device for processing official document elements in official document templates. By generating a control panel, including controls and add-and-deletion buttons, users can edit or delete official document elements, and enter content in the control to adjust the content of official document elements.

Benefits of technology

It provides users with the ability to conveniently edit official document elements in official document templates, and improves the efficiency of writing official document documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065721B_ABST
    Figure CN114065721B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, electronic device and storage medium for processing the content of official document elements in an official document template. The method includes: obtaining the official document template when a document template editing instruction issued by a user is obtained; generating a control panel corresponding to the official document template according to the type and content of each official document element in the official document template, and displaying the official document template and the control panel, wherein the control panel includes controls for editing the official document elements in the official document template and add and delete buttons corresponding to the official document elements; when a delete instruction for a first target official document element issued by the user based on the add and delete buttons is obtained, replacing the first target official document element with a preset hidden character; obtaining the content input by the user in the control corresponding to a second target official document element, and adjusting the second target official document element based on the input content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic document processing, and in particular to a method, device and electronic equipment for processing document element content in an official document template. Background Art

[0002] When users write official documents, they often need to process document elements such as the copy number, confidentiality level, confidentiality period, urgency, issuing authority logo, and degree of urgency. Official documents are official documents, which are written materials produced and used by statutory agencies and organizations in their official activities, following a specific format and processing procedures.

[0003] Currently, users can compose official documents using pre-set document templates. Specifically, a document template includes multiple pre-set document elements, which users can edit within the opened template to compose the document. The pre-set document elements are default contents. If the default contents do not meet user requirements, users will need to edit the document elements to create a document that meets their needs.

[0004] However, since official document templates generally do not support users to edit the default contents of the official document elements therein, users are often unable to edit the official document elements in the official document templates, which brings a lot of inconvenience to users when using official document templates to write official documents. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a method, device, and electronic device for processing the content of official document elements in an official document template, so as to enable users to edit the official document elements in the official document template, thereby providing convenience for users to write official documents using the official document template. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a method for processing document element content in a document template, the method comprising:

[0007] When obtaining a document template editing instruction issued by a user, obtaining the document template;

[0008] Generating a control panel corresponding to the document template according to the type and content of each document element in the document template, and displaying the document template and the control panel, wherein the control panel includes controls for editing the document elements in the document template and add / delete buttons corresponding to the document elements;

[0009] When a deletion instruction for a first target document element is obtained from the user based on the add / delete button, the first target document element is replaced with a preset hidden character;

[0010] The content input by the user in the control corresponding to the second target document element is obtained, and the second target document element is adjusted based on the input content.

[0011] Optionally, the step of generating a control panel corresponding to the document template according to the type and content of each document element in the document template includes:

[0012] Reading a label of each document element in the document template, wherein the label is used to record the type and content of the corresponding document element, the type including text type and non-text type;

[0013] For each official document element, if the type of the official document element is a text type, generating a first control corresponding to the official document element, wherein the first control includes a text box for inputting the content of the official document element;

[0014] For each official document element, if the type of the official document element is a non-text type, generating a second control corresponding to the official document element, wherein the second control includes an input box for editing the attributes of the official document element;

[0015] A control panel including add / delete buttons and controls corresponding to each document element is generated, wherein the control is the first control or the second control.

[0016] Optionally, the second target document element is of text type, and the control panel includes a first control corresponding to the second target document element;

[0017] The step of obtaining content input by the user in a control corresponding to the second target document element and adjusting the second target document element based on the input content includes:

[0018] Obtaining the content entered by the user in the text box of the first control;

[0019] The input content is assigned to a field corresponding to the second target document element, so as to replace the content of the second target document element with the input content.

[0020] Optionally, the second target document element is of a non-text type, and the control panel includes a second control corresponding to the second target document element;

[0021] The step of obtaining content input by the user in a control corresponding to the second target document element and adjusting the second target document element based on the input content includes:

[0022] Obtaining the content input by the user in the input box of the second control;

[0023] The application program interface corresponding to the second target document element is called, so that the application program interface uses the input content as an attribute of the second target document element and draws the second target document element with the attribute.

[0024] Optionally, the method further includes:

[0025] For each document element in the document template, recording the content input by the user for the document element as editing content;

[0026] When a restoration instruction for the first target document element issued by the user based on the add / delete button is obtained, the content of the first target document element is replaced by the edited content corresponding to the first target document element from the preset hidden characters.

[0027] Optionally, before the step of replacing the content of the first target official document element with the preset hidden characters and the edited content corresponding to the first target official document element, the method further includes:

[0028] Displaying prompt information and receiving a selection instruction issued by the user based on the prompt information;

[0029] When the selection instruction indicates to restore the first target document element to edited content, performing the step of replacing the content of the first target document element with the edited content corresponding to the first target document element from the preset hidden characters;

[0030] When the selection instruction indicates to restore the first target official document element to the default content, the content of the first target official document element is replaced by the default content corresponding to the first target official document element from the preset hidden characters.

[0031] Optionally, the content input by the user for the official document element includes multiple historical contents input by the user;

[0032] The step of replacing the content of the first target document element with the preset hidden characters and the edited content corresponding to the first target document element when a restoration instruction for the first target document element issued by the user based on the add / delete button is obtained includes:

[0033] When a restore instruction for the first target document element issued by the user based on the add / delete button is obtained, the plurality of historical contents are displayed;

[0034] selecting, according to a selection operation issued by a user on the plurality of historical contents, a historical content from the plurality of historical contents as edited content;

[0035] The content of the first target document element is replaced by the edited content from the preset hidden characters.

[0036] Optionally, for each document element in the document template, recording the content input by the user for the document element as a step of editing the content includes:

[0037] For each document element in the document template, obtaining content input by the user for the document element;

[0038] A target variable corresponding to the official document element is created, and the input content is assigned to the target variable as the editing content corresponding to the official document element.

[0039] Optionally, for each document element in the document template, recording the content input by the user for the document element as a step of editing the content includes:

[0040] For each document element in the document template, obtaining content input by the user for the document element;

[0041] The input content is stored in a preset database as the editing content corresponding to the official document element.

[0042] In a second aspect, an embodiment of the present invention provides a device for processing document element content in a document template, the device comprising:

[0043] The template acquisition module is used to acquire the document template when acquiring the document template editing instruction issued by the user;

[0044] a control panel generation module, configured to generate a control panel corresponding to the document template based on the type and content of each document element in the document template, and to display the document template and the control panel, wherein the control panel includes controls for editing document elements in the document template and add / delete buttons corresponding to the document elements;

[0045] a deletion module, configured to replace the first target document element with a preset hidden character upon receiving a deletion instruction issued by the user based on the add / delete button for the first target document element;

[0046] The editing module is configured to obtain content input by the user in a control corresponding to a second target document element, and adjust the second target document element based on the input content.

[0047] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0048] Memory for storing computer programs;

[0049] The processor is used to implement the steps of the method for processing the content of the official document elements in any of the official document templates described above when executing the program stored in the memory.

[0050] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing the content of the official document elements in any of the above-mentioned official document templates are implemented.

[0051] In the solution provided by an embodiment of the present invention, an electronic device can obtain a document template when obtaining a document template editing instruction issued by a user; generate a control panel corresponding to the document template according to the type and content of each document element in the document template, and display the document template and the control panel, wherein the control panel includes controls for editing the document elements in the document template and add and delete buttons corresponding to the document elements; when obtaining a delete instruction for a first target document element issued by the user based on the add and delete buttons, the first target document element is replaced with a preset hidden character; obtain the content input by the user in the control corresponding to the second target document element, and adjust the second target document element based on the input content. Different official document templates usually include different official document elements. The electronic device can generate a control panel corresponding to the official document template based on the type and content of the official document elements in the obtained official document template. In this way, different control panels can be displayed when the user opens different official document templates. The user can issue a delete instruction for the first target official document element based on the add and delete button to delete the official document element in the official document template, and can also enter content in the control corresponding to the second target official document element in the control panel to modify the content of the second target official document element. This can facilitate users to edit the content of official document elements in the official document template, provide convenience for users to use official document templates to write official documents, and improve the efficiency of users in processing official documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 A flowchart of a method for processing document element content in a document template provided by an embodiment of the present invention;

[0054] Figure 2 for Figure 1A specific flow chart of step S102 in the embodiment shown;

[0055] Figure 3 A schematic diagram of a control panel in an embodiment of the present invention;

[0056] Figure 4 This is a first flow chart of a method for recovering the first target document element in an embodiment of the present invention;

[0057] Figure 5 This is a second flow chart of a method for recovering the first target document element in an embodiment of the present invention;

[0058] Figure 6 This is a third flow chart of a method for recovering the first target document element in an embodiment of the present invention;

[0059] Figure 7 A schematic diagram of the structure of a device for processing document element content in a document template provided by an embodiment of the present invention;

[0060] Figure 8 for Figure 7 A schematic diagram of a specific structure of the control panel generation module 702 in the embodiment shown;

[0061] Figure 9 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0062] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the present invention are within the scope of protection of the present invention.

[0063] In order to enable users to edit official document elements in official document templates and provide convenience for users to use official document templates to compose official documents, embodiments of the present invention provide a method, device, electronic device, computer-readable storage medium and computer program product for processing official document elements in official document templates.

[0064] The following first introduces a method for processing document elements in a document template provided by an embodiment of the present invention. The method for processing document elements in a document template provided by an embodiment of the present invention can be applied to any electronic device that needs to process a document template, for example, a computer, a processor, a server, etc., without specific limitation herein. For clarity of description, it will be referred to as an electronic device.

[0065] like Figure 1 As shown, a method for processing document elements in a document template includes:

[0066] S101, when obtaining a document template editing instruction issued by a user, obtaining the document template;

[0067] S102, generating a control panel corresponding to the document template according to the type and content of each document element in the document template, and displaying the document template and the control panel;

[0068] The control panel includes controls for editing the document elements in the document template and add / delete buttons corresponding to the document elements.

[0069] S103, when a deletion instruction for a first target document element issued by the user based on the add / delete button is obtained, replacing the first target document element with a preset hidden character;

[0070] S104: Acquire the content input by the user in the control corresponding to the second target document element, and adjust the second target document element based on the input content.

[0071] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can obtain the official document template when obtaining the official document template editing instruction issued by the user; generate a control panel corresponding to the official document template according to the type and content of each official document element in the official document template, and display the official document template and the control panel, wherein the control panel includes controls for editing the official document elements in the official document template and add and delete buttons corresponding to the official document elements; when obtaining the deletion instruction for the first target official document element issued by the user based on the add and delete buttons, the first target official document element is replaced with a preset hidden character; obtain the content input by the user in the control corresponding to the second target official document element, and adjust the second target official document element based on the input content. Different official document templates usually include different official document elements. The electronic device can generate a control panel corresponding to the official document template based on the type and content of the official document elements in the obtained official document template. In this way, different control panels can be displayed when the user opens different official document templates. The user can issue a delete instruction for the first target official document element based on the add and delete button to delete the official document element in the official document template, and can also enter content in the control corresponding to the second target official document element in the control panel to modify the content of the second target official document element. This can facilitate users to edit the content of official document elements in the official document template, provide convenience for users to use official document templates to write official documents, and improve the efficiency of users in processing official documents.

[0072] When a user uses a preset official document template to compose an official document, the content of the preset official document elements in the official document template is the default content and may not meet the user's needs. In this case, the user can issue an official document template editing instruction, and the electronic device can obtain the official document template editing instruction issued by the user, thereby obtaining the official document template targeted by the official document template editing instruction, that is, executing the above step S101.

[0073] Among them, the electronic device can pre-set the method of issuing official document template editing instructions, and the user can issue official document template editing instructions according to the pre-set issuance method. The pre-set method of issuing official document template editing instructions can be double-clicking the official document template, right-clicking the official document template, opening the official document template first and then clicking a pre-set editing button, etc., which is not specifically limited here.

[0074] The above-mentioned official document template can be one of the pre-generated official document templates. In the process of generating these official document templates, various types of official document elements can be added to the official document template, and then the attributes, position and content of each official document element can be set according to the national standard requirements. In this way, the format, position and content of each official document element included in the official document template all comply with the national standard requirements.

[0075] The elements of an official document may include the copy number, confidentiality level, confidentiality period, degree of urgency, issuing agency logo, document number, issuer, title, main recipient agency, main text, attachment description, signature of the issuing agency, date of writing, seal, notes, attachments, copy recipient agency, printing and issuing agency, date of printing and issuing, page numbers, letter lines, etc.

[0076] After obtaining the official document template, in order to facilitate users to edit the official document elements in the official document template, in the above step S102, the electronic device can generate a control panel corresponding to the official document template according to the type and content of each official document element in the official document template, and display the official document template and the control panel.

[0077] Official document templates usually include multiple types of official document elements, and the contents of different types of official document elements are often different. Therefore, for each type of official document element, in order to facilitate users to edit the official document elements in the official document template, the controls used to edit this type of official document element can also be different.

[0078] Specifically, the electronic device can generate a control panel corresponding to the official document template based on the type and content of each official document element in the official document template. The control panel may include controls for editing the official document elements in the official document template and add or delete buttons corresponding to the official document elements. In this way, the user can edit the corresponding official document elements through the controls in the control panel, and can delete or add the corresponding official document elements by clicking the add or delete buttons corresponding to the official document elements in the control panel.

[0079] For example, official document template A includes official document element a, official document element b and official document element c. When the user issues an official document template editing instruction for official document template A, the electronic device can obtain official document template A, and then the electronic device can generate a control panel corresponding to official document template A based on the type and content of official document elements a, official document element b and official document element c included in official document template A. The control panel includes controls for editing official document element a, controls for editing official document element b, controls for editing official document element c, and also includes add and delete buttons corresponding to official document element a, add and delete buttons corresponding to official document element b, and add and delete buttons corresponding to official document element c.

[0080] For another example, document template B includes document element a, document element b, and document element d. When a user issues a document template editing instruction for document template B, the electronic device can obtain document template B. Then, the electronic device can generate a control panel corresponding to document template B based on the type and content of document element a, document element b, and document element d included in document template B. The control panel includes controls for editing document element a, controls for editing document element b, and controls for editing document element d, as well as add / delete buttons corresponding to document element a, add / delete buttons corresponding to document element b, and add / delete buttons corresponding to document element d. In other words, when the document elements included in the document template obtained by the electronic device are different, the control panel generated by the electronic device is also different.

[0081] The default format (attributes) of the official document elements in the official document template usually conforms to the national standard. In one embodiment, the above-mentioned control for editing the official document elements in the official document template only has the authority to edit the content of the official document elements, and does not have the authority to edit the format (attributes) of the official document elements, that is, the control for editing the official document elements in the official document template only has partial editing authority for the official document elements. For example, for text-type official document elements, the control for editing the official document element only has the authority to edit the text content of the official document element, and does not have the authority to edit the text format of the official document element. Through the above-mentioned method, it is possible to prohibit users from directly editing the format of the official document elements in the official document template, and avoid the situation where the user edits the default format of the official document elements in the official document template, resulting in the edited official document elements not meeting the national standard requirements.

[0082] When the user wants to delete the first target document element in the document template, the user can issue a deletion instruction for the first target document element based on the add / delete button in the control panel, so that the electronic device can execute the above step S103, that is, replace the first target document element with a preset hidden character, so that the first target element will no longer be displayed in the document template.

[0083] Among them, the first target document element is the document element that the user wants to delete in the document template, and the preset hidden characters are pre-set characters that are not displayed in the document template, for example, they can be characters such as spaces with a horizontal width of 0.

[0084] The specific method for the user to issue a delete instruction for the first target document element can be to left-click the add / delete button for the first target document element in the control panel, double-click the add / delete button for the first target document element in the control panel, right-click the add / delete button for the first target document element in the control panel, etc., which are not specifically limited here. In this way, the user can issue a delete instruction for the first target document element based on the add / delete button to delete the document element in the document template, thereby providing convenience for the user to delete the document element in the document template.

[0085] When the user wants to edit the second target document element in the document template, the user can enter the corresponding content in the control corresponding to the second target document element in the control panel, so that the electronic device can execute the above step S104, that is, obtain the content entered by the user in the control corresponding to the second target document element, and then adjust the second target document element based on the content entered by the user.

[0086] The second target document element is the document element in the document template that the user wants to edit, and the content input by the user in the control corresponding to the second target document element is the content that the user wants to adjust for the second target document element.

[0087] For example, the second target document element is the issuance date, and its default content is "x year x month x day". When the user wants to adjust the issuance date to "January 1, 2021", the user can enter "January 1, 2021" in the control corresponding to the issuance date. In this way, the electronic device can adjust the content of the issuance date from "x year x month x day" to "January 1, 2021".

[0088] For another example, the second target document element is a letter line, and its default content is "width 0.1mm", which means that the width of the letter line is 0.1 mm. When the user wants to adjust the width of the letter line to 0.5 mm, he can enter "width 0.5mm" in the control corresponding to the letter line, indicating that the width of the letter line is adjusted to 0.5 mm. Then, when the electronic device receives the user input "width 0.5mm", it can adjust the width of the letter line from 0.1 mm to 0.5 mm.

[0089] In this way, the user can enter content in the control corresponding to the second target document element in the control panel to modify the content of the second target document element, thereby making it convenient for the user to edit the content of the document element in the document template, providing convenience for the user to use the document template to write document documents, and also improving the efficiency of the user in processing document documents.

[0090] As an implementation method of the embodiment of the present invention, Figure 2 As shown, the step of generating a control panel corresponding to the document template according to the type and content of each document element in the document template may include:

[0091] S201, reading the label of each document element in the document template;

[0092] After the electronic device obtains the official document template, in order to facilitate the generation of the control panel corresponding to the official document template, the electronic device can read the label of each official document element in the official document template, wherein each official document element in the official document template has a corresponding label, which can be a pre-set label for recording the type and content of the corresponding official document element. Of course, the label can also record the name, logo, etc. of the corresponding official document element, which is not specifically limited here.

[0093] The types of the above-mentioned official document elements can include text type and non-text type. When the official document element is a character, the type of the official document element is a text type; when the official document element is not a character, for example, when the official document element is a graphic object such as a letter, seal, etc., the type of the official document element is a non-text type. When the official document element is a text-type official document element, the content of the official document element is also a character; when the official document element is a non-text-type official document element, the content of the official document element can be an attribute of the official document element. For example, when the official document element is a letter, the attributes of the official document element can be the width, length, color, etc. of the letter; when the official document element is a seal, the attributes of the official document element can be the size, color, etc. of the seal.

[0094] In one embodiment, the document template may be an XML (Extensible Markup Language) formatted file that complies with the OOXML (Office Open Extensible Markup Language) standard, and the tags for each document element in the document template may be OOXML tags. Because the document template complies with the OOXML standard, which is an international document format standard, users can directly open the document template for processing using office software installed on electronic devices, such as Microsoft Word and WPS, without having to convert the document template from XML format to a format such as .doc or .docx and then open it in office software for subsequent processing.

[0095] S202: For each official document element, if the type of the official document element is text, generate a first control corresponding to the official document element;

[0096] For each official document element, when the electronic device determines that the type of the official document element is a text type based on the label of the official document element, the electronic device can generate a first control corresponding to the official document element, wherein the first control includes a text box for entering the content of the official document element. In this way, when the user needs to edit the official document element of the text type, he can enter the content in the text box in the first control of the official document element to edit the official document element.

[0097] S203, for each document element, if the type of the document element is a non-text type, generating a second control corresponding to the document element;

[0098] For each official document element, when the electronic device determines that the type of the official document element is a non-text type based on the label of the official document element, the electronic device can generate a second control corresponding to the official document element, wherein the second control includes an input box for editing the attributes of the official document element. In this way, when the user needs to edit the non-text type official document element, he can enter content in the input box in the second control of the official document element to edit the attributes of the official document element.

[0099] S204: Generate a control panel including add / delete buttons and controls corresponding to each document element.

[0100] After generating the control corresponding to each document element, the electronic device can also generate a control panel corresponding to each document element including add and delete buttons and controls. The control is the above-mentioned first control or the above-mentioned second control, which is specifically determined by the type of the document element.

[0101] For example, the official document template C includes official document elements c1, official document element c2 and official document element c3. Official document elements c1 and c2 are text-type official document elements, and official document element c3 is a non-text-type official document element. Then the electronic device can generate a first control corresponding to official document element c1, a first control corresponding to official document element c2 and a second control corresponding to official document element c3, and then generate a control panel corresponding to the official document template C. The control panel includes the first control corresponding to official document element c1, the first control corresponding to official document element c2 and the second control corresponding to official document element c3, and also includes an add or delete button corresponding to official document element c1, an add or delete button corresponding to official document element c2 and an add or delete button corresponding to official document element c3.

[0102] Since the characters of certain text types of official document elements in the official document template are fixed according to national standards and do not need to be edited by the user, in one embodiment, for official document elements in the official document template that do not require user editing, only the corresponding add or delete buttons may be displayed, and the first control corresponding to the official document element may not include a text box.

[0103] Figure 3 FIG. 1 is a schematic diagram of a control panel in an embodiment of the present invention. Figure 3 As shown, the official document elements in the official document template include the issuing agency logo, document number, issuer, header dividing line, text title, main recipient agency and other official document elements. Among them, the issuing agency logo, document number, issuer, text title, and main recipient agency are text-type official document elements, the text title and main recipient agency do not require user editing content, and the header dividing line is a non-text-type official document element.

[0104] In this case, the control panel generated by the electronic device may include a first control 301 corresponding to the issuing agency logo, a first control 302 corresponding to the document number, a first control 303 corresponding to the issuer, a second control 304 corresponding to the header dividing line, a first control 305 corresponding to the text title, and a first control 306 corresponding to the main sending agency.

[0105] Among them, the first control 301, the first control 302 and the first control 303 include text boxes 307, text boxes 308 and text boxes 309 respectively, the second control 304 includes an input box 310 corresponding to the line type and an input box 311 corresponding to the color of the header dividing line style, an input box 312 corresponding to the length of the header dividing line and an input box 313 corresponding to the thickness of the header dividing line, the first control 301 also includes an add or delete button 314 corresponding to the issuing agency logo, the first control 302 also includes an add or delete button 315 corresponding to the document number, the first control 303 also includes an add or delete button 316 corresponding to the issuer, the second control 304 also includes an add or delete button 317 corresponding to the header dividing line, the first control 305 also includes an add or delete button 318 corresponding to the text title, and the first control 306 also includes an add or delete button 319 corresponding to the main sending agency.

[0106] The first control 301 also includes an add button 320, a subtract button 321, and a check box 322. When the user clicks the add button 320, an issuing authority mark can be added, and when the user clicks the subtract button 321, an issuing authority mark can be subtracted. When the user checks the check box 322, the word "document" can be displayed after the issuing authority mark. When the user does not check the check box 322, the word "document" can be not displayed after the issuing authority mark. The first control 303 also includes an add button 323 and a subtract button 324. When the user clicks the add button 323, an issuer can be added, and when the user clicks the subtract button 324, an issuer can be subtracted.

[0107] In this way, the electronic device can generate a control panel corresponding to the official document template and display the control panel when the user edits the elements in the official document template. The user can then enter content in the controls displayed in the control panel to edit the official document elements. The user can also delete the official document elements by issuing delete instructions based on the add and delete buttons displayed in the control panel, thereby providing convenience for the user to edit the official document elements in the official document template.

[0108] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can read the label of each official document element in the official document template, and for each official document element, if the type of the official document element is a text type, generate a first control corresponding to the official document element, and if the type of the official document element is a non-text type, generate a second control corresponding to the official document element, and then generate a control panel including add and delete buttons and controls corresponding to each official document element. In this way, a corresponding control panel can be generated for the official document template, and the user can edit the official document element through the first control, second control and add and delete buttons displayed in the control panel, thereby providing convenience for the user to edit the official document elements in the official document template.

[0109] As an implementation manner of an embodiment of the present invention, when the second target document element is of text type, the control panel may include a first control corresponding to the second target document element.

[0110] In this case, the step of obtaining the content input by the user in the control corresponding to the second target document element and adjusting the second target document element based on the input content may include:

[0111] The content input by the user in the text box of the first control is obtained; the input content is assigned to the field corresponding to the second target document element to replace the content of the second target document element with the input content.

[0112] When the second target document element that the user wants to edit is a text-type document element, the control panel displayed by the electronic device may include a first control corresponding to the second target document element. The user can then enter content in the text box of the first control, and the electronic device can then obtain the content entered by the user in the text box of the first control. The content entered by the user in the text box of the first control is the content that the user wants to modify in the second target document element.

[0113] For text-type document elements in an official document template whose content can be edited, the label of the document element may also record the domain of the document element. The value of the domain is the content of the document element, that is, the characters in the document element. When a user enters content in the text box of the first control corresponding to the second target document element, the electronic device can search the label of the second target document element for the domain corresponding to the second target document element and then assign the user-entered content to the domain corresponding to the second target document element. In this way, the value of the domain corresponding to the second target document element is modified to the content entered by the user, thereby replacing the content of the second target document element with the user-entered content.

[0114] like Figure 3 As shown, the electronic device can display a control panel, which includes a first control 301 corresponding to the issuing agency logo. The text box 307 in the first control 301 displays "Issuing Agency 1", indicating that the default content corresponding to the issuing agency logo is "Issuing Agency 1". When the second target document element that the user wants to edit is the issuing agency logo, the user can click on the text box 307 and enter content in the text box 307. If the content entered by the user is "Issuing Agency XX", the electronic device can obtain the "Issuing Agency XX" entered by the user and assign "Issuing Agency XX" to the field corresponding to the issuing agency logo. In this way, the field corresponding to the issuing agency logo is replaced from "Issuing Agency 1" to "Issuing Agency XX". In this way, the issuing agency logo displayed in the document template is changed to "Issuing Agency XX".

[0115] In one embodiment, when the user clicks on the text box 307, the electronic device can automatically delete the content in the text box 307 and then the user can enter the content again; in another embodiment, when the user clicks on the text box 307, the user can manually delete the content in the text box 307 and then enter the content, which is both reasonable.

[0116] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can obtain the content entered by the user in the text box of the first control; assign the input content to the field corresponding to the second target official document element to replace the content of the second target official document element with the input content, thereby realizing the replacement of the content of the second target official document element of text type with the content entered by the user.

[0117] As an implementation manner of an embodiment of the present invention, the second target document element may be of a non-text type, and the control panel may include a second control corresponding to the second target document element.

[0118] In this case, the step of obtaining the content input by the user in the control corresponding to the second target document element and adjusting the second target document element based on the input content may include:

[0119] Obtain the content entered by the user in the input box of the second control; call the application program interface corresponding to the second target document element so that the application program interface uses the input content as the attribute of the second target document element and draws the second target document element with the attribute.

[0120] When the second target document element that the user wants to edit is a non-text document element, the control panel displayed by the electronic device may include a second control corresponding to the second target document element. The user can then enter content in the input box of the second control, and the electronic device can then obtain the content entered by the user in the input box of the second control. The content entered by the user in the input box of the second control is the attribute parameter that the user wants to modify for the second target document element.

[0121] For non-text document elements whose attributes can be edited in the document template, the label of the document element can also record the application programming interface (API) used to edit the document element. When the user enters content in the text box of the second control corresponding to the second target document element, the electronic device can search for the application programming interface corresponding to the second target document element in the label of the second target document element, and then call the application programming interface corresponding to the second target document element. The application programming interface corresponding to the second target document element can use the input content as the attribute of the second target document element, that is, the input content is the attribute parameter of the second target document element entered by the user. In this way, the attribute of the second target document element is modified to the content entered by the user, and the application programming interface corresponding to the second target document element can also draw the second target document element with the attribute.

[0122] like Figure 3 As shown, the electronic device can display a control panel, which includes a second control 304 corresponding to the header dividing line, and the second control 304 includes an input box 310, an input box 311, an input box 312 and an input box 313. When the second target document element that the user wants to edit is the header dividing line, the user can edit the line type, color, length and thickness of the header dividing line. When the user wants to edit the line type of the header dividing line, the user can click the drop-down arrow in the input box 310, and the electronic device can display multiple alternative line types. The user can select the required line type from the multiple alternative line types displayed as the input content. In this way, the electronic device can call the application interface corresponding to the header dividing line, and the application interface can use the line type selected by the user as the line type of the header dividing line, and draw the header dividing line with the line type selected by the user.

[0123] When the user wants to edit the color of the header dividing line, the user can click the drop-down arrow in the input box 311, and the electronic device can display multiple alternative colors. The user can select an alternative color from the displayed multiple alternative colors as input content. In this way, the electronic device can call the application program interface corresponding to the header dividing line, and the application program interface can use the user-selected color as the color of the header dividing line and draw the header dividing line with the user-selected color.

[0124] When the user wants to edit the length of the header dividing line, the user can enter a length value in the input box 312. In this way, the electronic device can call the application interface corresponding to the header dividing line. The application interface can also use the length corresponding to the value entered by the user as the length of the header dividing line, and draw a header dividing line with the length corresponding to the value entered by the user.

[0125] For example, if the length value entered by the user in the input box 312 is 155 mm, the application interface can use 155 mm as the length of the header dividing line and draw a 155 mm header dividing line, that is, the length of the header dividing line is modified to 155 mm. The user can directly enter the length value in the input box 312. The electronic device can also set an increase button and a decrease button in the input box 312. The default length value of the header dividing line can be displayed in the input box 312. When the user clicks the increase button once, the default length value in the input box 312 can be increased by a first preset value. When the user clicks the decrease button once, the default length value in the input box 312 can be reduced by a first preset value. The first preset value can be 0.1 mm, 0.5 mm, 1.0 mm, etc., which is not specifically limited here.

[0126] For example, if the first preset value is 1.0 mm and the default length value in input box 312 is 150 mm, when the user clicks the increase button twice, the default length value in input box 312 can be increased by 2.0 mm to 152 mm, and 152 mm is what the user entered in input box 312. For another example, if the first preset value is 0.5 mm and the default length value in input box 312 is 160 mm, when the user clicks the decrease button twice, the default length value in input box 312 can be decreased by 1.0 mm to 159 mm, and 159 mm is what the user entered in input box 312.

[0127] When the user wants to edit the thickness of the header dividing line, the user can enter the thickness value in the input box 313. In this way, the electronic device can call the application interface corresponding to the header dividing line. The application interface can use the thickness corresponding to the thickness value entered by the user as the thickness of the header dividing line, and draw a header dividing line with the thickness corresponding to the thickness value entered by the user.

[0128] For example, if the thickness value entered by the user in the input box 313 is 1 mm, the application interface can use 1 mm as the thickness of the header dividing line and draw a header dividing line with a thickness of 1 mm, that is, the thickness of the header dividing line is modified to 1 mm. The user can directly enter the thickness value in the input box 313; the electronic device can also set an increase button and a decrease button in the input box 313, and the input box 313 can display the default thickness value of the header dividing line. When the user clicks the increase button once, the default thickness value in the input box 313 can be increased by a second preset value. When the user clicks the decrease button once, the default thickness value in the input box 313 can be reduced by a second preset value, wherein the second preset value can be 0.1 mm, 0.05 mm, etc., which is not specifically limited here.

[0129] For example, if the second preset value is 0.1 mm and the default thickness value in the input box 313 is 0.5 mm, when the user clicks the increase button twice, the default thickness value in the input box 313 can be increased by 0.2 mm to 0.7 mm, and 0.7 mm is what the user entered in the input box 313. For another example, if the second preset value is 0.05 mm and the default thickness value in the input box 313 is 0.5 mm, when the user clicks the decrease button twice, the default thickness value in the input box 313 can be decreased by 0.1 mm to 0.4 mm, and 0.4 mm is what the user entered in the input box 313.

[0130] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can obtain the content input by the user in the input box of the second control; call the application interface corresponding to the second target official document element, so that the application interface uses the input content as the attribute of the second target official document element, and draws the second target official document element with the attribute, thereby replacing the content of the non-text type second target official document element with the content input by the user.

[0131] As an implementation method of the embodiment of the present invention, Figure 4 As shown, the above method may further include:

[0132] S401, for each document element in the document template, recording the content input by the user for the document element as edited content;

[0133] To facilitate users deleting document elements and then restoring their content to the user-entered content, the electronic device can record the user-entered content when it obtains the content entered by the user when editing a document element in a document template. Specifically, for each document element in the document template, the electronic device can record the user-entered content for that document element as the edited content for that document element. This allows the electronic device to establish a correspondence between the document element and the edited content.

[0134] For example, if the document template d includes document elements d1, d2, and d3, and the user inputs n1 for document element d1, n2 for document element d2, and n3 for document element d3, the electronic device can record the user inputs for document elements d1, d2, and d3, resulting in the following correspondence:

[0135]

[0136]

[0137] S402: When a restoration instruction for the first target document element issued by the user based on the add / delete button is obtained, the content of the first target document element is replaced by the preset hidden characters with the edited content corresponding to the first target document element.

[0138] When a user edits and deletes a first target document element in a document template, the user may want to re-add the first target document element to the document template and restore the content of the first target document element to the content previously entered by the user. In this case, the user can issue a restore instruction for the first target document element based on the add / delete button corresponding to the first target document element. The electronic device can then receive the restore instruction and replace the content of the first target document element with the preset hidden characters and the edited content corresponding to the first target document element.

[0139] Specifically, when the electronic device obtains a recovery instruction for the first target official document element issued by the user based on the add or delete button corresponding to the first target official document element, the electronic device can search for the editing content corresponding to the first target official document element from the recorded editing content, and replace the content of the first target official document element with the preset hidden characters and the editing content corresponding to the first target official document element.

[0140] Among them, the specific way for the user to issue a deletion instruction for the first target document element can be to left-click the add or delete button of the first target document element in the control panel, double-click the add or delete button of the first target document element in the control panel, right-click the add or delete button of the first target document element in the control panel, etc., which is not specifically limited here.

[0141] In this way, the electronic device can re-add the first target document element in the document template and restore the content of the first target document element to the editing content previously entered by the user, thereby providing convenience for the user to restore the content of the deleted document element in the document template to the content previously entered by the user.

[0142] For example, following the example in the above step S401, when the electronic device receives a recovery instruction for the official document element d3 issued by the user based on the corresponding add or delete button of the official document element d3, the electronic device can find the editing content n3 corresponding to the official document element d3, and then replace the content of the official document element d3 with the preset hidden characters n3.

[0143] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can record the content input by the user for each official document element in the official document template as the editing content; when obtaining the recovery instruction for the first target official document element issued by the user based on the add and delete button, the content of the first target official document element is replaced by the preset hidden characters with the editing content corresponding to the first target official document element, thereby providing convenience for the user to restore the content of the deleted official document element in the official document template and the content previously input by the user.

[0144] As an implementation method of the embodiment of the present invention, Figure 5 As shown, before the step of replacing the content of the first target document element with the preset hidden characters and the edited content corresponding to the first target document element, the method may further include:

[0145] S501, displaying prompt information and receiving a selection instruction issued by the user based on the prompt information;

[0146] For each document element in the document template, there is corresponding default content for the document element. When a user enters edit content for a document element in the document template, the electronic device can also record the edit content corresponding to the document element. Therefore, for a document element, in addition to the corresponding default content, there is also corresponding edit content. Furthermore, when a user wants to restore the first target document element that has been deleted in the document template, the user may want to restore the content of the first target document element to its corresponding default content, or may want to restore the content of the first target document element to its corresponding edit content.

[0147] In this case, in order to confirm whether the user wants to restore the default content of the first target document element or the edited content of the first target document element, when the electronic device obtains the recovery instruction for the first target document element issued by the user based on the add and delete button, the electronic device can display a prompt message, which is used to prompt the user to restore the first target document element to the default content or edited content.

[0148] After viewing the prompt information, the user can issue a selection instruction based on the prompt information. The selection instruction can instruct to restore the first target document element to the default content or the edited content. When the selection instruction instructs to restore the first target document element to the edited content, the electronic device can execute step S502; when the selection instruction instructs to restore the first target document element to the default content, the electronic device can execute step S503.

[0149] In one embodiment, the above-mentioned prompt information may include a first prompt box and a second prompt box. The first prompt information may be displayed in the first prompt box, and the first prompt information may prompt the user to restore the first target document element to the edited content; the second prompt information may be displayed in the second prompt box, and the second prompt information may prompt the user to restore the first target document element to the default content.

[0150] The user can issue a selection instruction by clicking the first prompt box or clicking the second prompt box. When the user clicks the first prompt box to issue a selection instruction, the selection instruction also instructs to restore the first target document element to the edited content; when the user clicks the second prompt box to issue a selection instruction, the selection instruction also instructs to restore the second target document element to the edited content.

[0151] The first prompt information may be the edited content corresponding to the first target document element, or text indicating that the first target document element has been restored to its edited content. For example, the first prompt information may be: "Restore the first target document element to its edited content." The second prompt information may be the default content corresponding to the first target document element, or text indicating that the first target document element has been restored to its default content. For example, the second prompt information may be: "Restore the first target document element to its default content."

[0152] S502: replacing the content of the first target official document element from the preset hidden characters with edited content corresponding to the first target official document element;

[0153] When the selection instruction indicates to restore the first target official document element to the edited content, the electronic device can execute step S502, that is, replace the content of the first target official document element from the preset hidden characters to the edited content corresponding to the first target official document element. For specific description, please refer to the description of the above step S402 part, which will not be repeated here.

[0154] S503: Replace the content of the first target official document element with the preset hidden characters and the default content corresponding to the first target official document element.

[0155] When the selection instruction indicates to restore the first target document element to the default content, the electronic device may replace the content of the first target document element from the preset hidden characters to the default content corresponding to the first target document element.

[0156] Specifically, when the electronic device obtains a document template, it can record the default content of each document element in the document template. When a selection instruction instructs the user to restore the default content of the first target document element in the document template, the electronic device can query the default content corresponding to the first target document element and then replace the content of the first target document element with the default content corresponding to the first target document element from the preset hidden characters. In this way, the electronic device can facilitate the user's restoration of deleted document elements to their default content.

[0157] For example, a document template E includes document elements e1, e2, and e3. The default content of document element e1 is m1, the default content of document element e2 is m2, and the default content of document element e3 is m3. When an electronic device obtains document template E, it can record the default content corresponding to each document element in document template E. The default content recorded by the electronic device is shown in the following table:

[0158]

[0159]

[0160] Assuming that the first target element is the official document element e2, when the selection instruction received by the electronic device indicates to restore the content of the official document element e2 to the default content, the electronic device can also find the default content m2 corresponding to the official document element e2 from the pre-recorded default content, and then the electronic device can replace the content of the official document element e2 from the preset hidden characters to m2.

[0161] As can be seen, in the solution provided by the embodiment of the present invention, the electronic device can display prompt information and receive a selection instruction issued by the user based on the prompt information; when the selection instruction indicates to restore the first target document element to edited content, the content of the first target document element is replaced by the preset hidden characters with the edited content corresponding to the first target document element; when the selection instruction indicates to restore the first target document element to default content, the content of the first target document element is replaced by the preset hidden characters with the default content corresponding to the first target document element. In this way, the electronic device can provide convenience for users to restore deleted document elements to default content.

[0162] As an implementation of an embodiment of the present invention, for each official document element in the official document template, the content input by the user for the official document element may include multiple historical contents input by the user.

[0163] For each document element in the document template, the user may have edited the document element multiple times. Each time the user edits the document element, the user will enter a content. Then, for the document element, there are also multiple contents entered by the user, that is, historical content. The electronic device can also record the multiple historical contents corresponding to the document element.

[0164] In this case, if Figure 6 As shown, the step of replacing the content of the first target document element from the preset hidden characters to the edited content corresponding to the first target document element when a restore instruction for the first target document element issued by the user based on the add / delete button is obtained may include:

[0165] S601, when a restore instruction for a first target document element issued by a user based on the add / delete button is obtained, displaying the plurality of historical contents;

[0166] In order to determine which of the multiple historical contents of the first target document element the edited content the user wants to restore is, when the electronic device obtains the recovery instruction for the first target document element issued by the user based on the add and delete button, it can display the multiple historical contents corresponding to the first target document element, so that the user can also view the multiple historical contents and then make a selection.

[0167] S602, selecting a historical content from the plurality of historical contents as edited content according to a selection operation issued by the user on the plurality of historical contents;

[0168] After the electronic device displays multiple historical contents, the user can perform a selection operation on the displayed multiple historical contents to select one historical content from the multiple historical contents as edited content. The edited content is the historical content that the user wants to restore.

[0169] In one embodiment, the electronic device can display multiple display boxes, each display box displays a historical content of the first target document element. When viewing the multiple display boxes, the user can make a selection by clicking on the display box. The electronic device can then determine that the historical content included in the display box clicked by the user is the edited content.

[0170] In another embodiment, the electronic device can also display a selection list and an information input box. The selection list includes each historical content and its corresponding historical content identifier. When the user views the selection list, he can enter the historical content identifier of the historical content he wants to select in the information input box. The electronic device can then receive the historical content identifier entered by the user and use the historical content corresponding to the input historical content identifier as the editing content selected by the user.

[0171] For example, if the first target document element is the issuer, the selection list displayed on the electronic device is as follows:

[0172] Historical content identification Historical content L1 Li XX L2 Wang XX L3 Zhao XX

[0173] When the historical content input by the user in the information input box is identified as L3, the electronic device can determine that the historical content selected by the user is "Zhao XX", and then the electronic device can also use "Zhao XX" as the editing content.

[0174] S603: Replace the content of the first target document element with the edited content from the preset hidden characters.

[0175] When the electronic device determines that the historical content selected by the user is editable content, the electronic device can replace the content of the first target document element with the editable content from the preset hidden characters. In other words, the content of the first target document element is replaced with the historical content selected by the user. The content of the first target document element in the document template is then restored to the historical content selected by the user. This facilitates restoring the first target document element to historical content for the user, eliminating the need for the user to re-enter the historical content, thereby improving the efficiency of editing official documents.

[0176] As can be seen, in the solution provided by the embodiment of the present invention, upon receiving a user's instruction to restore a first target document element using the add / delete button, the electronic device can display multiple historical contents; select one historical content from the multiple historical contents as the edited content based on the user's selection operation for the multiple historical contents; and replace the content of the first target document element with the edited content from the preset hidden characters. In this way, the user does not need to re-enter the historical content when restoring the first target document element to the historical content, thereby improving the user's efficiency in editing documents.

[0177] As an implementation of an embodiment of the present invention, the above-mentioned step of recording the content input by the user for each document element in the document template as the step of editing the content may include:

[0178] For each document element in the document template, obtain the content input by the user for the document element; create a target variable corresponding to the document element, and assign the input content to the target variable as the editing content corresponding to the document element.

[0179] In order to record the content entered by the user when editing the official document elements, for each official document element in the official document template, the electronic device can obtain the content entered by the user for the official document element, create a target variable corresponding to the official document element, and assign the content entered by the user to the target variable as the editing content corresponding to the official document element.

[0180] In this way, the electronic device can record the user's input content through the created target variable. When the edit content corresponding to a document element needs to be found, the electronic device can read the value of the target variable corresponding to the document element to find the edit content corresponding to the document element. The target variable created by the electronic device can be cached in the electronic device's memory. When the user closes the document template, the created target variable can be deleted, which can save the electronic device's storage resources.

[0181] For example, continuing with the example in step S401 above, the user inputs n1 for document element d1, n2 for document element d2, and n3 for document element d3. The electronic device can create a target variable v1 corresponding to document element d1, a target variable v2 corresponding to document element d2, and a target variable v3 corresponding to document element d3, and assign n1, n2, and n3 to target variable v1, target variable v2, and target variable v3, respectively. The target variables v1, v2, and v3 are stored, and the corresponding relationship is obtained as shown in the following table:

[0182] Document elements Target variable The value of the target variable Document element d1 Target variable v1 n1 Official document element d2 Target variable v2 n2 Document elements d3 Target variable v3 n3

[0183] For each document element in the document template, when the user has entered multiple historical contents for the document element, in one embodiment, the electronic device can create multiple target variables corresponding to the document element, and each target variable records a historical content of the document element.

[0184] Specifically, each time the electronic device obtains historical content input by the user for the official document element, the electronic device may create a new target variable corresponding to the official document element and assign the historical content to the new target variable.

[0185] In another embodiment, in order to save the storage resources of the electronic device, for each document element in the document template, the electronic device will only create a target variable for the document element. Each time the electronic device obtains the historical content input by the user for the document element, the electronic device can assign the historical content to the target variable.

[0186] As can be seen, in the solution provided by the embodiment of the present invention, the electronic device can obtain the content entered by the user for each document element in the document template, create a target variable corresponding to the document element, and assign the input content to the target variable as the edited content corresponding to the document element. In this way, the electronic device can store the edited content entered by the user and save storage resources of the electronic device.

[0187] As an implementation of an embodiment of the present invention, the above-mentioned step of recording the content input by the user for each document element in the document template as the step of editing the content may include:

[0188] For each document element in the document template, the content input by the user for the document element is obtained; the input content is stored in a preset database as the editing content corresponding to the document element.

[0189] To facilitate storage of user input when editing document elements, the electronic device may pre-set a database and record and store the user input when editing document elements in the database. Specifically, for each document element in the document template, the electronic device may obtain the user input for that document element and store the input content in the pre-set database as the edited content corresponding to that document element.

[0190] In this way, the above database also includes the correspondence between the official document elements and the edited content. The electronic device can subsequently search for the edited content that the user wants to restore according to the correspondence between the official document elements and the edited content stored in the preset database.

[0191] In one embodiment, the electronic device can record the content entered by the user when editing a document element in a database file associated with the document template in a preset database. This database file can be stored in the electronic device's memory. In this way, the database file is not deleted after the user closes the document template, and the edited content entered by the user can be stored for a long time. When the user closes the document template and reopens it, and issues a restore instruction for the first target document element, the electronic device can still read the edited content corresponding to the first target document element from the preset database.

[0192] As can be seen, in the solution provided by the embodiment of the present invention, the electronic device can obtain the content entered by the user for each document element in the document template and store the entered content in a preset database as the edited content corresponding to the document element. In this way, the electronic device can store the edited content entered by the user for a long time.

[0193] Corresponding to the above-mentioned method for processing the content of official document elements in an official document template, an embodiment of the present invention further provides a device for processing the content of official document elements in an official document template.

[0194] like Figure 7 As shown, a device for processing the content of official document elements in an official document template includes:

[0195] The template acquisition module 701 is used to acquire the document template when receiving the document template editing instruction issued by the user;

[0196] A control panel generating module 702 is configured to generate a control panel corresponding to the document template according to the type and content of each document element in the document template, and to display the document template and the control panel;

[0197] The control panel includes controls for editing the document elements in the document template and add / delete buttons corresponding to the document elements.

[0198] The deletion module 703 is configured to replace the first target document element with a preset hidden character when a deletion instruction for the first target document element is received from the user using the add / delete button;

[0199] The editing module 704 is configured to obtain the content input by the user in the control corresponding to the second target document element, and adjust the second target document element based on the input content.

[0200] It can be seen that in the solution provided by the embodiment of the present invention, the electronic device can obtain the official document template when obtaining the official document template editing instruction issued by the user; generate a control panel corresponding to the official document template according to the type and content of each official document element in the official document template, and display the official document template and the control panel, wherein the control panel includes controls for editing the official document elements in the official document template and add and delete buttons corresponding to the official document elements; when obtaining the deletion instruction for the first target official document element issued by the user based on the add and delete buttons, the first target official document element is replaced with a preset hidden character; obtain the content input by the user in the control corresponding to the second target official document element, and adjust the second target official document element based on the input content. Different official document templates usually include different official document elements. The electronic device can generate a control panel corresponding to the official document template based on the type and content of the official document elements in the obtained official document template. In this way, different control panels can be displayed when the user opens different official document templates. The user can issue a delete instruction for the first target official document element based on the add and delete button to delete the official document element in the official document template, and can also enter content in the control corresponding to the second target official document element in the control panel to modify the content of the second target official document element. This can facilitate users to edit the content of official document elements in the official document template, provide convenience for users to use official document templates to write official documents, and improve the efficiency of users in processing official documents.

[0201] As an implementation method of the embodiment of the present invention, Figure 8 As shown, the control panel generation module 702 may include:

[0202] The label reading submodule 801 is used to read the label of each document element in the document template;

[0203] The tag is used to record the type and content of the corresponding document element, and the type includes text type and non-text type.

[0204] The first control generating submodule 802 is configured to generate, for each document element, a first control corresponding to the document element when the document element is of text type;

[0205] Wherein, the first control includes a text box for inputting the content of the official document element.

[0206] The second control generating submodule 803 is configured to generate, for each document element, a second control corresponding to the document element if the document element is of a non-text type;

[0207] The second control includes an input box for editing the attributes of the document element.

[0208] The control panel generation submodule 804 is used to generate a control panel including add / delete buttons and controls corresponding to each document element, and display the control panel;

[0209] The control is the first control or the second control.

[0210] As an implementation manner of an embodiment of the present invention, the second target document element is of text type, and the control panel includes a first control corresponding to the second target document element;

[0211] The editing module 704 may include:

[0212] The first input submodule ( Figure 7 (not shown), for obtaining the content input by the user in the text box of the first control;

[0213] The first editing submodule ( Figure 7 ), which is not shown in the figure, is used to assign the input content to the field corresponding to the second target document element to replace the content of the second target document element with the input content.

[0214] As an implementation manner of an embodiment of the present invention, the second target document element is of a non-text type, and the control panel includes a second control corresponding to the second target document element;

[0215] The editing module 704 may include:

[0216] The second input submodule ( Figure 7 (not shown), for obtaining the content input by the user in the input box of the second control;

[0217] The second editing submodule ( Figure 7 ), is used to call the application program interface corresponding to the second target document element, so that the application program interface uses the input content as the attribute of the second target document element and draws the second target document element with the attribute.

[0218] As an implementation manner of the embodiment of the present invention, the above-mentioned device may further include:

[0219] Recording Module ( Figure 7 (not shown), for each document element in the document template, recording the content input by the user for the document element as the editing content;

[0220] Recovery Module( Figure 7), which is not shown in the figure, and is used to replace the content of the first target document element by the preset hidden characters with the editing content corresponding to the first target document element when a recovery instruction for the first target document element is obtained from the user based on the add / delete button.

[0221] As an implementation manner of the embodiment of the present invention, the above-mentioned device may further include:

[0222] Prompt information display module ( Figure 7 (not shown), for displaying a prompt message before replacing the content of the first target document element by the preset hidden character with the edited content corresponding to the first target document element, and receiving a selection instruction issued by the user based on the prompt message;

[0223] The first replacement module ( Figure 7 (not shown) for triggering the restoration module when the selection instruction indicates that the first target document element is restored as edited content;

[0224] The second replacement module ( Figure 7 (not shown), for replacing the content of the first target document element by the preset hidden characters with the default content corresponding to the first target document element when the selection instruction indicates to restore the first target document element to the default content.

[0225] As an implementation manner of an embodiment of the present invention, the content input by the user for the official document element includes multiple historical contents input by the user;

[0226] The above recovery module may include:

[0227] History content display submodule ( Figure 7 (not shown), for displaying the plurality of historical contents when a restore instruction for the first target document element is obtained from the user based on the add / delete button;

[0228] Edit content selection submodule ( Figure 7 (not shown), for selecting one historical content from the multiple historical contents as the edited content according to a selection operation issued by the user for the multiple historical contents;

[0229] Replace submodule ( Figure 7 (not shown), used to replace the content of the first target document element by the preset hidden characters with the edited content.

[0230] As an implementation of an embodiment of the present invention, the recording module may include:

[0231] The first input submodule ( Figure 7(not shown), for each document element in the document template, obtaining the content input by the user for the document element;

[0232] The first recording submodule ( Figure 7 ), is used to create a target variable corresponding to the document element, and assign the input content to the target variable as the editing content corresponding to the document element.

[0233] As an implementation of an embodiment of the present invention, the recording module includes:

[0234] The second input submodule ( Figure 7 (not shown), for each document element in the document template, obtaining the content input by the user for the document element;

[0235] The second recording submodule ( Figure 7 ), which is not shown in the figure, and is used to store the input content into a preset database as the editing content corresponding to the document element.

[0236] The embodiment of the present invention further provides an electronic device, such as Figure 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0237] Memory 903, used for storing computer programs;

[0238] The processor 901 is configured to implement the steps of the method for processing the content of official document elements in an official document template described in any of the above embodiments when executing the program stored in the memory 903 .

[0239] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0240] The communication interface is used for communication between the above electronic device and other devices.

[0241] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0242] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0243] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, the steps of the method for processing the content of official document elements in the official document template described in any of the above embodiments are implemented.

[0244] In another embodiment provided by the present invention, a computer program product containing instructions is also provided. When the computer is run on the computer, the computer executes the steps of the method for processing the content of official document elements in the official document template described in any of the above embodiments.

[0245] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0246] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0247] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0248] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A method for processing the content of official document elements in an official document template, characterized in that: The method comprises: When a document template editing instruction issued by a user is obtained, the document template is obtained, wherein the document template is provided with attributes, positions and contents of each document element; generating a control panel corresponding to the document template according to the type and content of each document element in the document template, and displaying the document template and the control panel, wherein the control panel includes controls for editing the document elements in the document template and add / delete buttons corresponding to the document elements, wherein the add / delete buttons are used to delete or add corresponding document elements; When a deletion instruction for a first target document element is obtained from the user using the add / delete button, the content of the first target document element is replaced with a preset hidden character; the preset hidden character is a character that is pre-set and not displayed in the document template; if the add / delete button is used to add a corresponding document element, the add / delete button is used to restore the document element whose content is the preset hidden character; Acquire content input by the user in a control corresponding to a second target document element, and adjust the second target document element based on the input content; Among them, the step of generating a control panel corresponding to the official document template according to the type and content of each official document element in the official document template includes: reading the label of each official document element in the official document template, the label is used to record the type and content of the corresponding official document element, and the type includes text type and non-text type; determining the type of the official document element according to the label of the official document element; for each official document element, if the type of the official document element is a text type, generating a first control corresponding to the official document element; for each official document element, if the type of the official document element is a non-text type, generating a second control corresponding to the official document element; generating a control panel including add and delete buttons and controls corresponding to each official document element, and the control is the first control or the second control.

2. The method according to claim 1, characterized in that The first control includes a text box for inputting the content of the official document element; the second control includes an input box for editing the attributes of the official document element.

3. The method according to claim 2, characterized in that The second target document element is of text type, and the control panel includes a first control corresponding to the second target document element; The step of obtaining content input by the user in a control corresponding to the second target document element and adjusting the second target document element based on the input content includes: Obtaining the content entered by the user in the text box of the first control; The input content is assigned to a field corresponding to the second target document element, so as to replace the content of the second target document element with the input content.

4. The method according to claim 2, characterized in that The second target document element is of a non-text type, and the control panel includes a second control corresponding to the second target document element; The step of obtaining content input by the user in a control corresponding to the second target document element and adjusting the second target document element based on the input content includes: Obtaining the content input by the user in the input box of the second control; The application program interface corresponding to the second target document element is called, so that the application program interface uses the input content as an attribute of the second target document element and draws the second target document element with the attribute.

5. The method according to claim 1, wherein The method further comprises: For each document element in the document template, recording the content input by the user for the document element as editing content; When a restoration instruction for the first target document element issued by the user based on the add / delete button is obtained, the content of the first target document element is replaced by the edited content corresponding to the first target document element from the preset hidden characters.

6. The method according to claim 5, characterized in that Before the step of replacing the content of the first target official document element with the preset hidden characters and the edited content corresponding to the first target official document element, the method further includes: Displaying prompt information and receiving a selection instruction issued by the user based on the prompt information; When the selection instruction indicates to restore the first target document element to edited content, performing the step of replacing the content of the first target document element with the edited content corresponding to the first target document element from the preset hidden characters; When the selection instruction indicates to restore the first target official document element to the default content, the content of the first target official document element is replaced by the default content corresponding to the first target official document element from the preset hidden characters.

7. The method according to claim 5, characterized in that The content input by the user for the official document element includes a plurality of historical contents input by the user; The step of replacing the content of the first target document element with the preset hidden characters and the edited content corresponding to the first target document element when a restoration instruction for the first target document element issued by the user based on the add / delete button is obtained includes: When a restore instruction for the first target document element issued by the user based on the add / delete button is obtained, the plurality of historical contents are displayed; selecting, according to a selection operation issued by a user on the plurality of historical contents, a historical content from the plurality of historical contents as edited content; The content of the first target document element is replaced by the edited content from the preset hidden characters.

8. The method according to claim 5, characterized in that The step of recording, for each document element in the document template, the content input by the user for the document element as the content editing step includes: For each document element in the document template, obtaining content input by the user for the document element; A target variable corresponding to the official document element is created, and the input content is assigned to the target variable as the editing content corresponding to the official document element.

9. The method according to claim 5, characterized in that The step of recording, for each document element in the document template, the content input by the user for the document element as the content editing step includes: For each document element in the document template, obtaining content input by the user for the document element; The input content is stored in a preset database as the editing content corresponding to the official document element.

10. A device for processing the content of official document elements in an official document template, characterized in that: The device comprises: A template acquisition module, configured to acquire the document template upon receiving a document template editing instruction from a user, wherein the document template is provided with the attributes, position, and content of each document element; a control panel generation module, configured to generate a control panel corresponding to the document template based on the type and content of each document element in the document template, and to display the document template and the control panel, wherein the control panel includes controls for editing document elements in the document template and add / delete buttons corresponding to the document elements, wherein the add / delete buttons are used to delete or add corresponding document elements; a deletion module configured to, upon receiving a deletion instruction issued by a user for a first target document element using the add / delete button, replace the content of the first target document element with preset hidden characters; the preset hidden characters are characters that are pre-set and not displayed in the document template; and, when the add / delete button is used to add a corresponding document element, the add / delete button is used to restore the document element whose content is the preset hidden characters; an editing module, configured to obtain content input by the user in a control corresponding to a second target document element, and adjust the second target document element based on the input content; Among them, the control panel generation module is specifically used to read the label of each official document element in the official document template, and the label is used to record the type and content of the corresponding official document element, and the type includes text type and non-text type; determine the type of the official document element according to the label of the official document element; for each official document element, if the type of the official document element is a text type, generate a first control corresponding to the official document element; for each official document element, if the type of the official document element is a non-text type, generate a second control corresponding to the official document element; generate a control panel including add and delete buttons and controls corresponding to each official document element, and the control is the first control or the second control.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps of any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Official document generation method and system based on Web

    CN108681530A