CN112989437B - OFD document processing method, transmission method and system - Google Patents
OFD document processing method, transmission method and system Download PDFInfo
- Publication number
- CN112989437B CN112989437B CN202110438842.5A CN202110438842A CN112989437B CN 112989437 B CN112989437 B CN 112989437B CN 202110438842 A CN202110438842 A CN 202110438842A CN 112989437 B CN112989437 B CN 112989437B
- Authority
- CN
- China
- Prior art keywords
- seal
- data
- ofd document
- format
- processing method
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Bioethics (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Storage Device Security (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention discloses an OFD document processing method, a transmission method and a system in the field of text processing. Acquiring ASN format seal data and ASN format signature value data generated by each electronic seal after the electronic seal signs, analyzing the ASN format seal data and the electronic seal data in the ASN format signature value data to generate first seal data, performing graying processing on the first seal data to obtain second seal data, and refilling the second seal data into the ASN format seal data and the ASN format signature value data. The scheme can reserve the OFD document graying processing method of the signature operation, the corresponding OFD document transmission method and the OA system, and solve the abuse problem in the OFD document circulation process.
Description
Technical Field
The invention relates to the technical field of text processing, in particular to an OFD document processing technology.
Background
At present, under the trusted environment, information transmission between different levels of government departments is increasingly realized by receiving and sending electronic documents in OFD format with electronic seal signatures through Office Automation (OA for short), and the traditional paper documents are not used any more. The traditional electronic document is generally in a red-head red seal format, in order to avoid misuse of an OFD document covered with an electronic seal signature after the OFD document is taken out of a system, the electronic document needs to be subjected to graying processing when being externally read, and characters, pictures and seal signature elements in the document, particularly the seal signature in the document are read after being grayed, so that the OFD document subjected to graying processing and the printed document are different from an original document. The existing graying scheme on the market has the following defects:
red or blue seal signatures in the OFD document with the seal signature are converted into gray scale seal pictures, and the seal signature attribute of the red or blue seal signatures is lost, so that a receiver cannot distinguish seals existing in a seal signature format and a common picture format in the gray scale OFD document, and the receiver cannot judge whether signature operation is performed before the document is subjected to gray scale.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides an OFD document graying processing method capable of reserving signature operation, and a corresponding OFD document transmission method and an OA system thereof, and solves the abuse problem in the OFD document circulation process.
In order to solve the technical problem, the invention is solved by the following technical scheme:
an OFD document processing method comprises graying processing of electronic seal in OFD document,
acquiring ASN format seal data and ASN format signature value data generated by each electronic seal after the electronic seal signs, analyzing the ASN format seal data and the electronic seal data in the ASN format signature value data to generate first seal data, performing graying processing on the first seal data to obtain second seal data, and refilling the second seal data into the ASN format seal data and the ASN format signature value data.
Optionally, the method further comprises a graying process of the text data in the OFD document.
Optionally, enumerating each xml-format text, recursively searching the whole xml-format text, acquiring a node with a name containing a color keyword, reading a value of a value attribute of the node, and performing gray-scale calculation on the value of the value attribute.
Optionally, the original image is replaced after other pictures except the electronic seal in the OFD document are subjected to graying processing.
Optionally, enumerating all picture format files, decoding and storing the picture files, reading the color value of each pixel of the decoded picture files, performing graying calculation to obtain a gray value V, replacing the R, G, B, and a values in the picture files with V, and a values, and after processing all the pixel color values, covering and storing the original picture data.
Optionally, the method includes obtaining a signedvalue.dat and seal.esl format file of each electronic seal, analyzing first seal data in the signedvalue.dat and seal.esl format files, reading color values of each pixel of the first seal data, performing graying calculation to obtain a gray value V, replacing R, G, B, and a values in the first seal data with V, and a values, generating second seal data after processing of all pixel color values is completed, and refilling the second seal data in the signedvalue.dat and seal.esl format files.
Optionally, the graying processing method includes: the original R, G, B data of the data in the OFD document are multiplied by the gamma to obtain the gray value V.
Optionally, the grayscale value V = R0.299 + G0.587 + B0.114.
The invention also provides an OFD document transmission method, which comprises an OFD document output method, and specifically comprises the following steps:
selecting and outputting;
calling the OFD document processing method;
and outputting the processed OFD document.
The invention also provides a system comprising the OFD document processing method.
The invention has the beneficial effects that:
after the OFD document with the seal signature is grayed, after a receiver opens the document by using an OFD format file reader, the reader can identify the seal signature and a common seal picture and perform differential display, and the receiver can judge whether the document contains the seal signature according to the difference, so that the reliability of the document is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or 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 present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart of an OFD document processing method described in embodiment 1.
Detailed Description
The present invention will be described in further detail with reference to examples, which are illustrative of the present invention and are not to be construed as being limited thereto.
Noun interpretation and technical development background: the OFD is an english abbreviation of an Open Fixed-layout Document (Open file), and is also a format standard for exchanging and storing electronic documents in China. The OFD describes and stores data in the form of "container + document". The container is a virtual storage system, and various data description files are aggregated according to a certain directory structure, compressed by a zip algorithm and stored as a file with a suffix name of ofd. The OFD document contents mainly include pictures, texts, resources, and the like.
The embodiment provides an OFD document processing method, which respectively performs graying processing on three elements, namely a text, a picture and an electronic seal signature, contained in an OFD document. The method not only ensures the circulation safety of the OFD document, but also can realize validity verification.
The first step is as follows: aiming at an OFD document text, graying is realized by directly modifying the color attribute of a text element;
the second step is that: enumerating all types of picture data in an OFD document aiming at the picture data except the electronic seal, and replacing an original picture after carrying out graying processing on each picture;
the third step: after the OFD document is signed by an electronic seal, three data description files, namely seal. Wherein, the signedvalue.
And resolving the seal pictures in the SignedValue.dat and seal.esl formats during the graying treatment, performing graying treatment on the resolved seal pictures by adopting the method in the second step, and refilling the treated pictures into the original positions of the SignedValue.dat and seal.esl files.
The seal is seal data in ASN format, the signature is xml is a signature description file, and the signature value is signature value data in ASN format.
The graying processing method comprises the following three steps: the original R, G, B data of the data in the OFD document are multiplied by the gamma to obtain the gray value V.
Wherein R: red component value, G: green component value, B: the blue component value is calculated by the formula:
v = R0.299 + G0.587 + B0.114, and V (i) after the related graying processing described in this embodiment is not a fixed value, and is advantageous for reasonably processing data of various color values according to the change of the actual original data parameters. Meanwhile, the related gray coefficient can be adjusted and can be selected within a certain range in practical application.
The first to third steps described above are further described below:
the first step is as follows: enumerating each xml format text, recursively searching the whole xml format text, acquiring a node (node) with a name containing a color keyword, reading the value of the value attribute of the node, and performing gray calculation on the value of the value attribute.
The value generally consists of three integer values, such as "R, G, B", where R represents the red component, G represents the green component, and B represents the blue component. And calculating corresponding gray values V according to the formula V = R0.299 + G0.587 + B0.114 for the three values of R, G and B, and replacing the original values of R, G and B with the values of V, V and V.
According to the above description, it can be known that there are a plurality of xml texts in each OFD document, and each xml format text needs to be processed.
The second step is that: enumerating all picture format files, decoding the picture format files, reading the decoded picture format files into a memory, reading the color value of each pixel of the decoded picture files, executing graying calculation to obtain a gray value V, replacing R, G, B and A values in the picture files with V, V, V and A values, and after processing all pixel color values, covering and storing the original picture files.
Wherein R represents a red component, G represents a green component, B represents a blue component, and a represents transparency. And calculating corresponding gray values V according to the formula V = R0.299 + G0.587 + B0.114 for the three values of R, G and B, and replacing the original values of R, G, B and A with the values of V, V, V and A. And after all pixel color values are processed, covering and storing again.
Further, in this embodiment, the value a is not processed, so that the original picture with transparent background is prevented from being processed into a picture with transparent background.
In this embodiment, the picture formats include bmp, jpeg, png, tif, and the like.
The third step: and acquiring SignedValue.dat and seal.esl format files of the electronic seal, wherein the seal.esl file stores electronic seal data, the SignedValue.dat file stores electronic signature data, and the two files both contain seal pictures. Analyzing the seal picture data in the SignedValue.dat and seal.esl format files, reading the color value of each pixel of the seal picture data, performing gray-scale calculation to obtain a gray value V, replacing the R, G, B and A values in the picture files with V, V, V and A values, and after the color values of all the pixels are processed, filling the processed data into the SignedValue.dat and seal.esl format files again.
Specifically, according to the above description, it can be known that the electronic seal signatures in the OFD document are n, where n is greater than or equal to 0. The system sequentially reads the SignedValue.dat and seal.esl format files generated by each electronic seal signature according to the storage position, analyzes the seal picture data in the files, and stores the seal picture after graying processing; and traversing and processing the SignedValue.dat and seal.esl files corresponding to all the seal image data.
Example 2:
the embodiment provides an OFD document transmission method, including a method of exporting an OFD document, which specifically includes:
selecting a lead-out;
calling the OFD document processing method of the embodiment 1;
and outputting the processed OFD document.
Example 3:
the present embodiment provides an OA system, wherein a receiving unit receives an OFD document through the OA system, and the OA system can open and view an original OFD document (including an OFD document containing an electronic seal signature). If the receiving unit needs to export the OFD document out of the OA system for circulation, the user selects to invoke the function of OFD document graying of the OA system, which is the function implemented by the OFD document processing method described in embodiment 1.
The OA system reads the OFD document into the memory, and analyzes a plurality of xml format texts, pictures and seal signature elements contained in the OFD document according to the OFD format specification; the OA system performs the graying process by performing the method described in embodiment 1.
After the graying processing is completed, the OFD document with the signature marks which needs to be read can be exported to other systems for reading.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed.
The units may or may not be physically separate, and components displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be essentially or partially contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions within the technical scope of the present invention are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
- The OFD document processing method is characterized by comprising the graying processing of an electronic seal in an OFD document,acquiring ASN format seal data and ASN format signature value data generated by each electronic seal after the electronic seal signs, analyzing the ASN format seal data and the electronic seal data in the ASN format signature value data to generate first seal data, performing graying processing on the first seal data to obtain second seal data, and refilling the second seal data into the ASN format seal data and the ASN format signature value data.
- 2. The OFD document processing method according to claim 1,and graying the text data in the OFD document.
- 3. The OFD document processing method according to claim 2,enumerating each xml format text, recursively searching the whole xml format text, acquiring nodes with names containing color keywords, reading the value of the value attribute, and performing gray calculation on the value of the value attribute.
- 4. The OFD document processing method according to claim 1, wherein the original image is replaced after graying processing of other pictures in the OFD document except the electronic seal.
- 5. The OFD document processing method according to claim 4,enumerating all picture format files, decoding and storing the picture files, reading the color value of each pixel of the decoded picture files, executing graying calculation to obtain a gray value V, replacing the R, G, B and A values in the picture files with V, V, V and A values, and after the color values of all the pixels are processed, covering and storing the data of the original picture.
- 6. The OFD document processing method according to claim 1, wherein a signedvalue.dat and seal.esl format file of each electronic seal is acquired, first seal data in the signedvalue.dat and seal.esl format file is analyzed, a color value of each pixel of the first seal data is read, graying calculation is performed to obtain a gray value V, values of R, G, B, and a in the first seal data are replaced with values of V, and a, after color values of all pixels are processed, second seal data is generated, and the second seal data is refilled in the signedvalue.dat and seal.esl format file.
- 7. The OFD document processing method according to claim 1, wherein the graying processing method comprises:the original R, G, B data of the data in the OFD document are multiplied by the gamma to obtain the gray value V.
- 8. The OFD document processing method according to claim 7, wherein V = R0.299 + G0.587 + B0.114.
- The OFD document transmission method is characterized by comprising a method for outputting an OFD document, and specifically comprises the following steps:selecting and outputting;invoking the OFD document processing method of claim 1;and outputting the processed OFD document.
- 10. A computer system, comprising,a processor;a computer-readable storage medium storing a computer program, wherein the computer program is capable of implementing the OFD document processing method of any one of claims 1 to 8 when executed by the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110438842.5A CN112989437B (en) | 2021-04-23 | 2021-04-23 | OFD document processing method, transmission method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110438842.5A CN112989437B (en) | 2021-04-23 | 2021-04-23 | OFD document processing method, transmission method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112989437A CN112989437A (en) | 2021-06-18 |
CN112989437B true CN112989437B (en) | 2021-08-13 |
Family
ID=76339866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110438842.5A Active CN112989437B (en) | 2021-04-23 | 2021-04-23 | OFD document processing method, transmission method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112989437B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113326674B (en) * | 2021-08-04 | 2021-11-09 | 江苏省质量和标准化研究院 | Character code extraction system and method for social credit code verification |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104834490A (en) * | 2015-05-08 | 2015-08-12 | 昆山百润科技有限公司 | Electronic seal based printing control system and method |
CN109831301A (en) * | 2017-11-23 | 2019-05-31 | 杭州天谷信息科技有限公司 | The electric endorsement method of pdf document and the sign test method of the electronic signature |
CN112347493A (en) * | 2020-11-04 | 2021-02-09 | 杭州天谷信息科技有限公司 | Encryption, decryption and graying method for OFD (office file) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109492696B (en) * | 2018-11-09 | 2021-05-25 | 上海信联信息发展股份有限公司 | Seal authenticity identification method, device and system |
-
2021
- 2021-04-23 CN CN202110438842.5A patent/CN112989437B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104834490A (en) * | 2015-05-08 | 2015-08-12 | 昆山百润科技有限公司 | Electronic seal based printing control system and method |
CN109831301A (en) * | 2017-11-23 | 2019-05-31 | 杭州天谷信息科技有限公司 | The electric endorsement method of pdf document and the sign test method of the electronic signature |
CN112347493A (en) * | 2020-11-04 | 2021-02-09 | 杭州天谷信息科技有限公司 | Encryption, decryption and graying method for OFD (office file) |
Non-Patent Citations (1)
Title |
---|
基于国产算法的OFD版式文件电子签章系统的设计与实现;周明;《中国优秀硕士论文全文数据库》;20200215(第2期);第7-12页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112989437A (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7636885B2 (en) | Method of determining Unicode values corresponding to the text in digital documents | |
US8732570B2 (en) | Non-symbolic data system for the automated completion of forms | |
US7707488B2 (en) | Analyzing lines to detect tables in documents | |
US20070124362A1 (en) | Extensible framework for handling different mark up language parsers and generators in a computing device | |
CN112686015A (en) | Chart generation method, device, equipment and storage medium | |
CN112989437B (en) | OFD document processing method, transmission method and system | |
CN104902124A (en) | Image processing apparatus, image processing method | |
CN114707180B (en) | Log desensitization method and device | |
CN113986822A (en) | Method and system for converting format of value-added tax electronic invoice | |
US7263656B2 (en) | Method and device for scheduling, generating and processing a document comprising blocks of information | |
CN113297425B (en) | Document conversion method, device, server and storage medium | |
CN116384356A (en) | Method, device, equipment and medium for creating form row of OFD file | |
CN111125008A (en) | Dynamic repairing method and system of abnormal inode and related components | |
CN117289905B (en) | Application software development method and device, storage medium and electronic equipment | |
US9218327B2 (en) | Optimizing the layout of electronic documents by reducing presentation size of content within document sections so that when combined a plurality of document sections fit within a page | |
CN114330245A (en) | OFD document processing method and device | |
CN113064556A (en) | BIOS data storage method, device, equipment and storage medium | |
CN111783482A (en) | Text translation method and device, computer equipment and storage medium | |
US11928184B2 (en) | Generation of a second object model based on a first object model for use in object matching | |
CN112558894B (en) | Canvas-based dynamic webpage printing method, system and storage medium | |
CN112069549B (en) | Method and system for downloading picture when Bootstrap-table plug-in exports table | |
CN109948123B (en) | Image merging method and device | |
CN113849470A (en) | Method and system for extracting electronic seal based on electronic invoice OFD file | |
JP4958868B2 (en) | Document feature extraction apparatus and method | |
CN112131337A (en) | Method, device and system for processing unstructured data and storage medium |
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 |