CN-122019492-A - Conversion method and conversion system of OFD format file
Abstract
The application relates to the technical field of file processing, in particular to a conversion method of an OFD format file and a conversion system of the OFD format file. The method for converting the OFD format file comprises the steps of receiving and decompressing the OFD file to obtain a file catalog, initializing a WORD document, obtaining font resources and embedding the WORD document, obtaining a page sequence from the file catalog, generating a drawing page in the WORD document according to page information, identifying OFD elements and obtaining attribute information, generating WORD content in the drawing page by utilizing the attribute information, obtaining an electronic signature picture and page information, inserting the electronic signature picture in the drawing page according to the page information, obtaining metadata information and storing the metadata information in the WORD document, and outputting the converted WORD document. By the method for converting the OFD format file, the non-editable OFD file can be converted into the editable WORD file.
Inventors
- WANG YATAO
- SHI KUNXIANG
- WANG HONGTAO
- DENG XIONG
Assignees
- 华测检测认证集团股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251230
Claims (10)
- 1. A method for converting an OFD format file, comprising: the file input interface receives and decompresses the OFD file to obtain a file catalog, and the document output engine initializes the WORD document; the content analysis unit acquires font resources from the file catalogue and sends the font resources to the document output engine, and the document output engine receives and embeds the font resources into the WORD document; The content analysis unit acquires a page sequence from the file catalog and sends the page sequence to the document output engine, and the document output engine receives the page sequence and sequentially generates corresponding drawing pages in the WORD document according to page information in the page sequence; the content analysis unit identifies OFD elements in the page sequence, acquires attribute information of the OFD elements and sends the attribute information to the document output engine, and the document output engine generates WORD content in the drawing page corresponding to the OFD elements by utilizing the attribute information, wherein the WORD content corresponds to the OFD elements one by one; The signature processing unit calls an electronic signature catalog and the page sequence in the file catalog, acquires and sends an electronic signature picture and the page information corresponding to the electronic signature picture to the document output engine, and the document output engine inserts the electronic signature picture into the corresponding drawing page according to the page information corresponding to the electronic signature picture; the content analysis unit acquires metadata information in the file catalog and sends the metadata information to the document output engine, and the document output engine stores the metadata information into the WORD document; The document output engine outputs the WORD document whose conversion is completed.
- 2. The method for converting an OFD format file according to claim 1, wherein said acquiring and transmitting the electronic signature picture and the page information corresponding thereto to the document output engine comprises: And acquiring the electronic signature picture from the electronic signature catalog, acquiring the page information corresponding to the electronic signature picture from the page sequence, and transmitting the electronic signature picture and the page information corresponding to the electronic signature picture to the document output engine.
- 3. The method of converting an OFD format file according to claim 1, wherein the document output engine receiving and embedding the font resource into the WORD document comprises: And the document output engine receives and converts the OpenType fonts in the font resources into Type0 fonts, and embeds the Type0 fonts into the WORD document.
- 4. The method for converting an OFD format file according to claim 1, wherein sequentially generating the corresponding drawn pages in the WORD document according to the page information in the page sequence includes: and the document output engine sequentially generates the drawing pages in the WORD document in millimeter units according to the physical size in the page information.
- 5. The OFD format file conversion method according to claim 1, wherein the OFD element includes at least one of a text element, a path element, and an image element.
- 6. The method according to claim 5, wherein the attribute information includes at least one of a position, a size, and a transformation matrix of the OFD element; The document output engine generating WORD content in the drawn page corresponding to the OFD element using the attribute information includes: The document output engine sets drawing parameters based on at least one of the position, the size and the transformation matrix of the OFD element, and draws the WORD content at a specified position in the WORD document according to the drawing parameters, wherein the WORD content comprises at least one of text, graphics and images.
- 7. The method according to claim 5, wherein the document output engine inserting the electronic signature picture in the corresponding drawing page according to the page information corresponding to the electronic signature picture comprises: And the document output engine extracts the attribute of the electronic signature picture from the page information, sets a drawing matrix according to the attribute of the electronic signature picture, and inserts the electronic signature picture into the corresponding drawing page by utilizing the drawing matrix.
- 8. The method of claim 1, wherein the metadata information includes at least one of creator, creation time, last modifier, last modification time, author, title, theme, keywords, user-defined metadata.
- 9. The method for converting an OFD format file according to claim 1, wherein before the file input interface receives and decompresses the OFD file to obtain a file directory, the method comprises: The file input interface, the document output engine, the content analysis unit and the signature processing unit are constructed, and the file input interface, the document output engine, the content analysis unit and the signature processing unit are connected through network data.
- 10. A conversion system of an OFD format file for performing the conversion method of an OFD format file according to any one of claims 1 to 9, characterized in that the conversion system (100) of an OFD format file comprises: a file input interface (101) for receiving and decompressing the OFD file to obtain a file directory; the content analysis unit (102) is used for acquiring font resources, page sequences and metadata information from the file catalogue and sending the font resources, the page sequences and the metadata information, identifying OFD elements in the page sequences, and acquiring and sending attribute information of the OFD elements; The signature processing unit (103) is used for calling an electronic signature catalog and the page sequence in the file catalog, acquiring an electronic signature picture and the page information corresponding to the electronic signature picture from the electronic signature catalog and sending the electronic signature picture; The document output engine (104) is used for initializing a WORD document, receiving the font resource sent by the content analysis unit (102) and embedding the WORD document, receiving the page sequence sent by the content analysis unit (102) and sequentially generating corresponding drawing pages in the WORD document according to page information in the page sequence, receiving the attribute information sent by the content analysis unit (102), generating WORD content in the drawing pages corresponding to the OFD elements by utilizing the attribute information, receiving the electronic signature picture and the page information corresponding to the electronic signature picture sent by the signature processing unit (103), inserting the electronic signature picture in the corresponding drawing pages according to the page information corresponding to the electronic signature picture, receiving the metadata information sent by the content analysis unit (102) and storing the metadata information in the WORD document, and outputting the converted WORD document.
Description
Conversion method and conversion system of OFD format file Technical Field The application relates to the technical field of file processing, in particular to a conversion method of an OFD format file and a conversion system of the OFD format file. Background The OFD is a format file format standard, is called as Open Fixed-layout Document, is abbreviated as OFD, has the characteristics of Fixed layout, independent controllability, safe encryption and the like, is mainly applied to the fields of electronic documents, electronic notes, electronic files, electronic certificates, government purchasing and the like, and can ensure that the display effect of the documents in different devices and software is consistent due to the Fixed format characteristic. However, the existing OFD file needs to be opened by special software on a computer and cannot be edited and modified, so that the application of the OFD file is greatly limited. Compared with the OFD format, WORD (Microsoft Word) is a streaming file format developed for many years, many operating systems and browsers are preloaded with components of the WORD document, and the method is more convenient when the content of the file needs to be edited, but no means for conveniently converting the OFD format file into the WORD document exists at present. Disclosure of Invention In view of this, the present application provides a conversion method of an OFD format file and a conversion system of an OFD format file, which can convert the OFD format file into an editable WORD format. In order to solve the technical problems, the application provides a conversion method of an OFD format file, which comprises the steps of receiving and decompressing the OFD format file through a file input interface to obtain a file catalog, initializing a WORD document through a document output engine, acquiring font resources from the file catalog by a content analysis unit and sending the font resources to the document output engine, receiving and embedding the font resources into the WORD document, acquiring a page sequence from the file catalog by the content analysis unit and sending the page sequence to the document output engine, receiving the page sequence by the document output engine and sequentially generating corresponding drawing pages in the WORD document according to page information in the page sequence, identifying OFD elements in the page sequence by the content analysis unit and acquiring attribute information of the OFD elements to the document output engine, generating WORD contents in the document output engine corresponding to the OFD elements by the attribute information, sending the WORD contents to the document output engine corresponding to the signature processing unit, calling the electronic signature to the electronic document in the file catalog and sending the electronic signature information to the document output unit, sending the electronic signature information to the document output unit, the document output engine stores the metadata information into the WORD document, and the document output engine outputs the converted WORD document. In a specific embodiment, the step of acquiring and transmitting the electronic signature picture and the page information corresponding to the electronic signature picture to the document output engine comprises the steps of acquiring the electronic signature picture from the electronic signature catalog, acquiring the page information corresponding to the electronic signature picture from the page sequence, and transmitting the electronic signature picture and the page information corresponding to the electronic signature picture to the document output engine. In one embodiment, the receiving and embedding the font resource into the WORD document by the document output engine includes receiving and converting an OpenType font in the font resource into a Type0 font by the document output engine and embedding the Type0 font into the WORD document. In a specific embodiment, the sequentially generating the corresponding drawing pages in the WORD document according to the page information in the page sequence comprises the step that the document output engine sequentially generates the drawing pages in the WORD document in millimeter units according to the physical size in the page information. In a specific embodiment, the OFD element includes at least one of a text element, a path element, and an image element. In a specific embodiment, the attribute information comprises at least one of the position, the size and the transformation matrix of the OFD element, and the document output engine generating WORD content in the drawing page corresponding to the OFD element by utilizing the attribute information comprises setting drawing parameters by the document output engine based on at least one of the position, the size and the transformation matrix of the OFD element, and drawing the WORD content at a specified posit