CN114048174A - OFD document processing method and device and electronic equipment - Google Patents

OFD document processing method and device and electronic equipment Download PDF

Info

Publication number
CN114048174A
CN114048174A CN202210034381.XA CN202210034381A CN114048174A CN 114048174 A CN114048174 A CN 114048174A CN 202210034381 A CN202210034381 A CN 202210034381A CN 114048174 A CN114048174 A CN 114048174A
Authority
CN
China
Prior art keywords
page
ofd
file
data
entry
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
Application number
CN202210034381.XA
Other languages
Chinese (zh)
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.)
Taishan Information Technology Co ltd
Original Assignee
Taishan 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 Taishan Information Technology Co ltd filed Critical Taishan Information Technology Co ltd
Priority to CN202210034381.XA priority Critical patent/CN114048174A/en
Publication of CN114048174A publication Critical patent/CN114048174A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures

Abstract

The application discloses an OFD document processing method, an OFD document processing device and electronic equipment, and is applied to the technical field of computers. The method comprises the steps of generating an OFD data object by analyzing entries of a main entry file based on a file entry list of an OFD document to be analyzed; according to the OFD data object, obtaining a public resource file and a page data list of the OFD document to be analyzed; analyzing to obtain page data to be displayed according to the page information to be displayed and the page data list; and based on the page data to be displayed and the public resource file, the page content to be displayed of the OFD document to be analyzed is drawn, so that the content of the OFD document can be efficiently displayed, and the use experience of a user is improved.

Description

