CN107943915B - Method and device for OFD (office file) online display based on HTML5 - Google Patents

Method and device for OFD (office file) online display based on HTML5 Download PDF

Info

Publication number
CN107943915B
CN107943915B CN201711159886.4A CN201711159886A CN107943915B CN 107943915 B CN107943915 B CN 107943915B CN 201711159886 A CN201711159886 A CN 201711159886A CN 107943915 B CN107943915 B CN 107943915B
Authority
CN
China
Prior art keywords
file
ofd
html5
document
information
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
CN201711159886.4A
Other languages
Chinese (zh)
Other versions
CN107943915A (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.)
State Grid Corp of China SGCC
State Grid Information and Telecommunication Co Ltd
State Grid Shanghai Electric Power Co Ltd
Fujian Yirong Information Technology Co Ltd
Great Power Science and Technology Co of State Grid Information and Telecommunication Co Ltd
Original Assignee
State Grid Corp of China SGCC
State Grid Information and Telecommunication Co Ltd
State Grid Shanghai Electric Power Co Ltd
Fujian Yirong Information Technology Co Ltd
Great Power Science and Technology Co of State Grid Information and Telecommunication 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 State Grid Corp of China SGCC, State Grid Information and Telecommunication Co Ltd, State Grid Shanghai Electric Power Co Ltd, Fujian Yirong Information Technology Co Ltd, Great Power Science and Technology Co of State Grid Information and Telecommunication Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201711159886.4A priority Critical patent/CN107943915B/en
Publication of CN107943915A publication Critical patent/CN107943915A/en
Application granted granted Critical
Publication of CN107943915B publication Critical patent/CN107943915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Abstract

The invention provides an OFD file online display method based on HTML 5; the server terminal decompresses the OFD file and maps the decompressed OFD file directory structure to the URL of the HTML5 client terminal; obtaining a URI according to the URL; an HTML5 client analyzes a needed XML file through a URI to obtain the information content of the XML file; converting the information content into corresponding content according to the OFD file standard and displaying the content on an interface; the invention also provides an on-line OFD file display device based on HTML5, which can normally display the OFD file without depending on a task terminal, thereby greatly improving the display compatibility of the OFD file.

Description

