CN115809652B - Method and device for automatically synthesizing red header file - Google Patents
Method and device for automatically synthesizing red header file Download PDFInfo
- Publication number
- CN115809652B CN115809652B CN202310042947.8A CN202310042947A CN115809652B CN 115809652 B CN115809652 B CN 115809652B CN 202310042947 A CN202310042947 A CN 202310042947A CN 115809652 B CN115809652 B CN 115809652B
- Authority
- CN
- China
- Prior art keywords
- file
- information
- risk level
- target release
- template
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 230000002194 synthesizing effect Effects 0.000 title claims abstract description 35
- 238000004891 communication Methods 0.000 claims description 18
- 240000005926 Hamelia patens Species 0.000 claims description 17
- 230000004048 modification Effects 0.000 claims description 10
- 238000012986 modification Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Images
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The embodiment of the invention provides a method and a device for automatically synthesizing a red header file, wherein the method comprises the following steps: acquiring a template file, wherein the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file; acquiring target release information corresponding to one or more tags, and replacing placeholders corresponding to the tags in the template file with the target release information to acquire an intermediate file; according to the pre-acquired risk level information, replacing the color of a pre-determined risk level indication area in the intermediate file with the color corresponding to the risk level information to obtain a target release file; converting the target release file into a PDF format to obtain a red header preview file; uploading the red header preview file to a public resource directory, the public resource directory being used to display the red header preview file to a user. By applying the embodiment of the invention, the red header file displaying the risk level information can be automatically synthesized, and the user can preview the red header file in real time.
Description
Technical Field
The invention relates to the technical field of document processing, in particular to a method and a device for automatically synthesizing a red header file.
Background
The existing red head files are issued through paper files, but the mode of issuing the specified information through the paper files is very complicated, the workload is very large, and errors are easy to occur.
Disclosure of Invention
The embodiment of the invention aims to provide a method for automatically synthesizing a red header file so as to realize the automatic synthesis of the red header file. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for automatically synthesizing a red header file, where the method includes:
obtaining a template file, wherein the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file;
acquiring one or more target release information corresponding to the tag, and replacing placeholders corresponding to the tag in the template file with the target release information to acquire an intermediate file;
according to the pre-acquired risk level information, replacing the color of a pre-determined risk level indication area in the intermediate file with the color corresponding to the risk level information to obtain a target release file;
converting the target release file into a PDF format to obtain a red header preview file;
uploading the red header preview file to a public resource directory, wherein the public resource directory is used for displaying the red header preview file to a user.
Optionally, after the uploading the red header preview file to the public resource address directory, the method further includes:
receiving the modification of the template file and/or the target release information by the user, and obtaining the modified template file and/or the target release information;
and returning to the step of replacing the placeholder corresponding to the label in the template file with the target release information to obtain an intermediate file.
Optionally, the step of replacing the color of the predetermined risk level indication area in the intermediate file with the color corresponding to the risk level information according to the pre-acquired risk level information includes:
decompressing the intermediate file to obtain document. Xml;
and updating the document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information.
Optionally, the placeholder includes a clerk placeholder, and the method further includes:
responding to the issuing instruction of the user, and determining the document number of the target issuing file;
and replacing the mark placeholder in the target release file with the mark.
Optionally, the step of converting the target release file into pdf format to obtain a red header preview file includes:
and calling LibreOffice software through LibreOffice-cover to convert the target release text into a PDF format, and obtaining the red header preview file.
In a second aspect, an embodiment of the present invention provides an apparatus for automatically synthesizing a red header file, where the apparatus includes:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a template file, the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file;
the first replacing module is used for acquiring one or more target release information corresponding to the labels, replacing placeholders corresponding to the labels in the template file with the target release information, and acquiring an intermediate file;
the second replacing module is used for replacing the color of the risk level indication area which is preset in the intermediate file with the color corresponding to the risk level information according to the risk level information which is obtained in advance, so as to obtain a target release file;
the conversion module is used for converting the target release file into a PDF format to obtain a red header preview file;
and the uploading module is used for uploading the infrared head preview file to a public resource directory, and the public resource directory is used for displaying the infrared head preview file to a user.
Optionally, the apparatus further comprises:
the receiving module is used for receiving the modification of the template file and/or the target release information by the user and obtaining the modified template file and/or the target release information;
and the control module is used for controlling the first replacing module to execute the step of replacing the placeholder corresponding to the label in the template file with the target release information to obtain an intermediate file.
Optionally, the second replacing module is specifically configured to:
decompressing the intermediate file to obtain document. Xml;
and updating the document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information.
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, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the methods for automatically synthesizing the red header file according to the first aspect when executing the program stored in the memory.
The embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of automatically synthesizing a red header file as described in any one of the above.
The embodiment of the invention has the beneficial effects that:
according to the method and the device for automatically synthesizing the red header file, the template file comprising the placeholder is obtained, the target release information is added into the template file to obtain the intermediate file, the color of the risk level indication area in the intermediate file is replaced according to the risk level information to obtain the target release file, namely the red header file, the target release file is converted into the PDF format and uploaded to the public resource catalog for display, the red header file for automatically synthesizing and displaying the risk level information is achieved, and the red header file can be previewed in real time by a user.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1 is a flow chart of a method for automatically synthesizing a red header file according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a method for automatically synthesizing a red header file according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an apparatus for automatically synthesizing a red header file according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art will be able to devise all other embodiments that are obtained based on this application and are within the scope of the present invention.
The existing red head files are issued through paper files, but the mode of issuing the specified information through the paper files is very complicated, the workload is very large, and errors are easy to occur.
In order to solve the above problems, an embodiment of the present invention provides a method for automatically synthesizing a red header file, and fig. 1 is a schematic flow chart of the method for automatically synthesizing a red header file according to the embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101: acquiring a template file, wherein the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file.
In the template file, each placeholder is used to occupy a fixed location in the file, which may then be used to add other content.
Also, the tags included in each placeholder are predefined, and these tags can be used to indicate information that needs to be added to the corresponding location of the placeholder.
As one example, the placeholders in the template file may be in the format { XXX }, which is the tag of the placeholder.
The embodiment of the invention is not limited to the content of the template file, and can comprise the content generally required in the red header file.
Specifically, the information in the template file can be defined according to the requirement of the user, one or more placeholders are inserted into the information, and the defined template file is uploaded to the server.
Step S102: and acquiring target release information corresponding to one or more tags, and replacing placeholders corresponding to the tags in the template file with the target release information to acquire an intermediate file.
The target release information is information to be added to the red header file by a user, and has a predetermined corresponding relation with the labels in the placeholders, and is added to the positions of the placeholders according to the corresponding relation.
As one example, the template file is defined with placeholders { file category }, and a corresponding relation 'file category' exists between the target release information and the label, namely 'red header file', and the placeholders 'file category }' shown in the template file are replaced by 'red header file'.
The intermediate file after the information replacement is completed can be understood as a word red header file of an initial version, wherein the word red header file comprises target release information which needs to be released by a user.
Specifically, the target release information may be uploaded by the user or saved from the platform used to release the information.
Step S103: and replacing the color of the predetermined risk level indication area in the intermediate file with the color corresponding to the risk level information according to the pre-acquired risk level information, and obtaining the target release file.
Specifically, the target release file already includes target release information and risk level information required by the redhead file, and the target release file can be used for release.
The risk level indication area is specifically predetermined in the template file, and the embodiment of the invention enables the target release file to display the risk level of the file through color by replacing the color of the risk level indication area.
As an example, a location area may be determined at the upper right corner of the page of the template file as a risk level indication area, so that the user can easily understand risk level information.
Specifically, the target release file has a plurality of risk levels, and each risk level corresponds to a different color.
As one example, the risk levels include very urgent, and non-urgent, with the three risk levels corresponding to colors red, orange, and yellow, respectively. If the risk level of a target release file is very urgent, the risk level indication area of the file is red.
In particular, the risk level information may be uploaded by the user.
Step S104: the target release file is converted into a PDF (Portable Document Format ) format, and a red-head preview file is obtained.
Specifically, the target release file is a word file, and the word file cannot be directly previewed on line. In order to facilitate the user to preview the effect of the target release file, the embodiment of the invention firstly converts the target release file into a PDF format to obtain the red-head preview file, so that the red-head preview file can be directly previewed on line without downloading or further processing the target release file.
Step S105: uploading the red header preview file to a public resource directory, the public resource directory being used to present the red header preview file to a user.
Specifically, the red-header preview file is uploaded to the public resource directory of the server, so that the user can access the public resource directory to realize the preview of the red-header preview file.
According to the method for automatically synthesizing the red header file, provided by the embodiment of the invention, the target release information is added into the template file to obtain the intermediate file by acquiring the template file comprising the placeholder, the color of the risk level indication area in the intermediate file is replaced according to the risk level information to obtain the target release file, namely the red header file, the target release file is converted into the PDF format and uploaded to the public resource directory to be displayed for the user, the red header file for automatically synthesizing and displaying the risk level information is realized, and the user can preview the red header file in real time.
In one embodiment of the invention, the third party library docxtemplate is used to replace the target release information into the template file.
By using the docxtemplaster, the embodiment of the invention can conveniently realize the replacement of the content in the template file, and improves the efficiency of filling the target release information into the template file.
In one embodiment of the present invention, after step S105, the method for automatically synthesizing a red header file provided in the embodiment of the present invention further includes:
receiving the modification of the template file and/or the target release information by a user, and obtaining the modified template file and/or the target release information;
and returning to the step of replacing the placeholder corresponding to the label in the template file with the target release information to obtain the intermediate file.
Specifically, in the process of online previewing the infrared preview file, the user can judge whether the content in the infrared preview file needs to be modified, and if so, the user can adjust the template file and/or the target release information according to the information needing to be modified.
As an example, if the user finds that there is an error in the target release information displayed in the red head preview file, the user may modify the target release information that has been stored, and if the user finds that there is an error in the position of the information in the red head preview file, the user may adjust the position of the corresponding information in the template file.
After the user completes the modification of the template file and/or the target release information, the placeholder in the template file is replaced again to obtain a modified intermediate file, and steps S103-S105 are continuously executed. If the user considers that the re-acquired red head preview file still needs to be modified, the steps can be repeated to continuously adjust the template file and/or the target release information until the satisfied red head preview file is obtained.
According to the method for automatically synthesizing the red header file, provided by the embodiment of the invention, the red header preview file is displayed for the user, so that the user can modify the template file and/or the target release information in real time according to the display effect of the red header preview file, the user can obtain a satisfactory red header file conveniently, the adjusted template file can be used all the time later, and the applicability of the method for automatically synthesizing the red header file can be improved.
In one embodiment of the present invention, step S103 specifically includes:
decompressing the intermediate file to obtain document. Xml;
and updating document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information.
Specifically, the intermediate file is a word file, the word file is essentially a compressed package, which can be decompressed as a directory, and the content of the word file is stored in document xml of the decompressed directory. Therefore, the embodiment of the invention can replace the content displayed in the word file by updating the decompressed document.
After the intermediate file is decompressed, the document xml is found from the decompressed catalog, and the document xml specifically comprises all attribute information of the intermediate file, so that the information representing the color of the risk level indication area in the intermediate file is updated, and the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information.
As one example, the intermediate file is decompressed using a third party library jszip.
According to the method for automatically synthesizing the red header file, disclosed by the embodiment of the invention, the document xml is obtained by decompressing the intermediate file, and the document xml is updated according to the risk level information, so that the replacement of the color of the risk level indication area is realized, and the replacement efficiency and the replacement accuracy are higher.
In one embodiment of the present invention, the placeholder includes a document placeholder, and the method for automatically synthesizing the red header file provided by the embodiment of the present invention further includes:
responding to a issuing instruction of a user, and determining a document number of a target issuing file;
and replacing the mark placeholder in the target release file with the mark.
Specifically, after the user previews the red header preview file, if it is determined that the target release file is to be released, the method for automatically synthesizing the red header file provided by the embodiment of the invention can automatically generate the document, the document is added to the target release file, and the target release file added with the document is the red header file finally used for releasing.
The corresponding document placeholders are also present in the target release file.
As an example, the target release file includes content "No. 123 file" and the automatically generated document is No. 123, and then the content "No. 123 file" is displayed in the target release file after the document is added.
In one embodiment of the present invention, step S104 specifically includes:
and calling LibreOffice software through LibreOffice-cover to convert the target release text into a PDF format, and obtaining the red header preview file.
Fig. 2 is a schematic diagram of a method for automatically synthesizing a red header file according to an embodiment of the present invention, and the method for automatically synthesizing a red header file according to an embodiment of the present invention is further described below with reference to fig. 2, and as shown in fig. 2, the method specifically includes the following steps:
step S201: uploading a red header file template.
Specifically, the redhead file template is the template file.
Step S202: user information is entered.
Specifically, the user information here includes target distribution information and risk level information.
Step S203: the red header file was synthesized using docxtemplate.
Specifically, the target release information is added to the template file through the docxtemplaster.
Step S204: and decompressing the red header file by jszip, finding document. Xml, and replacing the appointed color according to the risk level.
Step S205: and calling Libreoffice software to convert the red header file into PDF and uploading the PDF to the server public resource directory.
Step S206: the PDF file is viewed on the user line.
Step S207: whether the file needs to be adjusted is determined, if the user information needs to be updated, the process returns to step S202, if the template needs to be changed, the process returns to step S201, and if the file does not need to be adjusted, the process proceeds to step S208.
Step S208: and generating a document, and replacing the document into the redhead file through a docxtemplate to generate a formal redhead file.
Step S209: and issuing a red header file.
The embodiment of the invention also provides a device for automatically synthesizing the red header file, and fig. 3 is a schematic structural diagram of the device for automatically synthesizing the red header file, which is provided by the embodiment of the invention, as shown in fig. 3, and the device comprises:
an obtaining module 301, configured to obtain a template file, where the template file includes one or more placeholders, and each placeholder includes a tag; the template file is a word file;
the first replacing module 302 is configured to obtain target release information corresponding to one or more tags, replace placeholders corresponding to the tags in the template file with the target release information, and obtain an intermediate file;
a second replacing module 303, configured to replace, according to the pre-acquired risk level information, a color of a pre-determined risk level indication area in the intermediate file with a color corresponding to the risk level information, to obtain a target release file;
the conversion module 304 is configured to convert the target release file into a PDF format, and obtain a red header preview file;
the uploading module 305 is configured to upload the red header preview file to a public resource directory, where the public resource directory is configured to present the red header preview file to a user.
In one embodiment of the invention, the apparatus further comprises:
the receiving module is used for receiving the modification of the template file and/or the target release information by the user and obtaining the modified template file and/or the target release information;
the control module is configured to control the first replacing module 302 to perform a step of replacing the placeholder corresponding to the tag in the template file with the target release information, so as to obtain an intermediate file.
In one embodiment of the invention, the second replacing module 303 is specifically configured to:
decompressing the intermediate file to obtain document. Xml;
and updating the document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information.
In one embodiment of the present invention, the placeholder includes a clerk placeholder, and the apparatus further includes:
the determining module is used for responding to the issuing instruction of the user and determining the document number of the target issuing file;
and the third replacing module is used for replacing the mark placeholder of the document in the target release file with the document.
In one embodiment of the present invention, the conversion module 304 is specifically configured to:
and calling LibreOffice software through LibreOffice-cover to convert the target release text into a PDF format, and obtaining the red header preview file.
According to the device for automatically synthesizing the red header file, provided by the embodiment of the invention, the target release information is added into the template file to obtain the intermediate file by acquiring the template file comprising the placeholder, the color of the risk level indication area in the intermediate file is replaced according to the risk level information to obtain the target release file, namely the red header file, the target release file is converted into the PDF format and uploaded to the public resource directory to be displayed for a user, the red header file for automatically synthesizing and displaying the risk level information is realized, and the user can preview the red header file in real time.
The embodiment of the invention also provides an electronic device, as shown in fig. 4, which comprises a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 complete communication with each other through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
acquiring a template file, wherein the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file;
acquiring target release information corresponding to one or more tags, and replacing placeholders corresponding to the tags in the template file with the target release information to acquire an intermediate file;
according to the pre-acquired risk level information, replacing the color of a pre-determined risk level indication area in the intermediate file with the color corresponding to the risk level information to obtain a target release file;
converting the target release file into a PDF format to obtain a red header preview file;
uploading the red header preview file to a public resource directory, the public resource directory being used to present the red header preview file to a user.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-ProgrammableGate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the methods of automatically synthesizing a red header file described above.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of automatically synthesizing a redhead document of any of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments of the method for automatically synthesizing a redhead document, the description is relatively simple, as it is substantially similar to the method embodiments, with reference to the partial description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (6)
1. A method for automatically synthesizing a redhead document, comprising:
obtaining a template file, wherein the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file; the tag is used for indicating information which needs to be added to the corresponding position of the placeholder;
acquiring one or more target release information corresponding to the tag, and replacing placeholders corresponding to the tag in the template file with the target release information to acquire an intermediate file; the target release information and the label of the placeholder have a predetermined corresponding relation, and the target release information is uploaded by a user or stored in an information release platform;
according to the pre-acquired risk level information, replacing the color of a pre-determined risk level indication area in the intermediate file with the color corresponding to the risk level information to obtain a target release file;
converting the target release file into a PDF format to obtain a red header preview file;
uploading the red header preview file to a public resource directory, wherein the public resource directory is used for displaying the red header preview file to a user;
the step of replacing the color of the predetermined risk level indication area in the intermediate file with the color corresponding to the risk level information according to the pre-acquired risk level information includes:
decompressing the intermediate file to obtain document. Xml;
updating the document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information;
wherein the document. Xml includes each item of attribute information of the intermediate file, and the step of updating the document. Xml according to the risk level information includes:
updating the information of the color of the indication area of the characteristic risk level in the document. Xml according to the risk level information;
after the red header preview file is uploaded to the public resource address directory, the method further comprises the following steps:
receiving the modification of the template file and/or the target release information by the user, and obtaining the modified template file and/or the target release information; the modification of the template file comprises adjustment of the position of the placeholder in the template file, and the adjusted template file can be used all the time later;
and returning to the step of replacing the placeholder corresponding to the label in the template file with the target release information to obtain an intermediate file.
2. The method of claim 1, wherein the placeholder comprises a clerk placeholder, the method further comprising:
responding to the issuing instruction of the user, and determining the document number of the target issuing file;
and replacing the mark placeholder in the target release file with the mark.
3. The method of claim 1, wherein the step of converting the target published file to pdf format to obtain a red-header preview file comprises:
and calling LibreOffice software through LibreOffice-cover to convert the target release text into pdf format, so as to obtain the red header preview file.
4. An apparatus for automatically synthesizing a redhead document, comprising:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring a template file, the template file comprises one or more placeholders, and each placeholder comprises a label; the template file is a word file; the tag is used for indicating information which needs to be added to the corresponding position of the placeholder;
the first replacing module is used for acquiring one or more target release information corresponding to the labels, replacing placeholders corresponding to the labels in the template file with the target release information, and acquiring an intermediate file; the target release information and the label of the placeholder have a predetermined corresponding relation, and the target release information is uploaded by a user or stored in an information release platform;
the second replacing module is used for replacing the color of the risk level indication area which is preset in the intermediate file with the color corresponding to the risk level information according to the risk level information which is obtained in advance, so as to obtain a target release file;
the conversion module is used for converting the target release file into a PDF format to obtain a red header preview file;
the uploading module is used for uploading the red header preview file to a public resource directory, and the public resource directory is used for displaying the red header preview file to a user;
the second replacing module is specifically configured to:
decompressing the intermediate file to obtain document. Xml;
updating the document. Xml according to the risk level information, so that the color of the risk level indication area in the intermediate file is replaced by the color corresponding to the risk level information;
wherein the document. Xml includes each item of attribute information of the intermediate file, and the step of updating the document. Xml according to the risk level information includes:
updating the information of the color of the indication area of the characteristic risk level in the document. Xml according to the risk level information;
the apparatus further comprises:
the receiving module is used for receiving the modification of the template file and/or the target release information by the user and obtaining the modified template file and/or the target release information; the modification of the template file comprises adjustment of the position of the placeholder in the template file, and the adjusted template file can be used all the time later;
and the control module is used for controlling the first replacing module to execute the step of replacing the placeholder corresponding to the label in the template file with the target release information to obtain an intermediate file.
5. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-3 when executing a program stored on a memory.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310042947.8A CN115809652B (en) | 2023-01-28 | 2023-01-28 | Method and device for automatically synthesizing red header file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310042947.8A CN115809652B (en) | 2023-01-28 | 2023-01-28 | Method and device for automatically synthesizing red header file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115809652A CN115809652A (en) | 2023-03-17 |
CN115809652B true CN115809652B (en) | 2023-05-23 |
Family
ID=85487486
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310042947.8A Active CN115809652B (en) | 2023-01-28 | 2023-01-28 | Method and device for automatically synthesizing red header file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115809652B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116226053B (en) * | 2023-05-05 | 2024-03-22 | 中国民航信息网络股份有限公司 | Text processing method, device and equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976235A (en) * | 2010-09-21 | 2011-02-16 | 天津神舟通用数据技术有限公司 | Extensible Word report automatically-generating method based on dynamic web page |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109933752B (en) * | 2017-12-15 | 2023-05-30 | 北京京东尚科信息技术有限公司 | Method and device for exporting electronic document |
CN110765770B (en) * | 2019-09-04 | 2024-07-19 | 平安科技(深圳)有限公司 | Automatic contract generation method and device |
CN116993348A (en) * | 2020-02-12 | 2023-11-03 | 支付宝(杭州)信息技术有限公司 | Information prompting method, device, equipment and computer readable medium |
CN111552473B (en) * | 2020-04-27 | 2024-02-09 | 腾讯科技(深圳)有限公司 | Application processing method, device and equipment |
CN111724132A (en) * | 2020-06-18 | 2020-09-29 | 北京明略软件系统有限公司 | File delivery method, device, intelligent terminal and storage medium |
CN114861623B (en) * | 2022-05-09 | 2024-11-26 | 深圳市富途网络科技有限公司 | Protocol template generation method, device, electronic device and storage medium |
-
2023
- 2023-01-28 CN CN202310042947.8A patent/CN115809652B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976235A (en) * | 2010-09-21 | 2011-02-16 | 天津神舟通用数据技术有限公司 | Extensible Word report automatically-generating method based on dynamic web page |
Non-Patent Citations (1)
Title |
---|
OA系统中红头文件自动生成的设计与实现;陈萱华;;计算机与现代化(第09期) * |
Also Published As
Publication number | Publication date |
---|---|
CN115809652A (en) | 2023-03-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8037402B2 (en) | Method and system for flexible creation and publication of forms | |
US8494340B2 (en) | Method and electronic device for surveillance control | |
CN110955428A (en) | Page display method and device, electronic equipment and medium | |
EP3213192A1 (en) | Page processing for mobile app | |
CN115809652B (en) | Method and device for automatically synthesizing red header file | |
WO2020026778A1 (en) | Api adapter creation device, api adapter creation method, and api adapter creation program | |
CN104102489A (en) | Third-party database APP (Application) construction system and construction method | |
WO2013143283A1 (en) | Document processing method, device and editor | |
CN108664505B (en) | Method and device for exporting database table structure | |
CN113436699A (en) | Method, system, electronic device and storage medium for generating new corona nucleic acid detection report | |
CN102930021A (en) | Data processing method of cloud computing system | |
CN114330268B (en) | Document generation method, device, electronic device and computer-readable storage medium | |
CN113761415B (en) | Page display method and device | |
CN115934148A (en) | Drawing version merging method, platform, equipment and storage medium | |
JP6753489B2 (en) | Information processing system, information processing device, information processing method, and program | |
CN114328539A (en) | Method and device for importing table file, readable storage medium and computer equipment | |
CN109376346B (en) | Multi-terminal electronic document editing management method and system based on labels and views | |
CN111767223A (en) | File processing method and device, electronic equipment and storage medium | |
JP7574953B2 (en) | Information processing device, information processing system, information processing method, and program | |
CN113741956B (en) | Method and device for transplanting version management function, version management method and device | |
JP6536308B2 (en) | INFORMATION PROCESSING SYSTEM, INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING METHOD, AND PROGRAM | |
CN112861497A (en) | Contract template generation method and system | |
CN112788091B (en) | Document content providing system, document content collecting method, device and equipment | |
CN111399832A (en) | Page editing method and device | |
US20240256298A1 (en) | Javascript object notation configuration file generation and network function implementation method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |