CN109977088A - A kind of method that preset format file is converted to OFD format - Google Patents
A kind of method that preset format file is converted to OFD format Download PDFInfo
- Publication number
- CN109977088A CN109977088A CN201910254073.6A CN201910254073A CN109977088A CN 109977088 A CN109977088 A CN 109977088A CN 201910254073 A CN201910254073 A CN 201910254073A CN 109977088 A CN109977088 A CN 109977088A
- Authority
- CN
- China
- Prior art keywords
- format
- ofd
- document
- converted
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 239000000284 extract Substances 0.000 claims abstract description 15
- 230000008569 process Effects 0.000 claims description 9
- 238000009877 rendering Methods 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 239000000203 mixture Substances 0.000 claims description 3
- 239000000126 substance Substances 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Document Processing Apparatus (AREA)
Abstract
A kind of method that preset format file is converted to OFD format, comprising: S1, input have the template document of preset format;Above-mentioned template document is converted to OFD format file by S2;S3, the location data from above-mentioned template document, is deleted, and retains slot position, thus generates OFD template file;S4, input meet the document to be converted of preset format;S5 extracts the data of document to be converted in above-mentioned S4, and OFD template file described in S3 is written, and generates the output document of OFD format.The present invention can parse the document of all kinds of preset formats, reduce the format limited degree of input document.The data that the present invention utilizes template document to generate OFD template, extract input document, so that the OFD document layout uniform format generated, visuality are more preferable, conveniently electronic document is managed collectively and is operated.
Description
Technical field
This application involves the sides that file layout change-over method more particularly to a kind of preset format file are converted to OFD format
Method.
Background technique
OFD, the english abbreviation of open format document (Open Fixed-layout Document) are country's marks in 2016
" electronic document storage and exchange format format document " standard of Zhun Hua administration committee approval publication.
Format document is an important class of electronic document application, is one of common basic office documents, has
The presentation feature of master former formula, i.e. reading display is consistent with printing effect, truly maintains text, figure at the beginning of document generates
The layout informations such as table, color, display and printing effect with high-fidelity.
For from application, due to not seeking unity of standard before, domestic electronic document format applicable cases ichthyosauru
Mix, format disunity, access interface is inconsistent, imperfect to the support of application demand.And electronic document information interchange intercommunication,
The application demand of long term archival is urgent.For the process demand of domestic electronic document, the built-in individual features supports of OFD standard.
First, OFD standard can support domestic cryptographic algorithm, this is not only the primary condition that file has legal effect, also enhance pair
Control of safety, including encryption, signature, permission control etc.;Second, the OFD standard formulated based on XML standard, have compared with
High readability, comprehensibility, scalability, and format is open;Third, OFD support to need to carry out according to each field semantic
Index extension, that is out the functions of simple form format, have in depth been bonded application demand;4th, OFD standard are by government master
Pipe mechanism, academic expert, manufacturer, enterprise, industry user participate and draw jointly, and there is extensive Social support degree and industry to approve
Degree;5th, compared to the standard of external format document PDF, the structure of OFD is apparent, simpler.Therefore, based on the numerous of OFD
Advantage, the ideal document format that OFD will become electronic document publication, propagate and achieve.
OFD format is needed comprising display style information, and the common format document format such as xml, csv, excel only includes number
According to content, not Show Styles.Therefore OFD format cannot be converted directly into.Based on this background, this programme proposes a kind of preset format text
The method that part is converted to OFD format.All kinds of common format documents can be converted to OFD document by this method, and transfer efficiency has
It is obviously improved.
Summary of the invention
This programme parses all kinds of documents for having fixed regular format, generates the OFD fixed form of document, and rear
OFD document directly is generated with OFD fixed form in continuous use.It eliminates and is largely manually entered, reduce document organization work
Labor intensity.
In order to realize object of the present invention, the present invention provides a kind of preset format files to be converted to OFD format
Method, comprising:
S1, input have the template document of preset format;
Above-mentioned template document is converted to OFD format file by S2;
S3, the location data from above-mentioned template document, is deleted, and retains slot position, thus generates OFD template file;
S4, input meet the document to be converted of preset format;
S5 extracts the data of document to be converted in above-mentioned S4, and OFD template file described in S3 is written, and generates OFD format
Export document.
Wherein, the preset format described in S1 and S4 refer to it is any it is being parsed by computer or manually, have fixation
The format of rule, including but not limited to xml format, html format, csv format, excel, relational database, chart database.
Wherein, in step s 2, the preset format of above-mentioned template document is converted into OFD format using A method.A method
Including manually converting, manually utilize software conversion, software automatic conversion.
Wherein, in step s3, include: using the process that OFD format file described in S2 generates OFD template file
S301 positions data described in S3 from the template document, is deleted, and retain slot position;
S302, the text location information of the data according to S301, calculates the rendering parameter suitable for all data;
The displaying pattern of slot position is arranged in S303, the rendering parameter described in S303, and the slot position of the displaying pattern should be for rear
Continuous step inserts new data, i.e. generation OFD template file.
Wherein, in step s 5, the process of the output document of generation OFD format includes:
S501 extracts its data from document to be converted described in S4;
Data described in S501 are respectively filled in slot position described in S303 by S502, generate the data as described in S501 and
The new document of the composition of OFD template file described in S303, i.e. OFD format described in S5 export document.
The present invention is include at least the following beneficial effects: the present invention can parse the document of all kinds of preset formats, reduce
Input the format limited degree of document.The data that the present invention generates OFD template using template document, extracts input document, so that
OFD document layout uniform format, the visuality of generation are more preferable, conveniently electronic document is managed collectively and is operated.
Detailed description of the invention
Fig. 1 is flow diagram of the invention.
Specific embodiment
Understand for the ease of those of ordinary skill in the art and implement the present invention, the present invention is done below further detailed
Description, it should be understood that implementation example described herein is only used for describing and explaining invention, is not intended to limit the present invention.
[embodiment 1]
Such as Fig. 1, due to preset format huge number, this implementation example is illustrated by taking xml format as an example turns xml format file
The method for being changed to OFD, comprising the following steps:
S1 inputs xml template document, and is converted to OFD document;
S2 positions the data of xml template document in S1, and xml template document content is divided into content to be replaced and fixation
Hold.Content to be replaced is deleted, retains immobilized substance, that is, forms slot position.And thus generate OFD template file;
S3 inputs xml document to be converted;
S4 extracts the data of xml document described in S3, inserts in the slot position of OFD template file described in S2;
S5 generates the output document of OFD format.
Specifically, in S1, xml, which refers to, can be used to transmit data, the extensible markup language of storing data.Due to xml
By data structured, therefore when exchanging data, xml can be compatible with not homologous ray and can be read by distinct program.
Specifically, in step S1, xml template document is converted into OFD format file using homemade tool.
Specifically, the process of generation OFD template file includes: in step S2
S201 calls parse () method in python kit ElementTree to obtain the analytic tree of xml document;
S202 recalls the root node that getroot () method obtains analytic tree;
203, root node is positioned by using the find_element_by_xpath () method of xpath language, then by path
(path) or (steps) is walked to choose each child node, and the text of child node is obtained by the text attribute of access child node,
That is location data;
Data to be replaced are deleted, and retain fixed data by S204, then by manually calculating suitable for the logical of each data
With rendering parameter, the displaying pattern of OFD template file is set with this;
S205 generates OFD template file.
Specifically, data are extracted in step S4 and insert the process of slot position includes:
S401 extracts the data of xml document described in S3 using method described in S201, S202, S203 as above;
S402 judges slot position belonging to data described in S401;
S403 respectively inserts data described in S401 in the slot position of OFD template file described in S2.
[embodiment 2]
Since data source is numerous, this implementation example illustrates the side that the data of lane database are converted to OFD by taking sql as an example
Method, comprising the following steps:
S1 extracts the sql data for having preset format;
S2 extracts the sql data of required field in S1, forms the immobilized substance of ODF template file, i.e. slot position.And retain
The slot position of content to be replaced.OFD template file is generated as a result,;
S3 extracts sql data to be converted;
S4 inserts sql data described in S3 in the slot position of OFD template file described in S2;
S5 generates the output document of OFD format.
Specifically, in S1, sql data refer to database can be inquired with sql sentence obtained from data.
Specifically, data are extracted in step S4 and insert the process of slot position includes:
S401 judges slot position belonging to sql data described in S3;
S402 respectively inserts data described in S401 in the slot position of OFD template file described in S2.
[embodiment 3]
Due to preset format huge number, this implementation example illustrates by taking csv format as an example and is converted to csv format file
The method of OFD, comprising the following steps:
S1 inputs csv template document, and is converted to OFD document;
S2 extracts the data of field needed for csv template document in S1, csv template document content is divided into content to be replaced
And immobilized substance.Content to be replaced is deleted, retains immobilized substance, that is, forms slot position.And thus generate OFD template file;
S3 inputs csv document to be converted;
S4 extracts the data to be replaced of csv document described in S3, inserts in the slot position of OFD template file described in S2;
S5 generates the output document of OFD format.
Specifically, in S1, csv document refers to the list data stored with plain text.
Specifically, data are extracted in step S4 and insert the process of slot position includes:
S401 extracts the data of csv document described in S3 using method described in S2 as above;
S402 judges slot position belonging to data described in S401;
S403 respectively inserts data described in S401 in the slot position of OFD template file described in S2.
It is obvious to a person skilled in the art that the invention patent is not limited to the details of above-mentioned exemplary embodiment, and
And without departing substantially from the spirit or essential attributes of the invention patent, the present invention can be realized in other specific forms specially
Benefit.Therefore, in all respects, the present embodiments are to be considered as illustrative and not restrictive, the present invention is special
Benefit range be indicated by the appended claims rather than the foregoing description, it is intended that by fall in claim containing with important document
All changes in justice and range are included in the invention patent.It should not treat any reference in the claims as limiting
Related claim.
Claims (5)
1. a kind of method that preset format file is converted to OFD format, which comprises the steps of:
S1, input have the template document of preset format;
Above-mentioned template document is converted to OFD format file by S2;
S3, the location data from above-mentioned template document, is deleted, and retains slot position, thus generates OFD template file;
S4, input meet the document to be converted of preset format;
S5 extracts the data of document to be converted in above-mentioned S4, and OFD template file described in S3 is written, and generates the output of OFD format
Document.
2. the method that a kind of preset format file according to claim 1 is converted to OFD format, it is characterised in that: in step
Preset format described in rapid S1 and S4 refers to any format can parse by computer or manually, inerratic, wraps
Include but be not limited to xml format, html format, csv format, excel, relational database, chart database.
3. the method that a kind of preset format file according to claim 1 is converted to OFD format, it is characterised in that: in step
In rapid S2, the preset format of above-mentioned template document is converted into OFD format using A method;A method include manually conversion,
Manually utilize software conversion, software automatic conversion.
4. the method that a kind of preset format file according to claim 1 is converted to OFD format, it is characterised in that: in step
In rapid S3, include: using the process that OFD format file described in S2 generates OFD template file
S301 positions data described in S3 from the template document, is deleted, and retain slot position;
S302, the text location information of the data according to S301, calculates the rendering parameter suitable for all data;
S303, the rendering parameter described in S303 are arranged the displaying pattern of slot position, show that the slot position of pattern should be for subsequent step
New data are inserted, i.e. generation OFD template file.
5. the method that a kind of preset format file according to claim 1 is converted to OFD format, it is characterised in that:, in step
In rapid S5, the process for generating the output document of OFD format includes:
S501 extracts its data from document to be converted described in S4;
Data described in S501 are respectively filled in slot position described in S303, generate the data as described in S501 and S303 institute by S502
The new document for the OFD template file composition stated, i.e. OFD format described in S5 export document.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910254073.6A CN109977088A (en) | 2019-03-30 | 2019-03-30 | A kind of method that preset format file is converted to OFD format |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910254073.6A CN109977088A (en) | 2019-03-30 | 2019-03-30 | A kind of method that preset format file is converted to OFD format |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109977088A true CN109977088A (en) | 2019-07-05 |
Family
ID=67081883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910254073.6A Pending CN109977088A (en) | 2019-03-30 | 2019-03-30 | A kind of method that preset format file is converted to OFD format |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109977088A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110717127A (en) * | 2019-10-14 | 2020-01-21 | 北京华宇信息技术有限公司 | Method and device for on-line analysis and browsing of OFD (office file) |
CN111126005A (en) * | 2019-12-24 | 2020-05-08 | 广州众鑫达科技有限公司 | AFM file processing method, electronic device and storage medium |
CN111178022A (en) * | 2019-12-23 | 2020-05-19 | 北京航天云路有限公司 | Two-dimensional chart data standardized format definition and implementation method |
CN111767698A (en) * | 2020-07-07 | 2020-10-13 | 江苏中威科技软件系统有限公司 | Electronic form system based on OFD format file technology |
CN111797595A (en) * | 2020-05-18 | 2020-10-20 | 冠群信息技术(南京)有限公司 | Method and device for generating OFD format page based on XML template |
CN111881651A (en) * | 2020-08-06 | 2020-11-03 | 泰山信息科技有限公司 | Method for converting UOT streaming document into OFD format document |
CN111898433A (en) * | 2020-06-22 | 2020-11-06 | 百望股份有限公司 | Paper bill digitization method and device |
CN111897776A (en) * | 2020-06-22 | 2020-11-06 | 百望股份有限公司 | OFD document processing method, electronic device and computer-readable storage medium |
CN114185855A (en) * | 2022-02-15 | 2022-03-15 | 中博信息技术研究院有限公司 | Simplified method and system for generating OFD file based on JSON |
CN115376153A (en) * | 2022-08-31 | 2022-11-22 | 南京擎盾信息科技有限公司 | Contract comparison method and device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013008172A (en) * | 2011-06-24 | 2013-01-10 | Canon Inc | Format conversion device, method and program |
CN105007539A (en) * | 2015-07-17 | 2015-10-28 | 孙巍 | HTML template-based method, equipment and system for releasing graphics and text information via television |
CN108038095A (en) * | 2017-12-15 | 2018-05-15 | 四川汉科计算机信息技术有限公司 | A kind of document automatic creation method |
CN108415887A (en) * | 2018-02-09 | 2018-08-17 | 武汉大学 | A kind of method that pdf document is converted to OFD files |
-
2019
- 2019-03-30 CN CN201910254073.6A patent/CN109977088A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013008172A (en) * | 2011-06-24 | 2013-01-10 | Canon Inc | Format conversion device, method and program |
CN105007539A (en) * | 2015-07-17 | 2015-10-28 | 孙巍 | HTML template-based method, equipment and system for releasing graphics and text information via television |
CN108038095A (en) * | 2017-12-15 | 2018-05-15 | 四川汉科计算机信息技术有限公司 | A kind of document automatic creation method |
CN108415887A (en) * | 2018-02-09 | 2018-08-17 | 武汉大学 | A kind of method that pdf document is converted to OFD files |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110717127A (en) * | 2019-10-14 | 2020-01-21 | 北京华宇信息技术有限公司 | Method and device for on-line analysis and browsing of OFD (office file) |
CN111178022A (en) * | 2019-12-23 | 2020-05-19 | 北京航天云路有限公司 | Two-dimensional chart data standardized format definition and implementation method |
CN111126005A (en) * | 2019-12-24 | 2020-05-08 | 广州众鑫达科技有限公司 | AFM file processing method, electronic device and storage medium |
CN111797595A (en) * | 2020-05-18 | 2020-10-20 | 冠群信息技术(南京)有限公司 | Method and device for generating OFD format page based on XML template |
CN111897776A (en) * | 2020-06-22 | 2020-11-06 | 百望股份有限公司 | OFD document processing method, electronic device and computer-readable storage medium |
CN111898433B (en) * | 2020-06-22 | 2024-04-09 | 百望股份有限公司 | Paper bill digitizing method and device |
CN111898433A (en) * | 2020-06-22 | 2020-11-06 | 百望股份有限公司 | Paper bill digitization method and device |
CN111767698A (en) * | 2020-07-07 | 2020-10-13 | 江苏中威科技软件系统有限公司 | Electronic form system based on OFD format file technology |
CN111767698B (en) * | 2020-07-07 | 2021-02-05 | 江苏中威科技软件系统有限公司 | Electronic form system based on OFD format file technology |
CN111881651A (en) * | 2020-08-06 | 2020-11-03 | 泰山信息科技有限公司 | Method for converting UOT streaming document into OFD format document |
CN114185855A (en) * | 2022-02-15 | 2022-03-15 | 中博信息技术研究院有限公司 | Simplified method and system for generating OFD file based on JSON |
CN114185855B (en) * | 2022-02-15 | 2022-05-24 | 中博信息技术研究院有限公司 | Simplified method and system for generating OFD file based on JSON |
CN115376153A (en) * | 2022-08-31 | 2022-11-22 | 南京擎盾信息科技有限公司 | Contract comparison method and device and storage medium |
CN115376153B (en) * | 2022-08-31 | 2024-05-17 | 南京擎盾信息科技有限公司 | Contract comparison method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109977088A (en) | A kind of method that preset format file is converted to OFD format | |
CN104361139B (en) | Data importing device and method | |
CN107145480B (en) | Method for compiling XBRL report based on Word | |
CN101989256B (en) | Typesetting method of document file and device | |
CN110543303B (en) | Visual service platform | |
CN109857670B (en) | Test report automatic generation method based on universal template | |
CN104881275A (en) | Electronic spreadsheet generating method and device | |
CN101944082A (en) | Excel-like report processing method | |
WO2020149501A1 (en) | System and method for braille conversion for electronic document | |
CN103778172A (en) | Examination paper information storing method and examination paper editing method and system | |
CN106339363A (en) | PPT report making method and device | |
CN103530407A (en) | Method and device for generating rich text document | |
CN103678268A (en) | Automatic typesetting method and device for official documents | |
CN103617496A (en) | Informatization report automatic generating method and system | |
CN102467496B (en) | Method and device for converting stream mode typeset content into block mode typeset document | |
CN102866986A (en) | Document format conversion system | |
CN104298705A (en) | Converting method of relational data and unstructured data | |
KR102126342B1 (en) | Electronic document braille translation system and a method therefor | |
CN105988986A (en) | Information processing method and device | |
CN102043769A (en) | Method and device for editing documents | |
CN101996161B (en) | A kind of old version data processing method of electronic document and device | |
CN105930315A (en) | Patent application file annotation system and method | |
US20080005132A1 (en) | Method and system for describing and storing bursting metadata in a content management system | |
US10120845B1 (en) | Systems and methods for updating subsets of elements of electronic documents | |
CN1036092A (en) | A kind of Computerized automatic tabulation method and system thereof |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190705 |
|
RJ01 | Rejection of invention patent application after publication |