Method and device for OFD (office file) online display based on HTML5
Technical Field
The invention relates to an OFD file online display method and device based on HTML 5.
Background
The OFD is one of basic standards of an electronic file in a format document format, and due to the characteristic of fixing the format, the fixing result required by the typesetting of various documents can be borne by the standard; the OFD standard serving as a basic standard reflects the industry management requirements in the category of format documents, provides sufficient expansibility and is parallel to the standard specification in industry application. HTML5 web, a core language, an application hypertext markup language under standard universal markup language. The world wide web consortium announced that the standard specification was finalized with nearly 8 years of hard effort on day 29/10 2014. The extensible markup language xml (extensiblemarklanguage) is a simple and flexible text format extensible markup language, originated in SGML, which is a subset of SGML, i.e., a simplified version of SGML, and is well suited for data exchange on the Web or among other various data sources.
Currently, OFD files are browsed online mainly by means of a plug-in of a browser, such as: the activex control directly opens local program browsing files in the browser or is embedded in the local program browsing files for direct browsing, different browsing plug-ins need to be written for different browsers, an HTML5 client needs to install an OFD reader for normal browsing, the safety requirement of the plug-ins by the existing browser is continuously improved, and the stability of browsing based on a plug-in mode is lower and lower.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a device for online displaying OFD files based on HTML5, which can normally display OFD files without depending on a task terminal, thereby greatly improving the display compatibility of OFD files.
One of the present invention is realized by: a method for displaying OFD files on line based on HTML5 comprises the following steps:
step 1, a server side decompresses an OFD file, and maps an OFD file directory structure obtained after decompression to a URL (uniform resource locator) of an HTML5 client side;
step 2, obtaining URI according to URL;
step 3, the HTML5 client analyzes the needed XML file through the URI to obtain the information content of the XML file;
and 4, converting the information content into corresponding content according to the OFD file standard and displaying the content on an interface.
Further, the compressed packet in the step 1 is decompressed to obtain a document directory structure, a single-page folder and a single-page corresponding XML file.
Further, each of the URIs includes an OFD file unique identifier.
Further, the step 3 is further specifically:
the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
and obtaining the analyzed information content.
Further, the step 4 is further specifically:
according to the OFD file standard, different information contents are displayed by drawing on the canvas of the interface by means of the Canves object of HTML 5.
The second invention is realized by the following steps: an apparatus for on-line displaying OFD file based on HTML5, comprising the following modules:
the server side decompresses the OFD file and maps the decompressed OFD file directory structure to the URL of the HTML5 client side;
the URI acquisition module is used for acquiring a URI according to the URL;
the method comprises the steps that an analysis content module is obtained, and an HTML5 client analyzes a needed XML file through a URI to obtain the information content of the XML file;
and the display module converts the information content into corresponding content according to the OFD file standard and displays the content on the interface.
Further, the compressed packet in the disassembling module is decompressed to obtain a document directory structure, a single-page folder and a single-page corresponding XML file.
Further, each of the URIs includes an OFD file unique identifier.
Further, the module for acquiring and analyzing content further specifically comprises:
the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
and obtaining the analyzed information content.
Further, the display module further specifically includes:
according to the OFD file standard, different information contents are displayed by drawing on the canvas of the interface by means of the Canves object of HTML 5.
The invention has the following advantages: the invention relates to a method and a device for OFD file online display based on HTML5, wherein an OFD file is decompressed through a server side, and the decompressed OFD file directory structure is mapped to a URL of an HTML5 client side; obtaining a URI according to the URL; an HTML5 client analyzes a needed XML file through a URI to obtain the information content of the XML file; the information content is converted into the corresponding content according to the OFD file standard and displayed on the interface, so that the normal display of the OFD file can be realized without depending on a task terminal, and the display compatibility of the OFD file is greatly improved.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of the method of the present invention.
FIG. 2 is a schematic diagram of an embodiment of the present invention.
Detailed Description
As shown in fig. 1, the method for displaying OFD files online based on HTML5 of the present invention includes the following steps:
step 1, a server terminal decompresses an OFD file, maps an OFD file directory structure obtained after decompression to a URL (uniform resource locator) of an HTML5 client, and decompresses a compressed packet to obtain a file directory structure, a single-page folder and a single-page corresponding XML (extensible markup language) file;
step 2, obtaining URIs according to the URLs, wherein each URI comprises an OFD file unique identifier;
step 3, the HTML5 client analyzes the needed XML file through the URI to obtain the information content of the XML file: the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
obtaining analyzed information content;
and 4, according to the OFD file standard, drawing and displaying different information contents on a canvas of the interface by means of a canvas object of HTML 5.
The invention relates to a device for on-line display of an OFD file based on HTML5, which comprises the following modules:
the server side decompresses the OFD file, maps the OFD file directory structure obtained after decompression to the URL of the HTML5 client side, and decompresses the compressed packet to obtain a file directory structure, a single-page folder and a single-page corresponding XML file;
the URI acquisition module is used for acquiring URIs according to the URLs, and each URI comprises an OFD file unique identifier;
and (3) acquiring a parsing content module, wherein the HTML5 client parses a required XML file through a URI to acquire the information content of the XML file: the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
obtaining analyzed information content;
and the display module is used for drawing and displaying different information contents on the canvas of the interface by means of the canvas object of the HTML5 according to the OFD file standard.
One specific embodiment of the present invention:
the specific implementation mode is mainly divided into three steps of server-side OFD file splitting, file parsing based on an HTML5 client-side, and service realization of OFD file parsing and browsing after document content interface parsing and rendering.
1. Splitting an OFD file at a server side: the method can be divided into four layers of directory structures of file decompression, document directory structure, single-page folder and single-page corresponding XML file by disassembling the OFD file compression package, the directory structure is mapped to the URL of an HTML5 client by the application of a server, and the HTML5 can realize the analysis function of the corresponding OFD file content by acquiring the URL of the server.
Mapping the OFD file to the corresponding HTML5 client URL by analyzing the hierarchical structure of the OFD directory, and obtaining the URI according to the URL, wherein the URI format is defined as follows: ofd main file URI:/ofd file unique identifier/OFD.xml;
ofd document content: xml/document _ n/Doc _ n/file unique identification/ofd;
ofd document content: xml/ofd file unique identification/Doc _ n/publicRes;
resource content access directory: /ofd File unique identification/Res/resource File name;
single page content: the unique identification of the/ofd file/Doc _ n/Pages/Page _ n/content.xml;
2. parsing of files based on HTML5 client
And 2.1. the HTML5 client analyzes the XML sequence first page to obtain the file corresponding to the main OFD.xml file path through the ID (namely the unique identification of the OFD file) of the file and disassemble the file to obtain the information of the file document.
2.2. And acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page.
2.3. And positioning URI path information corresponding to each page in the document, and analyzing and displaying the content of each page of the document.
2.4. And so on, the information content of other page documents.
3. Document content interface parsing rendering
As shown in fig. 2, object information such as object objects, Pages objects, Page objects, templates, PageRes, Content, Actions, and the like are encapsulated by parsing an xml file through javascript, and different objects are drawn and displayed on a canvas of an interface by means of a canvas object of HTML 5. And analyzing and converting the OFD file standard into corresponding content and displaying the content on an interface.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (10)