OFD document processing method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to an OFD document processing method and apparatus, and an electronic device.
Background
An OFD (Open Fixed-layout Document) Document is an Open and Chinese-autonomous electronic Document format, and belongs to a national standard format Document. The format is fixed without printing, and the electronic document can be conveniently stored, read and edited. It can be understood that the OFD document belongs to a ZIP compressed file, and the ZIP is a file format for data compression and document storage, and needs to be decompressed before the OFD document is parsed. The decompression process obtains an XML (Extensible Markup Language) file for simply storing data, which contains a main entry file, a folder of a document, a document root file, page information of the document, resources, and the like. And finally, generating a data object according to the XML file information, and drawing and displaying the document content according to the standard.
At present, although OFD parsing and rendering can be performed in the related art, for OFD documents with relatively large files or large numbers of pages, decompression processing of the files takes a long time, and file contents cannot be quickly presented to a user, which results in poor user experience.
In view of this, how to efficiently display OFD document contents and improve user experience is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application provides an OFD document processing method, an OFD document processing device and electronic equipment, which can efficiently display OFD document contents and improve user experience.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
an embodiment of the present invention provides an OFD document processing method, including:
generating an OFD data object by analyzing the main entry file entry based on the file entry list of the OFD document to be analyzed;
obtaining a public resource file and a page data list of the OFD document to be analyzed according to the OFD data object;
analyzing to obtain page data to be displayed according to the page information to be displayed and the page data list;
based on the page data to be displayed and the public resource file, drawing the content of the page to be displayed of the OFD document to be analyzed;
the file entry list based on the OFD document to be analyzed comprises:
obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using the file entry traverser.
Optionally, the obtaining, according to the OFD data object, a public resource file and a page data list of the OFD document to be analyzed includes:
determining the root information of the OFD document to be analyzed according to the OFD data object, and generating a root data object by analyzing the root information;
analyzing the public resource file of the OFD data object according to the root data object;
and acquiring a page data list according to the root data object.
Optionally, the analyzing, according to the information of the page to be displayed and the page data list, to obtain the page data to be displayed includes:
analyzing a page information object of a page to be displayed according to the page data list;
according to the page information object, a background layer, a text layer and a foreground layer of the page to be displayed are obtained through splitting according to format document technical standards, and a page block drawing device is obtained based on page blocks under the background layer, the text layer and the foreground layer and is used for drawing contents of all parts in the page to be displayed.
Optionally, the analyzing the page information object of the page to be displayed according to the page data list includes:
calculating through a visual area to obtain a page index of the page to be displayed; the page index records page information data;
and obtaining the page information object of the page to be displayed through the page index by utilizing an XML (extensive Makeup language) analysis technology.
Optionally, after the obtaining, by using the file entry traverser, a file entry data stream from the to-be-parsed OFD document, the method further includes:
and caching the file entry data stream to a memory.
Optionally, the generating the OFD data object by parsing the entry of the main entry file includes:
acquiring a path of the extensible markup language to be analyzed corresponding to a main entry file of the OFD document to be analyzed;
if the main entry file is written into the temporary directory, generating an OFD data object according to the main entry file;
if the main entry file is not written into the temporary directory, determining a target entry data stream corresponding to the main entry file in the memory, writing the target entry data stream into the temporary directory, and generating an OFD data object according to the target entry data stream.
Optionally, after writing the target entry data stream to the temporary directory, the method further includes:
and clearing the target entry data stream from the memory.
Another aspect of an embodiment of the present invention provides an OFD document processing apparatus, including:
the data object generation module is used for generating an OFD data object by analyzing the entries of the main entry file based on the file entry list of the OFD document to be analyzed;
a public resource file obtaining module, configured to obtain a public resource file and a page data list of the OFD document to be analyzed according to the OFD data object;
the page data analysis module is used for analyzing and obtaining page data to be displayed according to the page information to be displayed and the page data list;
the page drawing module is used for drawing the content of the page to be displayed of the OFD document to be analyzed based on the page data to be displayed and the public resource file;
wherein the data object generation module is further to: obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using the file entry traverser.
An embodiment of the present invention further provides an electronic device, which includes a processor, and the processor is configured to implement the steps of the OFD document processing method according to any one of the foregoing items when executing the computer program stored in the memory.
The technical scheme provided by the application has the advantages that according to the current visual page of the OFD document to be analyzed, public part content is firstly analyzed, then target page content needing to be displayed is analyzed, the page content is drawn according to the public part content and the target page data information obtained through analysis, even if the file is large, the page number is large, the page to be displayed can be quickly analyzed and drawn, the OFD document content display efficiency is effectively improved, the OFD document opening display experience is better, and the user use experience is improved.
In addition, the embodiment of the invention also provides a corresponding implementation device and electronic equipment for the OFD document processing method, so that the method has higher practicability, and the device and the electronic equipment have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the related art, the drawings required to be used in the description of the embodiments or the related 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 schematic flowchart of an OFD document processing method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a process of obtaining an OFD file entry list and caching an entry stream in a memory according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of parsing an XML generated data object according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a process of parsing an OFD host entry file and acquiring a page data list according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating parsing and rendering page content on demand according to an embodiment of the present invention;
fig. 6 is a structural diagram of an embodiment of an OFD document processing apparatus according to an embodiment of the present invention;
fig. 7 is a block diagram of an embodiment of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
Having described the technical solutions of the embodiments of the present invention, various non-limiting embodiments of the present application are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart of an OFD document processing method according to an embodiment of the present invention, where the embodiment of the present invention may include the following:
s101: and generating the OFD data object by analyzing the main entry file entry based on the file entry list of the OFD document to be analyzed.
The OFD document to be analyzed in this step is an OFD document whose content needs to be analyzed and displayed, the file entry is a structure in the OFD file, and includes all folders and files, each folder or file is called an entry, the file entry list is list information including all files and folders of the structure in the OFD file, the main entry file belongs to the OFD format standard definition, and one and only one main entry file in one OFD file is also an OFD. The data in the main entry file, that is, the XML file, can be generated into a data object in the program by any existing technique for parsing XML, for example, the way of processing XML in java: dom4j, JAXB, etc.
S102: and obtaining a public resource file and a page data list of the OFD document to be analyzed according to the OFD data object.
It can be understood that the OFD data object is data of a main entry file of the OFD document to be parsed in a program, that is, the OFD data object represents the main entry file of the OFD document to be parsed, the file includes a root file of the whole OFD document to be parsed, the root file includes common part content, that is, information of a common resource file and a document, and the common resource file and a page data list can be obtained by parsing the OFD data object. Public resource files: XML, where a common resource sequence is defined. Each node points to a resource description document within the OFD package, such as: font, color space, rendering parameters, image, and media. These resources are used during document rendering, and different pages may use the same font or rendering parameters.
S103: and analyzing to obtain the page data to be displayed according to the page information to be displayed and the page data list.
The page to be displayed is a page of the OFD document to be analyzed which needs to be displayed currently, the page to be displayed may also be a certain page specified by a user, may also be a certain page automatically triggered by a program, or may be a certain page queued according to a certain display order, and the page information to be displayed includes page number information of the page to be displayed or other positions which can identify the page in the entire OFD document to be analyzed. The user wants to see which page of the OFD document to be analyzed and can specify which page to see, at this time, the program calculates that what the user sees is the page, and then analyzes the page object data of the page and draws and presents the page object data to the user. The page data to be displayed is a page object of the page to be displayed, the page object is data of a page in the OFD document to be analyzed, and may include characters, graphics, pictures, and the like, the data is in content.xml under the page, and may also be generated into a custom data object through XML analysis technology, and then the data objects are provided to a renderer for rendering the page content.
S104: and drawing the content of the page to be displayed of the OFD document to be analyzed based on the page data to be displayed and the public resource file.
Intercepting and decompressing corresponding file entry XML according to a page displayed by a user in the steps, generating a data object by utilizing an XML analysis technology, analyzing a main entry file and public resources, initializing page list data according to main information, and then analyzing a specified page by adopting a page block content renderer to complete the rendering of the page content, namely rendering and rendering according to a standard specification. After the page to be displayed is drawn, the page to be displayed can be displayed, if the display requirements of other pages are detected, the step S103 is skipped to execute to obtain the page data to be displayed of the page, and the content of the specified page is drawn according to the page data to be displayed.
According to the technical scheme provided by the embodiment of the invention, according to the current visible page of the OFD document to be analyzed, the public part content is firstly analyzed, then the target page content required to be displayed is analyzed, and the page content is drawn according to the public part content and the target page data information obtained by analyzing firstly, so that the page to be displayed can be quickly analyzed and drawn even if the document is large and the number of pages is large, the content display efficiency of the OFD document is effectively improved, the opening display experience of the OFD document is better, and the use experience of a user is improved.
The above embodiment defines how to implement the step S102 and defines the step, and this embodiment also provides an optional implementation manner of this step, that is, a process of obtaining a common resource file and a page data list of an OFD document to be parsed according to an OFD data object may include:
determining root information of an OFD document to be analyzed according to the OFD data object, and generating a root data object by analyzing the root information; analyzing the public resource file of the OFD data object according to the root data object; and acquiring a page data list according to the root data object.
XML, the root information of the OFD document to be parsed may also be processed by any XML parsing technique, and a corresponding root data object is generated.
The foregoing embodiment defines how to implement the step S103 and defines the step, and this embodiment also provides an optional implementation manner of the step, that is, a process of obtaining page data to be displayed according to the page information to be displayed and the page data list analysis, which may include:
analyzing a page information object of a page to be displayed according to the page data list; and splitting according to the page information object and the format document technical standard to obtain a background layer, a text layer and a foreground layer of the page to be displayed, and obtaining a page block drawing device based on page blocks under the background layer, the text layer and the foreground layer, wherein the page block drawing device is used for drawing contents of all parts in the page to be displayed.
In this embodiment, a background layer, a body layer, and a foreground layer may be acquired and recorded according to a page object. And obtaining a page block drawing device through page blocks under different layers, wherein the page blocks refer to different data objects in page contents of the OFD document to be analyzed and can comprise texts, graphs, pictures, composite objects and the like. The present embodiment may draw portions of content in a page using a page block renderer.
Further, in order to improve the analysis efficiency of the page information object, as an optional implementation manner, page index recording page information data may be further set, the page information object of the page to be displayed is obtained through the page index, and specifically, the page index of the page to be displayed may be obtained through the visualization area calculation; and obtaining the page information object of the page to be displayed through the business information data carried by the page index by utilizing an XML (extensive Makeup language) analysis technology. The visualization region calculation may be calculated by any of the existing view engines, which is not limited in this application.
The above embodiment defines how to implement the step S101 and the steps, and this embodiment also gives an optional implementation manner of this step in conjunction with fig. 2, that is, an implementation manner of the file entry list based on the OFD document to be parsed may be:
obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using a file entry traversing device, and caching the file entry data stream to a memory.
The file entry traverser is an existing segment of computer program, and takes all entries in the OFD file through the iterator, where the entries are, for example, all file lists in the OFD document to be parsed, such as XML files, pictures, fonts, and the like. Specifically, after reading the OFD document to be analyzed, a file interface is called, a file entry walker is obtained, whether a file entry exists is judged, if yes, a file entry data stream is obtained, the obtained file entry data stream is stored in a memory, then, whether a file entry exists in the file entry walker is continuously judged, and if not, the operation is ended. Because traversal obtains file entries very quickly, parsing XML is slow. Therefore, all file entries are cached in the memory, and when the file entries are needed, the corresponding data stream is taken out from the memory, and the generated object is analyzed, so that the ODF file analysis efficiency can be further improved.
For the parsing operation related to the foregoing embodiments, the present application is not limited, and this embodiment further provides, with reference to fig. 3, a flowchart for implementing the parsing operation based on the XML technology, that is, for generating the data object by parsing the XML file, where the flowchart may include the following contents:
a1: and acquiring the path of the XML to be analyzed.
A2: it is determined whether a temporary directory has been written. If yes, go to step A5. If not, the process skips to step A4.
A3: and finding the entry stream of the cache, writing the entry stream into the temporary directory, and clearing the cache.
A4: the data object is generated by an XML parsing technique.
A5: the data object is returned.
A6: and (6) ending.
Based on this, the above embodiment may include a process of generating an OFD data object by parsing a main entry file entry, where the process includes:
acquiring a path of the extensible markup language to be analyzed corresponding to a main entry file of the OFD document to be analyzed; if the main entry file is written into the temporary directory, generating an OFD data object according to the main entry file; and if the main entry file is not written into the temporary directory, determining a target entry data stream corresponding to the main entry file in the memory, writing the target entry data stream into the temporary directory, and generating an OFD data object according to the target entry data stream.
Furthermore, in order to improve the utilization rate of the cache resources, the target entry data stream can be cleared from the memory.
According to the embodiment, the needed XML file is written into the temporary directory through the XML analysis technology, the data object used during display is generated, the file is convenient to modify and store later, and the display efficiency of the whole OFD file is improved.
Finally, this embodiment also provides, with reference to fig. 4, an alternative implementation of parsing the OFD main entry file and acquiring the page data list, which may include the following contents:
b1: and starting.
B2: the primary entry file entry is parsed.
B3: the root information of the document is parsed.
B4: and extracting the public resource file according to the document root information.
B5: and acquiring a page data list according to the document root information.
B6: the page information data is recorded by the page index.
B7: and (6) ending.
Based on the embodiment, the implementation process of parsing and drawing page content on demand is shown in fig. 5, and may include the following:
c1: and starting.
C2: and the view engine obtains the page index to be displayed through calculation. That is, what needs to be displayed currently is the page number of the OFD document to be parsed, which is calculated by the visible area.
C3: and analyzing and acquiring the page information object to be displayed by utilizing an XML analysis technology.
C4: and according to the page information object, splitting a background layer, a text layer and a foreground layer according to the format document technical standard.
C5: and D, obtaining a renderer of the page block by using the character and graphic rendering interfaces of all languages according to the layer obtained in the step C4.
C6: and each renderer realizes a rendering method to render page contents.
C7: when other pages need to be displayed, go to step C2.
C8: and (6) ending.
It should be noted that, in the present application, there is no strict sequential execution order among the steps, and as long as a logical order is met, the steps may be executed simultaneously or according to a certain preset order, and fig. 1 to fig. 5 are only schematic manners, and do not represent only such an execution order.
The embodiment of the invention also provides a corresponding device for the OFD document processing method, thereby further ensuring that the method has higher practicability. Wherein the means can be described separately from the functional module point of view and the hardware point of view. The OFD document processing apparatus provided in the embodiment of the present invention is introduced below, and the OFD document processing apparatus described below and the OFD document processing method described above may be referred to in correspondence with each other.
Based on the angle of the functional module, referring to fig. 6, fig. 6 is a structural diagram of an OFD document processing apparatus according to an embodiment of the present invention, in a specific implementation, the apparatus may include:
the data object generating module 601 is configured to generate an OFD data object by parsing the main entry file entry based on the file entry list of the OFD document to be parsed.
The common resource file obtaining module 602 is configured to obtain a common resource file and a page data list of the OFD document to be analyzed according to the OFD data object.
And the page data analyzing module 603 is configured to analyze the page information to be displayed and the page data list to obtain page data to be displayed.
And a page drawing module 604, configured to draw content of a page to be displayed of the OFD document to be analyzed based on the page data to be displayed and the public resource file.
Optionally, in some embodiments of this embodiment, the data object generating module 601 may further be configured to: determining root information of an OFD document to be analyzed according to the OFD data object, and generating a root data object by analyzing the root information; analyzing the public resource file of the OFD data object according to the root data object; and acquiring a page data list according to the root data object.
As an optional implementation manner of the foregoing embodiment, the page data parsing module 603 may be further configured to: analyzing a page information object of a page to be displayed according to the page data list; and splitting according to the page information object and the format document technical standard to obtain a background layer, a text layer and a foreground layer of the page to be displayed, and obtaining a page block drawing device based on page blocks under the background layer, the text layer and the foreground layer, wherein the page block drawing device is used for drawing contents of all parts in the page to be displayed.
As an optional implementation manner of the foregoing embodiment, the page data parsing module 603 may be further configured to: calculating through a visual area to obtain a page index of a page to be displayed; the page index records page information data; and obtaining a page information object of the page to be displayed through the page index by utilizing an XML (extensive Makeup language) analysis technology.
Optionally, in other embodiments of this embodiment, the data object generating module 601 may be further configured to: obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using a file entry traversing device, and caching the file entry data stream to a memory.
As an optional implementation manner of this embodiment, the data object generating module 601 may further be configured to: acquiring a path of the extensible markup language to be analyzed corresponding to a main entry file of the OFD document to be analyzed; if the main entry file is written into the temporary directory, generating an OFD data object according to the main entry file; and if the main entry file is not written into the temporary directory, determining a target entry data stream corresponding to the main entry file in the memory, writing the target entry data stream into the temporary directory, and generating an OFD data object according to the target entry data stream.
As an optional implementation manner of this embodiment, the data object generating module 601 may further be configured to: after writing the target entry data stream to the temporary directory, the target entry data stream is also purged from memory.
The functions of the functional modules of the OFD document processing apparatus according to the embodiment of the present invention may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Therefore, the OFD document content can be efficiently displayed, and the use experience of a user is improved.
The OFD document processing apparatus mentioned above is described from the perspective of functional modules, and further, the present application also provides an electronic device described from the perspective of hardware. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 7, the electronic device includes a memory 70 for storing a computer program; a processor 71, configured to implement the steps of the OFD document processing method as mentioned in any of the above embodiments when executing the computer program.
The processor 71 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the processor 71 may also be a controller, a microcontroller, a microprocessor or other data processing chip, and the like. The processor 71 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 71 may also include a main processor and a coprocessor, the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 71 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor 71 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
The memory 70 may include one or more computer-readable storage media, which may be non-transitory. Memory 70 may also include high speed random access memory as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. The memory 70 may in some embodiments be an internal storage unit of the electronic device, for example a hard disk of a server. The memory 70 may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk provided on a server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 70 may also include both an internal storage unit and an external storage device of the electronic device. The memory 70 may be used for storing various data and application software installed in the electronic device, such as: the code of the program that executes the vulnerability handling method, etc. may also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 70 is at least used for storing a computer program 701, wherein after being loaded and executed by the processor 71, the computer program can realize the relevant steps of the OFD document processing method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 70 may also include an operating system 702, data 703, and the like, and the storage manner may be a transient storage or a permanent storage. Operating system 702 may include Windows, Unix, Linux, etc. The data 703 may include, but is not limited to, data corresponding to an OFD document processing result, and the like.
In some embodiments, the electronic device may further include a display 72, an input/output interface 73, a communication interface 74, alternatively referred to as a network interface, a power supply 75, and a communication bus 76. The display 72 and the input/output interface 73, such as a Keyboard (Keyboard), belong to a user interface, and the optional user interface may also include a standard wired interface, a wireless interface, and the like. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, as appropriate, is used for displaying information processed in the electronic device and for displaying a visualized user interface. The communication interface 74 may optionally include a wired interface and/or a wireless interface, such as a WI-FI interface, a bluetooth interface, etc., typically used to establish a communication connection between an electronic device and other electronic devices. The communication bus 76 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
Those skilled in the art will appreciate that the configuration shown in fig. 7 is not intended to be limiting of the electronic device and may include more or fewer components than those shown, such as a sensor 77 that performs various functions.
The functions of the functional modules of the electronic device according to the embodiments of the present invention may be specifically implemented according to the method in the above method embodiments, and the specific implementation process may refer to the description related to the above method embodiments, which is not described herein again.
Therefore, the OFD document content can be efficiently displayed, and the use experience of a user is improved.
It is to be understood that, if the OFD document processing method in the above embodiment is implemented in the form of a software functional unit and sold or used as a stand-alone product, it may be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application may be substantially or partially implemented in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods of the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrically erasable programmable ROM, a register, a hard disk, a multimedia card, a card type Memory (e.g., SD or DX Memory, etc.), a magnetic Memory, a removable magnetic disk, a CD-ROM, a magnetic or optical disk, and other various media capable of storing program codes.
Based on this, the embodiment of the present invention further provides a readable storage medium, which stores a computer program, and the computer program is executed by a processor, and the steps of the OFD document processing method according to any one of the above embodiments are provided.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. For hardware including devices and electronic equipment disclosed by the embodiment, the description is relatively simple because the hardware includes the devices and the electronic equipment correspond to the method disclosed by the embodiment, and the relevant points can be obtained by referring to the description of the method.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The OFD document processing method, apparatus and electronic device provided by the present application are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present application.

