CN116340271B - Opening method and device of open format document, electronic equipment and storage medium - Google Patents

Opening method and device of open format document, electronic equipment and storage medium Download PDF

Info

Publication number
CN116340271B
CN116340271B CN202310603016.0A CN202310603016A CN116340271B CN 116340271 B CN116340271 B CN 116340271B CN 202310603016 A CN202310603016 A CN 202310603016A CN 116340271 B CN116340271 B CN 116340271B
Authority
CN
China
Prior art keywords
graphic element
element data
file
ofd
document
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
Application number
CN202310603016.0A
Other languages
Chinese (zh)
Other versions
CN116340271A (en
Inventor
刘艺伟
杨雪峰
方俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuxin Kunpeng Beijing Information Technology Co ltd
Original Assignee
Fuxin Kunpeng Beijing Information Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fuxin Kunpeng Beijing Information Technology Co ltd filed Critical Fuxin Kunpeng Beijing Information Technology Co ltd
Priority to CN202310603016.0A priority Critical patent/CN116340271B/en
Publication of CN116340271A publication Critical patent/CN116340271A/en
Application granted granted Critical
Publication of CN116340271B publication Critical patent/CN116340271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/44Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides an opening method, an opening device, electronic equipment and a storage medium of an open format document, and relates to the technical field of open format document processing, wherein the method comprises the following steps: extracting graphic element data and non-graphic element data in an original file; converting the graphic element data into a binary file; and opening an open format document corresponding to the original file based on the binary file and the non-graphic element data. According to the method, the graphic element data are converted into the binary files, and the binary files do not need to be further processed by a computer, so that the graphic element data are rendered based on the binary files, the rendering time of the OFD document is greatly shortened, and the opening efficiency of the OFD document containing the graphic element data is improved.

Description

Opening method and device of open format document, electronic equipment and storage medium
Technical Field
The present application relates to the field of open format document processing technologies, and in particular, to an open format document opening method and apparatus, an electronic device, and a storage medium.
Background
An Open-layout Document (OFD) is an Open electronic Document format, and has the characteristics of rich layout, being capable of embedding multimedia, and the like, so that the OFD Document is used in more and more fields. From the electronic archives field, electronic signature field, daily government affairs field gradually popularizes to each big engineering field, and OFD file gradually becomes the information carrier that contains many graphic element data such as engineering file, engineering drawing.
In the related art, when an OFD document containing multiple graphic element data is opened, rendering the graphic element data consumes a lot of time, resulting in long time for opening the OFD document and affecting user experience.
Therefore, how to improve the rendering efficiency of the OFD document, so that the user can quickly open the OFD document containing the multi-graphic-element data is a problem to be solved at present.
Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the application provides an opening method and device of an open format document, electronic equipment and a storage medium.
The application provides an opening method of an open format document, which comprises the following steps:
extracting graphic element data and non-graphic element data in an original file;
converting the graphic element data into a binary file;
and generating an OFD document corresponding to the original file based on the binary file and the non-graphic element data.
Optionally, the extracting the graphic element data and the non-graphic element data in the original file includes:
acquiring tag information in the original file, wherein the tag information is used for representing the data type of each data in the original file;
and extracting the graphic element data and the non-graphic element data based on the tag information.
Optionally, after the converting the graphic element data into the binary file, the method further includes:
and storing the binary file into an attachment folder in the OFD document structure.
Optionally, the binary file includes binary data corresponding to the graphic element data and page position information; the OFD document comprises a graphic element part and a non-graphic element part;
the opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data includes:
rendering the graphic element portion based on the binary data and the page position information;
rendering the non-graphic element portion based on the non-graphic element data;
and opening the OFD document based on the graphic element part and the non-graphic element part.
Optionally, the generating the non-graphic element part based on the non-graphic element data includes:
converting the non-graphic element data into an extensible markup language file;
rendering the non-graphical element portion based on the extensible markup language file.
The application also provides an opening device of the open format document, which comprises:
the extraction module is used for extracting graphic element data and non-graphic element data in the original file;
the conversion module is used for converting the graphic element data into binary files;
and the opening module is used for generating an OFD document corresponding to the original file based on the binary file and the non-graphic element data.
The application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the opening method of the open format document according to any one of the above when executing the program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of opening an open layout document as described in any of the above.
The application also provides a computer program product comprising a computer program which when executed by a processor implements a method of opening an open layout document as described in any one of the above.
According to the open format document opening method, device, electronic equipment and storage medium, the graphic element data and the non-graphic element data in the original file are extracted, and then the graphic element data are converted into the binary file, so that the binary file does not need to be further processed by a computer, the graphic element data are rendered based on the binary file, the time for rendering the OFD document is greatly shortened, the OFD document is rendered based on the binary file and the non-graphic element data, the rendering efficiency of the OFD document containing the multi-graphic element data is improved, and therefore a user can quickly open the OFD document containing the multi-graphic element data, and the user experience is improved.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a multi-graphic element data file provided by the present application;
FIG. 2 is a flow chart of a method for opening an open layout document according to the present application;
FIG. 3 is a second flow chart of the method for opening an open layout document according to the present application;
FIG. 4 is a third flow chart of the method for opening an open layout document according to the present application;
FIG. 5 is a flow chart of a method for rendering an open layout document provided by the present application;
FIG. 6 is a schematic diagram of an opening device for an open layout document provided by the present application;
fig. 7 is a schematic structural diagram of an electronic device provided by the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order to facilitate a clearer understanding of various embodiments of the present application, some relevant background knowledge is first presented as follows.
The OFD document solves the problem of non-uniform document format, so as to conveniently store, read and edit the electronic document.
In the related art, OFD describes graphic elements generally in the form of extensible markup language files (Extensible Markup Language, XML). Specifically, when describing the graphic elements by using an XML mode, the graphic element data of all the OFD files are stored in the XML files in the form of OFD graphic element objects, and the reader renders the graphic data to a reading area by analyzing the XML files during reading.
It should be noted that XML is an extensible markup language, a subset of a standard generic markup language, which can be used to mark data and define data types, and is a source language that allows a user to define his own markup language. The method has the advantages of more data, complex structure, slower analysis speed during display and numerous defects.
The method specifically comprises the following steps:
(1) The file becomes large:
for the multi-graphic element data file, which contains a large number of various graphic elements, graphic labels and the like, when the multi-graphic element data file is converted into an OFD, the graphic element data is converted into an XML complex type mode to describe, the XML complex type is stored in the OFD file, the data volume is huge, and the finally generated OFD file is much larger than the original file. FIG. 1 is a schematic diagram of a multi-graphic element data file provided by the present application; assume that the multi-graphic element data file shown in fig. 1 is a PDF file with a size of 150KB; when the PDF file is converted into an OFD document, the size becomes 250KB.
(2) The storage mode is complex:
in the related art, since the OFD document is described by means of an XML complex type, this is mainly used for a Region (Region) which is composed of a series of branch paths (areas), each of which is closed. The XML mode is used for representing the multi-graphic element data file, so that the conversion process is complex, time is consumed, and the storage mode is complex.
(3) The opening speed is slow:
in the related art, because the OFD document is described in an XML complex type manner, when reading and rendering, the XML document needs to be parsed according to the structure, and then the read character data is converted into binary data, so that the rendering process is quite time-consuming for documents containing a large amount of primitive data such as engineering drawings.
In summary, in order to improve the rendering efficiency of the OFD document, so that a user can quickly open the OFD document containing the multi-graphic-element data, and improve the user experience, the embodiment of the application provides an opening method and device of the open format document, electronic equipment and storage medium.
The method for opening the open layout document provided by the application is specifically described below with reference to fig. 2 to 6. Fig. 2 is one of the flow diagrams of the open layout document opening method provided by the present application, and referring to fig. 2, the method includes steps 201 to 203, where:
step 201, extracting graphic element data and non-graphic element data in an original file.
Firstly, it should be noted that the execution body of the present application may be any electronic device capable of implementing OFD document conversion, for example, any one of a smart phone, a smart watch, a desktop computer, a laptop computer, and the like.
In this embodiment, the format types of the original file are various, for example, a word file, a PDF file, a txt file, etc., and the present application does not limit the format types of the original file. That is, the method for opening the OFD document provided by the application can be suitable for a scene that non-OFD documents such as word and PDF containing multi-graphic element data are converted into OFD documents.
In order to improve the rendering efficiency of the OFD document, so that a user can quickly open the OFD document containing multi-graphic-element data, in the embodiment, firstly, graphic-element data and non-graphic-element data in an original file (such as an engineering drawing) are required to be extracted, and aiming at two different types of data, the application adopts different rendering modes, so that a computer can reduce the processing amount of the data, and the rendering efficiency of the OFD document is improved.
Step 202, converting the graphic element data into a binary file.
In this embodiment, the core idea is to change the storage mode of the graphic element data after converting the original file containing the multi-graphic element data into the OFD document, and reduce the file size, thereby realizing the goal of rapidly opening the OFD document containing the multi-graphic element data.
Specifically, after extracting the graphic element data and the non-graphic element data in the original file, the graphic element data needs to be identified first, and then the graphic element data is converted into a binary file.
In practical applications, there are various ways to convert the graphic element data into a binary file, for example, binary packaging is performed on the graphic element data based on a base64 database in python to generate the binary file; for another example, a pixel value of each pixel of the graphic element data is extracted, and the pixel value is converted into a binary, so that a binary file can be generated. The conversion mode of the binary file is not particularly limited in the present application.
And 203, opening an OFD document corresponding to the original file based on the binary file and the non-graphic element data.
In this embodiment, when rendering is performed based on the binary file and the non-graphic element data, the graphic element data is obtained and rendered by reading the binary file, and compared with the text file in the XML format, the read binary file can be directly put into the memory for use without further processing, thereby greatly shortening the time for rendering the file.
According to the open format document opening method, the graphic element data and the non-graphic element data in the original file are extracted, and then the graphic element data are converted into the binary file, so that the binary file does not need to be further processed by a computer, the graphic element data are rendered based on the binary file, the time for rendering the OFD document is greatly shortened, the OFD document is opened based on the binary file and the non-graphic element data, the rendering efficiency of the OFD document containing the multi-graphic element data is improved, and therefore a user can rapidly open the OFD document containing the multi-graphic element data, and the user experience is improved.
Optionally, the extracting the graphic element data and the non-graphic element data in the original file may be specifically implemented by the following steps [1] -step [ 2):
step [1], obtaining tag information in the original file, wherein the tag information is used for representing the data type of each data in the original file;
and step [2] extracting the graphic element data and the non-graphic element data based on the label information.
In this embodiment, the tag information that is carried in the original file and is used to characterize the data type of each data in the original file, and based on the tag information, the graphic element data and the non-graphic element data in the original file can be determined.
For example, in the original file, the graphic element data each carry tag information [ type1], and the non-graphic element data each carry tag information [ type2], i.e., in the original file [ type1] represents the graphic element data, and [ type2] represents the non-graphic element data.
For another example, in the original file, the graphic element data each carry tag information [ a ], and the non-graphic element data each carry tag information [ b ], i.e., in the original file [ a ] represents the graphic element data, and [ b ] represents the non-graphic element data.
In the embodiment, the graphic element data and the non-graphic element data in the original file can be extracted based on the label information, and different rendering modes are adopted for two different types of data, so that the processing amount of the graphic element data can be reduced by a computer, and the rendering efficiency of the OFD document is improved.
Optionally, the following steps are further required to be performed after the converting the graphic element data into the binary file:
and storing the binary file into an attachment folder in the OFD document structure.
In this embodiment, the graphic element data needs to be converted into a binary file. That is, each graphic of points, lines, rectangles, circles, and the like in the graphic element data is defined as a structure. When the OFD file is generated, the graphic element data is stored in a binary file with the corresponding structure.
At this time, the binary file is added to the OFD file in the form of an attachment. This way of storage can greatly reduce the amount of data and thus the file size. In addition, the data in the memory for calculation is stored in a binary format, so that the data is stored in the file more quickly by using the binary format.
It should be noted that the file name of the binary file is related to the page number of the graphic element data in the original file.
For example, the file of the binary file corresponding to the graphic element data a is named as "page0.Bin", which means that the graphic element data a is located on page0 of the original file;
the file of the binary file corresponding to the graphic element data B is named "page1.Bin", indicating that the graphic element data B is located on page1 of the original file.
In practical application, the binary file is named as xxx. Bin, and stored in an attachment form to an attachment folder in an OFD document structure, and a corresponding attachment. Xml file is generated.
Alternatively, the attributes. Xml file may be represented by:
<?xml version=“1.0” encoding=“utf-8”?>
<ofd:Attachment xmlns:ofd=“http://www.ofdspec.org/2016”>
<ofd:Attachment ID=“38” Name=“page0.bin” Format=“bin”
CreationDate=“2023/3/27 11:14:52” ModDate=“2023/3/27
14:31:54” Size=“150807” Visible=“true” Usage=“none”>
<ofd:FileLoc>
Attachs/e0bdb62f00d94ebe926e74f2ef797elc.bin
</ofd:FileLoc>
</ofd:Attachment>
</ofd:Attachment ID=“40” Name=“page1.bin” Format=“bin”>
CreationDate=“2023/4/3 15:27:56” ModDate=“2023/4/3
16:02:25” Size=“73216” Visible=“true” Usage=“none”>
<ofd:FileLoc>
Attachs/65b9bf6fcbfe43cfab34c78754e98350.bin
</ofd:FileLoc>
</ofd:Attachment>
</ofd:Attachments>
in the above embodiment, by storing the binary file in the form of an attachment in the attachment folder of the OFD file, this storage manner can greatly reduce the data amount of the graphic element data, thereby reducing the file size. The file size is reduced, so that the efficiency of processing data by the computer can be improved.
Optionally, the binary file includes binary data corresponding to the graphic element data and page position information; the OFD document includes a graphic element portion and a non-graphic element portion.
Specifically, page position information, that is, file naming of binary files corresponding to the graphic element data mentioned above, based on the file naming, the position of the graphic element data in the original file can be determined.
The opening of the OFD document corresponding to the original file based on the binary file and the non-graphic element data may be specifically realized by the following steps [1] to [3 ]:
step [1], rendering the graphic element part based on the binary data and the page position information.
In practical application, in the process of performing OFD document conversion on an original file, it is first required to check whether a binary file named as "xxx.bin" is contained in an Attachs folder, if so, the "xxx.bin" binary file is read, and the graphic element data is rendered to a corresponding page position according to page position information (i.e. related page number of the graphic element data in the original file) in the file naming.
And step [2], rendering the non-graphic element part based on the non-graphic element data.
Specifically, other data (i.e., non-graphic element data) except the graphic element data needs to be rendered according to the standard conversion mode of the OFD document to generate a non-graphic element part.
And step [3] opening the OFD document based on the graphic element part and the non-graphic element part.
In the above embodiment, based on the binary data and the page position information, the graphic element portion is rendered, and then based on the non-graphic element data, the non-graphic element portion is rendered, thereby realizing quick open browsing of the OFD document containing the multi-graphic element data.
Optionally, the rendering the non-graphic element part based on the non-graphic element data may be specifically implemented by the following steps [1] -step [ 2):
step [1], convert the said non-graphic element data into the extensible markup language file;
and step [2], rendering the non-graphic element part based on the extensible markup language file.
In this embodiment, when rendering the non-graphic element data, the data structure of the non-graphic element data needs to be parsed, converted into an XML file, and then converted into binary data, thereby rendering the non-graphic element portion of the OFD document.
In the embodiment, different rendering modes are adopted for two different types of data, so that the processing amount of the graphic element data can be reduced by a computer, the rendering efficiency of the OFD document is improved, and the OFD document containing the multi-graphic element data can be opened quickly.
FIG. 3 is a second flowchart of the method for opening an open layout document according to the present application, as shown in FIG. 3, including steps 301 to 307:
step 301, obtaining tag information in an original file, wherein the tag information is used for representing data types of various data in the original file.
And 302, extracting graphic element data and non-graphic element data based on the label information.
Step 303, converting the graphic element data into a binary file.
Step 304, storing the binary file into an attachment folder in the OFD document structure.
And 305, rendering the graphic element part in the OFD document based on binary data corresponding to the graphic element data in the attachment folder and page position information.
Step 306, converting the non-graphic element data into an extensible markup language file.
Step 307, rendering the non-graphic element part in the OFD document based on the extensible markup language file.
It should be noted that the execution sequence of step 305 and steps 306 to 307 is not sequential.
Step 308, opening the OFD document based on the graphic element part and the non-graphic element part.
According to the open format document opening method, the graphic element data and the non-graphic element data in the original file are extracted, and then the graphic element data are converted into the binary file, so that the binary file does not need to be further processed by a computer, the graphic element data are rendered based on the binary file, the time for rendering the OFD document is greatly shortened, the OFD document is rendered based on the binary file and the non-graphic element data, the rendering efficiency of the OFD document is improved, and therefore a user can quickly open the OFD document containing multiple graphic element data, and the user experience is improved.
FIG. 4 is a third flow chart of the method for opening an open layout document according to the present application, as shown in FIG. 4, including steps 401 to 406:
step 401, obtaining an original file.
Step 402, judging whether the original file contains graphic element data. If yes, go to step 403, if no, go to step 404.
Step 403, saving the graphic element data as a binary file, wherein the file naming is related to the page number of the graphic element data in the original file.
And step 404, normally converting the original file into an OFD file according to an OFD standard.
And step 405, converting the data except the graphic element data into an OFD file according to an OFD standard.
Step 406, adding the binary file into the OFD file in an accessory form.
Fig. 5 is a flowchart of a rendering method of an open layout document provided by the present application, as shown in fig. 5, including steps 501 to 505:
step 501, an OFD file is acquired.
Step 502, judging whether a binary file exists in an attachment folder of the OFD file. If yes, go to step 503; if not, go to step 504.
And step 503, according to the file naming of the binary file, rendering the graphic element data to the corresponding page position.
And step 504, normally rendering the OFD file according to the OFD standard.
Step 505, rendering other elements of the OFD.
The opening device of the open format document provided by the application is described below, and the opening device of the open format document described below and the opening method of the open format document described above can be referred to correspondingly. Fig. 6 is a schematic structural diagram of an open-format document opening device provided by the present application, and as shown in fig. 6, the open-format document opening device 600 includes: an extraction module 601, a conversion module 602, an opening module 603, wherein:
an extracting module 601, configured to extract graphic element data and non-graphic element data in an original file;
a conversion module 602, configured to convert the graphic element data into a binary file;
and an opening module 603, configured to open an OFD document corresponding to the original file based on the binary file and the non-graphic element data.
According to the open format document opening device provided by the application, the graphic element data and the non-graphic element data in the original file are extracted, and then the graphic element data are converted into the binary file, so that the binary file does not need to be further processed by a computer, the graphic element data are rendered based on the binary file, the time for rendering the OFD document is greatly shortened, the OFD document is rendered based on the binary file and the non-graphic element data, the rendering efficiency of the OFD document is improved, and therefore, a user can rapidly open the OFD document containing multiple graphic element data, and the user experience is improved.
Optionally, the extracting module 601 is further configured to:
acquiring tag information in the original file, wherein the tag information is used for representing the data type of each data in the original file;
and extracting the graphic element data and the non-graphic element data based on the tag information.
Optionally, the apparatus further comprises:
and the storage module is used for storing the binary file into an attachment folder in the OFD document structure.
Optionally, the binary file includes binary data corresponding to the graphic element data and page position information; the OFD document comprises a graphic element part and a non-graphic element part;
the opening module 603 is further configured to:
rendering the graphic element portion based on the binary data and the page position information;
rendering the non-graphic element portion based on the non-graphic element data;
and opening the OFD document based on the graphic element part and the non-graphic element part.
Optionally, the opening module 603 is further configured to:
converting the non-graphic element data into an extensible markup language file;
rendering the non-graphical element portion based on the extensible markup language file.
Fig. 7 illustrates a physical schematic diagram of an electronic device, as shown in fig. 7, which may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform a method of opening an open layout document, the method comprising: extracting graphic element data and non-graphic element data in an original file; converting the graphic element data into a binary file; and opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing a method of opening an open-format document provided by the methods described above, the method comprising: extracting graphic element data and non-graphic element data in an original file; converting the graphic element data into a binary file; and opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data.
In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of opening an open-layout document provided by the above methods, the method comprising: extracting graphic element data and non-graphic element data in an original file; converting the graphic element data into a binary file; and opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (6)

1. An opening method of an open format document OFD, comprising:
extracting graphic element data and non-graphic element data in an original file; the original file comprises engineering drawings; the original file is a non-OFD document; the graphic element data comprises a plurality of graphic elements;
converting the graphic element data into a binary file; the binary file comprises binary data corresponding to the graphic element data and page position information;
storing the binary file into an attachment folder in an OFD document structure;
opening an OFD document corresponding to the original file based on the binary file and the non-graphic element data; the OFD document comprises a graphic element part and a non-graphic element part;
wherein the converting the graphic element data into a binary file includes:
defining a structure body for each graphic element in the graphic element data, and storing the structure body corresponding to each graphic element in the binary file when the OFD document is generated;
the opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data includes:
rendering the graphic element portion based on the binary data and the page position information;
rendering the non-graphic element portion based on the non-graphic element data;
and opening the OFD document based on the graphic element part and the non-graphic element part.
2. The method for opening an open layout document OFD according to claim 1, wherein the extracting graphic element data and non-graphic element data in the original file comprises:
acquiring tag information in the original file, wherein the tag information is used for representing the data type of each data in the original file;
and extracting the graphic element data and the non-graphic element data based on the tag information.
3. The open method of an open layout document OFD according to claim 1, wherein the rendering the non-graphic element portion based on the non-graphic element data includes:
converting the non-graphic element data into an extensible markup language file;
rendering the non-graphical element portion based on the extensible markup language file.
4. An opening device of an open format document OFD, characterized by comprising:
the extraction module is used for extracting graphic element data and non-graphic element data in the original file; the original file comprises engineering drawings; the original file is a non-OFD document; the graphic element data comprises a plurality of graphic elements;
the conversion module is used for converting the graphic element data into binary files; the binary file comprises binary data corresponding to the graphic element data and page position information;
the storage module is used for storing the binary file into an attachment folder in an OFD document structure;
the opening module is used for opening the OFD document corresponding to the original file based on the binary file and the non-graphic element data; the OFD document comprises a graphic element part and a non-graphic element part;
wherein the conversion module is further configured to:
defining a structure body for each graphic element in the graphic element data, and storing the structure body corresponding to each graphic element in the binary file when the OFD document is generated;
the opening module is further configured to:
rendering the graphic element portion based on the binary data and the page position information;
rendering the non-graphic element portion based on the non-graphic element data;
and opening the OFD document based on the graphic element part and the non-graphic element part.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements a method of opening an open layout document OFD according to any one of claims 1 to 3 when executing the program.
6. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements a method of opening an open layout document OFD according to any one of claims 1 to 3.
CN202310603016.0A 2023-05-26 2023-05-26 Opening method and device of open format document, electronic equipment and storage medium Active CN116340271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310603016.0A CN116340271B (en) 2023-05-26 2023-05-26 Opening method and device of open format document, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310603016.0A CN116340271B (en) 2023-05-26 2023-05-26 Opening method and device of open format document, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116340271A CN116340271A (en) 2023-06-27
CN116340271B true CN116340271B (en) 2023-11-03

Family

ID=86882687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310603016.0A Active CN116340271B (en) 2023-05-26 2023-05-26 Opening method and device of open format document, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116340271B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844465A (en) * 2017-11-11 2018-03-27 江西金格科技股份有限公司 A kind of method that OFD format files support script
CN111859886A (en) * 2020-06-22 2020-10-30 远光软件股份有限公司 Document generation method and device based on product prototype interface
CN111897776A (en) * 2020-06-22 2020-11-06 百望股份有限公司 OFD document processing method, electronic device and computer-readable storage medium
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN112927130A (en) * 2019-12-06 2021-06-08 伊鲁米那股份有限公司 Controlling electrical components using graphics files
CN113296774A (en) * 2021-06-16 2021-08-24 北京数科网维技术有限责任公司 OFD file processing method and system based on browser
CN113986822A (en) * 2021-10-26 2022-01-28 黑龙江航天信息有限公司 Method and system for converting format of value-added tax electronic invoice

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554021B2 (en) * 2010-10-19 2013-10-08 Palo Alto Research Center Incorporated Finding similar content in a mixed collection of presentation and rich document content using two-dimensional visual fingerprints

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844465A (en) * 2017-11-11 2018-03-27 江西金格科技股份有限公司 A kind of method that OFD format files support script
CN112927130A (en) * 2019-12-06 2021-06-08 伊鲁米那股份有限公司 Controlling electrical components using graphics files
CN111859886A (en) * 2020-06-22 2020-10-30 远光软件股份有限公司 Document generation method and device based on product prototype interface
CN111897776A (en) * 2020-06-22 2020-11-06 百望股份有限公司 OFD document processing method, electronic device and computer-readable storage medium
CN112650714A (en) * 2020-12-22 2021-04-13 微民保险代理有限公司 Document display method, device, equipment and computer readable medium
CN113296774A (en) * 2021-06-16 2021-08-24 北京数科网维技术有限责任公司 OFD file processing method and system based on browser
CN113986822A (en) * 2021-10-26 2022-01-28 黑龙江航天信息有限公司 Method and system for converting format of value-added tax electronic invoice

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于Qt渲染的OFD文档格式转换;冯辉;段伟光;丛培勇;王卫国;;信息技术与标准化(第04期);全文 *
开放版式文档在电子病案管理中的应用探讨;凌晨;杨丰华;李鹏;;医学信息学杂志(第02期);全文 *

Also Published As

Publication number Publication date
CN116340271A (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN109408783B (en) Electronic document online editing method and system
CN110083805B (en) Method and system for converting Word file into EPUB file
US8910036B1 (en) Web based copy protection
EP3607460A1 (en) Smarter copy/paste
CN113312108B (en) SWIFT message verification method and device, electronic equipment and storage medium
WO2010036457A2 (en) Editing 2d structures using natural input
WO2009000141A1 (en) Representation method, system and device of layout file logical structure information
CN105975446A (en) Method and system for displaying word document content by modules in mobile phone terminal
CN112016290A (en) Automatic document typesetting method, device, equipment and storage medium
CN110708423A (en) Message content display method and device and storage medium
US8930808B2 (en) Processing rich text data for storing as legacy data records in a data storage system
CN116340271B (en) Opening method and device of open format document, electronic equipment and storage medium
KR100762712B1 (en) Method for transforming of electronic document based on mapping rule and system thereof
US10140278B2 (en) Computer-implemented methods and systems for associating files with cells of a collaborative spreadsheet
CN112433995A (en) File format conversion method, system, computer equipment and storage medium
CN115841095A (en) Document establishing method, system, medium and equipment
CN115759029A (en) Document template processing method and device, electronic equipment and storage medium
CN114997164A (en) Text generation method and device
CN107423271A (en) Document structure tree method and apparatus
CN111401005B (en) Text conversion method and device and readable storage medium
CN109885743B (en) Webpage data information extraction method
CN114444447A (en) Card processing method and device
CN111783482A (en) Text translation method and device, computer equipment and storage medium
CN113297425A (en) Document conversion method, device, server and storage medium
US20150324333A1 (en) Systems and methods for automatically generating hyperlinks

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