1. An OFD file online display method based on HTML5 is characterized in that: the method comprises the following steps:
step 1, a server side decompresses an OFD file, and maps an OFD file directory structure obtained after decompression to a URL (uniform resource locator) of an HTML5 client side;
step 2, obtaining URI according to URL;
step 3, the HTML5 client analyzes the needed XML file through the URI to obtain the information content of the XML file;
and 4, converting the information content into corresponding content according to the OFD file standard and displaying the content on an interface.
2. The method for on-line display of OFD files based on HTML5 of claim 1, wherein: and decompressing the compressed packet in the step 1 to obtain a document directory structure, a single-page folder and a single-page corresponding XML file.
3. The method for on-line display of OFD files based on HTML5 of claim 1, wherein: each URI includes an OFD file unique identifier.
4. The method for on-line display of OFD files based on HTML5 of claim 3, wherein: the step 3 is further specifically as follows:
the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
and obtaining the analyzed information content.
5. The method for on-line display of OFD files based on HTML5 of claim 1, wherein: the step 4 is further specifically as follows:
according to the OFD file standard, different information contents are displayed by drawing on the canvas of the interface by means of the Canves object of HTML 5.
6. An apparatus for on-line displaying OFD file based on HTML5, comprising: the system comprises the following modules:
the server side decompresses the OFD file and maps the decompressed OFD file directory structure to the URL of the HTML5 client side;
the URI acquisition module is used for acquiring a URI according to the URL;
the method comprises the steps that an analysis content module is obtained, and an HTML5 client analyzes a needed XML file through a URI to obtain the information content of the XML file;
and the display module converts the information content into corresponding content according to the OFD file standard and displays the content on the interface.
7. The apparatus for on-line display of OFD files based on HTML5 of claim 6, wherein: and decompressing the compressed packet in the disassembling module to obtain a document directory structure, a single-page folder and a single-page corresponding XML file.
8. The apparatus for on-line display of OFD files based on HTML5 of claim 6, wherein: each URI includes an OFD file unique identifier.
9. The apparatus for on-line display of OFD files based on HTML5 of claim 8, wherein: the module for acquiring and analyzing the content further comprises:
the HTML5 client acquires a main XML file path corresponding to a file through the unique identification of the OFD file of the XML file, and the main XML file path is disassembled to acquire the document information of the main XML file;
acquiring a directory where the document is located according to the acquired document information, and analyzing document.xml and public Res.xml files under the directory to acquire page information of the document and external resource information called by each page;
positioning URI path information corresponding to each page in the document, and analyzing the content of each page of the document;
and obtaining the analyzed information content.
10. The apparatus for on-line display of OFD files based on HTML5 of claim 6, wherein: the display module further specifically comprises:
according to the OFD file standard, different information contents are displayed by drawing on the canvas of the interface by means of the Canves object of HTML 5.
CN201711159886.4A 2017-11-20 2017-11-20 Method and device for OFD (office file) online display based on HTML5 Active CN107943915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711159886.4A CN107943915B (en) 2017-11-20 2017-11-20 Method and device for OFD (office file) online display based on HTML5

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711159886.4A CN107943915B (en) 2017-11-20 2017-11-20 Method and device for OFD (office file) online display based on HTML5

Publications (2)