Claims (9)

1. An OFD document processing method, characterized by comprising:
generating an OFD data object by analyzing the main entry file entry based on the file entry list of the OFD document to be analyzed;
obtaining a public resource file and a page data list of the OFD document to be analyzed according to the OFD data object;
analyzing to obtain page data to be displayed according to the page information to be displayed and the page data list;
based on the page data to be displayed and the public resource file, drawing the content of the page to be displayed of the OFD document to be analyzed;
the file entry list based on the OFD document to be analyzed comprises:
obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using the file entry traverser.
2. The OFD document processing method according to claim 1, wherein the obtaining the common resource file and the page data list of the OFD document to be parsed according to the OFD data object comprises:
determining the root information of the OFD document to be analyzed according to the OFD data object, and generating a root data object by analyzing the root information;
analyzing the public resource file of the OFD data object according to the root data object;
and acquiring a page data list according to the root data object.
3. The OFD document processing method according to claim 2, wherein the parsing to obtain the page data to be presented according to the page information to be presented and the page data list includes:
analyzing a page information object of a page to be displayed according to the page data list;
according to the page information object, a background layer, a text layer and a foreground layer of the page to be displayed are obtained through splitting according to format document technical standards, and a page block drawing device is obtained based on page blocks under the background layer, the text layer and the foreground layer and is used for drawing contents of all parts in the page to be displayed.
4. The OFD document processing method according to claim 3, wherein said parsing the page information object of the page to be presented according to the page data list comprises:
calculating through a visual area to obtain a page index of the page to be displayed; the page index records page information data;
and obtaining the page information object of the page to be displayed through the page index by utilizing an XML (extensive Makeup language) analysis technology.
5. The OFD document processing method according to any of claims 1 to 4, wherein after the obtaining, by the file entry walker, the file entry data stream from the OFD document to be parsed, further comprises:
and caching the file entry data stream to a memory.
6. The OFD document processing method according to claim 5, wherein the generating of the OFD data object by parsing the main entry file entry comprises:
acquiring a path of the extensible markup language to be analyzed corresponding to a main entry file of the OFD document to be analyzed;
if the main entry file is written into the temporary directory, generating an OFD data object according to the main entry file;
if the main entry file is not written into the temporary directory, determining a target entry data stream corresponding to the main entry file in the memory, writing the target entry data stream into the temporary directory, and generating an OFD data object according to the target entry data stream.
7. The OFD document processing method according to claim 6, wherein after said writing the target entry data stream to the temporary directory, further comprising:
and clearing the target entry data stream from the memory.
8. An OFD document processing apparatus characterized by comprising:
the data object generation module is used for generating an OFD data object by analyzing the entries of the main entry file based on the file entry list of the OFD document to be analyzed;
a public resource file obtaining module, configured to obtain a public resource file and a page data list of the OFD document to be analyzed according to the OFD data object;
the page data analysis module is used for analyzing and obtaining page data to be displayed according to the page information to be displayed and the page data list;
the page drawing module is used for drawing the content of the page to be displayed of the OFD document to be analyzed based on the page data to be displayed and the public resource file;
wherein the data object generation module is further to: obtaining an OFD document to be analyzed; calling a file interface to acquire a file entry traverser; and acquiring a file entry data stream from the OFD document to be analyzed by using the file entry traverser.
9. An electronic device, comprising a processor and a memory, the processor being configured to implement the steps of the OFD document processing method according to any one of claims 1 to 7 when executing a computer program stored in the memory.
CN202210034381.XA 2022-01-13 2022-01-13 OFD document processing method and device and electronic equipment Pending CN114048174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210034381.XA CN114048174A (en) 2022-01-13 2022-01-13 OFD document processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210034381.XA CN114048174A (en) 2022-01-13 2022-01-13 OFD document processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114048174A true CN114048174A (en) 2022-02-15