Publication Number Publication Date
CN107943915A CN107943915A (en) 2018-04-20
CN107943915B true CN107943915B (en) 2020-05-08

Family

ID=61930395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711159886.4A Active CN107943915B (en) 2017-11-20 2017-11-20 Method and device for OFD (office file) online display based on HTML5

Country Status (1)

Country Link
CN (1) CN107943915B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717127A (en) * 2019-10-14 2020-01-21 北京华宇信息技术有限公司 Method and device for on-line analysis and browsing of OFD (office file)
CN110765385B (en) * 2019-10-24 2021-03-26 北京华宇信息技术有限公司 Method and system for browsing OFD document webpage end
CN111767491A (en) * 2020-06-30 2020-10-13 杭州天谷信息科技有限公司 OFD document analysis display method and system based on browser
CN111753502B (en) * 2020-07-07 2021-02-26 江苏中威科技软件系统有限公司 OFD file merging display and directory generation method
CN111753499B (en) * 2020-07-07 2021-02-05 江苏中威科技软件系统有限公司 Method for merging and displaying electronic form and OFD format file and generating directory
CN112131183A (en) * 2020-09-07 2020-12-25 百望股份有限公司 Linear access method of OFD electronic file
CN112597422A (en) * 2020-12-30 2021-04-02 深圳市世强元件网络有限公司 PDF file segmentation method and PDF file loading method in webpage
CN115776587A (en) * 2021-09-06 2023-03-10 中移物联网有限公司 Information synchronization method, device and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156742A (en) * 2011-04-19 2011-08-17 北京神州数码思特奇信息技术股份有限公司 Method and middleware for supporting structured document display with own browser of mobile phone
CN104346322A (en) * 2013-08-08 2015-02-11 北大方正集团有限公司 Document format processing device and document format processing method
CN105630459A (en) * 2014-10-25 2016-06-01 上海未达数码科技有限公司 Method for converting PPT document to HTML page

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5149430B2 (en) * 2011-07-28 2013-02-20 株式会社 ディー・エヌ・エー Image processing method, file conversion method, and file conversion program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156742A (en) * 2011-04-19 2011-08-17 北京神州数码思特奇信息技术股份有限公司 Method and middleware for supporting structured document display with own browser of mobile phone
CN104346322A (en) * 2013-08-08 2015-02-11 北大方正集团有限公司 Document format processing device and document format processing method
CN105630459A (en) * 2014-10-25 2016-06-01 上海未达数码科技有限公司 Method for converting PPT document to HTML page

Also Published As

Publication number Publication date
CN107943915A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
CN107943915B (en) Method and device for OFD (office file) online display based on HTML5
US10261983B2 (en) Method and device for webpage browsing, and mobile terminal
US8683311B2 (en) Generating structured data objects from unstructured web pages
TWI592807B (en) Method and device for web style address merge
CN110765385B (en) Method and system for browsing OFD document webpage end
US20080046449A1 (en) System and method for downloading hypertext markup language formatted web pages
US20080077855A1 (en) Generic website
JP2005284334A (en) Web page update notification method and apparatus
US7228493B2 (en) Serving content to a client
US20090112824A1 (en) Method and apparatus for generating presentation configuration file of document content
US20110145299A1 (en) Offline Gadgets IDE
CN110717127A (en) Method and device for on-line analysis and browsing of OFD (office file)
CN111104631B (en) Webp picture format conversion method
CN112487763A (en) SVG-based OFD file online display method, server side and system
CN103902571A (en) Method and system for saving webpage complete content and corresponding client end and server
CN113382083B (en) Webpage screenshot method and device
US9667696B2 (en) Low latency web-based DICOM viewer system
CN101916293A (en) Method and device for introducing media information into file
CN110837347A (en) Webpage printing method based on analysis plug-in, server and storage medium
JP2001195391A (en) Format conversion and page division relay server
US20090265420A1 (en) Method of rendering at least one element in a client browser
Schubotz et al. Mathoid: Robust, scalable, fast and accessible math rendering for wikipedia
WO2002082355A2 (en) A system and method for remotely collecting and displaying data
JP2008071116A (en) Information delivery system, information delivery device, information delivery method and information delivery program
CN116227444A (en) Online editing method and device based on graphic and text mixed Word document

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