Family

ID=80196397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210034381.XA Pending CN114048174A (en) 2022-01-13 2022-01-13 OFD document processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114048174A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934653A (en) * 2023-01-04 2023-04-07 百望股份有限公司 Method and device for adding external OFD page content in OFD file

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150046797A1 (en) * 2013-08-08 2015-02-12 Peking University Founder Group Co., Ltd. Document format processing apparatus and document format processing method
CN112487763A (en) * 2020-12-08 2021-03-12 深圳易财信息技术有限公司 SVG-based OFD file online display method, server side and system
CN113535647A (en) * 2021-06-29 2021-10-22 福昕鲲鹏(北京)信息科技有限公司 OFD file paging rendering method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150046797A1 (en) * 2013-08-08 2015-02-12 Peking University Founder Group Co., Ltd. Document format processing apparatus and document format processing method
CN112487763A (en) * 2020-12-08 2021-03-12 深圳易财信息技术有限公司 SVG-based OFD file online display method, server side and system
CN113535647A (en) * 2021-06-29 2021-10-22 福昕鲲鹏(北京)信息科技有限公司 OFD file paging rendering method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
爱码网: "《OFD⽂件解析流程》", 《HTTPS://WWW.LIKECS.COM/SHOW-204680113.HTML》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934653A (en) * 2023-01-04 2023-04-07 百望股份有限公司 Method and device for adding external OFD page content in OFD file

Similar Documents

Publication Publication Date Title
EP2805258B1 (en) Low resolution placeholder content for document navigation
US9484006B2 (en) Manipulation of textual content data for layered presentation
CN102970456B (en) Image forming apparatus, image forming apparatus control method, and program
CN107239491A (en) For realizing method, equipment, browser and electronic equipment that user behavior is followed the trail of
KR20150079867A (en) Html5-protocol-based webpage presentation method and device
US10565290B2 (en) Online displaying a document
US9117314B2 (en) Information output apparatus, method, and recording medium for displaying information on a video display
US11275935B2 (en) Patent analysis applications and corresponding user interface features
CN104850388A (en) Method and apparatus for drafting webpage
AU2021257649B2 (en) Vision-based cell structure recognition using hierarchical neural networks and cell boundaries to structure clustering
CN104111922A (en) Processing method and device of streaming document
US11361146B2 (en) Memory-efficient document processing
CN111339458A (en) Page presenting method and device
JP5653494B2 (en) Cloud assisted rendering
CN115731313A (en) SVG format picture processing method, device, equipment, medium and product
CN114048174A (en) OFD document processing method and device and electronic equipment
US20150169508A1 (en) Obfuscating page-description language output to thwart conversion to an editable format
US8645822B2 (en) Multi-platform presentation system
CN108133029B (en) Map element adjusting method, device and equipment and computer-readable storage medium
US9965446B1 (en) Formatting a content item having a scalable object
CN114756797A (en) Page processing method and device, electronic equipment and storage medium
US7281208B2 (en) Image stitching methods and systems
US10970533B2 (en) Methods and systems for finding elements in optical character recognition documents
CN113515922A (en) Document processing method, system, device and interaction device
CN110362790A (en) Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220215