CN116776031B - Method and device for checking accessory content in open format document OFD - Google Patents

Method and device for checking accessory content in open format document OFD Download PDF

Info

Publication number
CN116776031B
CN116776031B CN202311050407.0A CN202311050407A CN116776031B CN 116776031 B CN116776031 B CN 116776031B CN 202311050407 A CN202311050407 A CN 202311050407A CN 116776031 B CN116776031 B CN 116776031B
Authority
CN
China
Prior art keywords
file
document
viewing
type
display template
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
CN202311050407.0A
Other languages
Chinese (zh)
Other versions
CN116776031A (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 CN202311050407.0A priority Critical patent/CN116776031B/en
Publication of CN116776031A publication Critical patent/CN116776031A/en
Application granted granted Critical
Publication of CN116776031B publication Critical patent/CN116776031B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention provides a method and a device for checking accessory content in an open format document OFD, which relate to the technical field of computers and comprise the following steps: analyzing the obtained OFD document to obtain an analyzed OFD document; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; based on the type of the target accessory, a viewing mode corresponding to the type is called to view the target accessory, so that the accessories in different formats in the OFD document are viewed without jumping to other applications, the consistency of user operation is ensured, the viewing efficiency of a user is improved, and meanwhile, the reading experience of the user can be improved.

Description

Method and device for checking accessory content in open format document OFD
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for checking accessory content in an open format document OFD.
Background
Open layout documents (Open Format Document, OFD) are an open document format that provides a standardized solution for the creation, storage, and exchange of electronic documents. The attachment in the OFD document refers to other files attached to the OFD document, and the attachment can be stored together with the OFD document, so that the attachment can be conveniently checked or used when needed.
In the related art, the manner of viewing the attachment in the OFD document can jump to other applications on the mobile end and the personal computer (Personal Computer, PC) end, so that the viewing efficiency is low, and the reading experience of a user is reduced.
Disclosure of Invention
The invention provides a method and a device for checking attachment content in an open format document OFD, which are used for solving the problems of low checking efficiency and reduced user reading experience in the prior art.
The invention provides a viewing method of accessory content in an open format document OFD, comprising the following steps:
analyzing the obtained OFD document to obtain an analyzed OFD document;
determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment;
determining a type of the target attachment based on the view request for the target attachment;
and based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory.
According to the method for viewing the content of the attachment in the open format document OFD, the type of the target attachment is determined based on the viewing request of the target attachment, and the method comprises the following steps:
and determining the type of the target accessory by adopting an accessory format type detection method based on the viewing request of the target accessory.
According to the method for viewing the content of the attachment in the open format document OFD, the analyzed OFD document comprises the attachment comprising at least one of the following: text files, web page files, audio-video files, document files, three-dimensional model files, and application files.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
analyzing the text file to obtain the content of the text file under the condition that the type of the target attachment is the text file;
and calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
under the condition that the type of the target attachment is the webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content;
and calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
under the condition that the type of the target attachment is the audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images;
and calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, the video or the image on the third display template.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
under the condition that the type of the target attachment is the document file, analyzing the document file by adopting a corresponding document library to obtain document content;
and calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
loading the three-dimensional model file by using a loader provided by a three-dimensional model library under the condition that the type of the target accessory is the three-dimensional model file, so as to obtain a three-dimensional model;
and adding the three-dimensional model into the scene based on the created scene, and displaying and viewing the three-dimensional model.
According to the method for viewing the content of the attachment in the open format document OFD provided by the invention, the method for viewing the target attachment based on the type of the target attachment and calling the viewing mode corresponding to the type comprises the following steps:
importing an analysis plug-in under the condition that the type of the target attachment is the application program file, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name;
and calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template.
The invention also provides a viewing device of the accessory content in the open format document OFD, which comprises:
the analysis module is used for analyzing the obtained OFD document to obtain an analyzed OFD document;
the first determining module is used for determining a target attachment to be checked when the parsed OFD document comprises at least one format attachment;
a second determining module configured to determine a type of the target attachment based on a view request for the target attachment;
and the viewing module is used for calling a viewing mode corresponding to the type based on the type of the target accessory to view the target accessory.
The invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the method for viewing the accessory content in the open format document OFD when executing the program.
The present invention 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 viewing attachment content in an open layout document OFD as described in any one of the above.
According to the method and the device for checking the accessory content in the open format document OFD, the acquired OFD document is analyzed, and the analyzed OFD document is obtained; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; based on the type of the target accessory, a viewing mode corresponding to the type is called to view the target accessory, so that the accessories in different formats in the OFD document are viewed without jumping to other applications, the consistency of user operation is ensured, the viewing efficiency of a user is improved, and meanwhile, the reading experience of the user can be improved.
Drawings
In order to more clearly illustrate the invention 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 invention, 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 flow chart of a method for viewing attachment content in an open layout document OFD provided by the invention;
FIG. 2 is a second flow chart of a method for viewing attachment content in an open format document OFD provided by the invention;
FIG. 3 is a schematic diagram of a device for viewing attachment content in an open layout document OFD provided by the invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention 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 invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes a method for viewing the attachment content in the open layout document OFD provided by the present invention with reference to fig. 1 to fig. 2.
FIG. 1 is a schematic flow chart of a method for viewing attachment content in an open format document OFD provided by the invention, and as shown in FIG. 1, the method comprises steps 101-104; wherein,
and step 101, analyzing the obtained OFD document to obtain the analyzed OFD document.
It should be noted that, the method for viewing the accessory content in the open format document OFD provided by the present invention is suitable for viewing the accessory in the OFD document, and the execution body of the method may be a viewing device of the accessory content in the open format document OFD, for example, an electronic device, or a control module in the viewing device of the accessory content in the open format document OFD for executing the method for viewing the accessory content in the open format document OFD.
Specifically, the OFD document reader uses the OFD analyzer to analyze the obtained OFD document, and the analyzed OFD document can be obtained.
And step 102, determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment.
Specifically, the OFD document reader judges whether the parsed OFD document comprises an attachment in at least one format, and determines a target attachment to be checked from the attachment in at least one format according to actual requirements when the parsed OFD document comprises the attachment in at least one format.
Step 103, determining the type of the target accessory based on the view request of the target accessory.
Specifically, the OFD document reader can determine the type of the target attachment according to the viewing request of the target attachment in the case that the viewing request of the user of the target attachment is detected.
And 104, based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory.
Specifically, the OFD document reader integrates the viewing modes corresponding to all accessory types, and can call the viewing modes corresponding to the types according to the types of the target accessories, so that the content of the target accessories can be directly viewed without jumping to other applications.
Optionally, the user interface is presented for the target accessory to design, including interface layout, interactive design, functional design, and the like, so that the target accessory can be displayed on the user interface again, and the satisfaction degree of the user can be improved.
According to the method for viewing the accessory content in the open format document OFD, the acquired OFD document is analyzed, and the analyzed OFD document is obtained; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; based on the type of the target accessory, a viewing mode corresponding to the type is called to view the target accessory, so that the accessories in different formats in the OFD document are viewed without jumping to other applications, the consistency of user operation is ensured, the viewing efficiency of a user is improved, and meanwhile, the reading experience of the user can be improved.
Optionally, the specific implementation manner of step 103 includes:
and determining the type of the target accessory by adopting an accessory format type detection method based on the viewing request of the target accessory.
Specifically, according to the viewing request of the target accessory, an accessory format type detection method can be adopted to further determine the type of the target accessory. For example, a checkFileType attachment format type detection method.
Optionally, the attachment included in the parsed OFD document includes at least one of the following: text files, web page files, audio-video files, document files, three-dimensional model files, and application files.
Specifically, the text file is a txt format file, and the web page file is an html format file; the audio and video files are video files, music files or image files, wherein the video files are MP4, AVI, MOV or video files in other formats, the music files are MP3, WAV, FLAC or audio files in other formats, and the image files are JPEG, PNG, GIF or image files in other formats; the document file is WORD, PPT, PDF or an EXCEL format file, the three-dimensional model file is OBJ, STL, FBX or another format model file, and the application program file is an APK file.
Optionally, the attachments included in the parsed OFD document may further include a compressed file and an executable file; the compressed file is a ZIP file, and the executable file is an EXE file, for example, the EXE file is a Windows executable file, which can be run in a Windows operating system.
Optionally, the specific implementation manner of step 104 includes:
analyzing the text file to obtain the content of the text file under the condition that the type of the target attachment is the text file; and calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template.
Specifically, the OFD document reader constructs a display template library in advance, wherein the display template library comprises display templates corresponding to the type setting of each target accessory, and the display templates are used for displaying the content of the target accessory. Under the condition that the type of the target attachment is a text file (txt file), the text file is read by adopting javascript, and the text file is opened by adopting fso. Calling a first display template corresponding to the text file from a display template library, and displaying and viewing the content of the text file on the first display template; wherein the first display template is a text box or text region for displaying the content of the text file.
Optionally, the specific implementation manner of step 104 includes:
under the condition that the type of the target attachment is the webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content; and calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template.
Specifically, when the type of the target attachment is a webpage file (HTML file), the webpage file is parsed by a parsing engine, that is, the HTML file is parsed into webpage structural content, and the webpage structural content is rendered; calling a second display template corresponding to the webpage file from the display template library, and displaying and viewing the webpage structural content on the second display template; the second display template is used for displaying the webpage structural content.
Optionally, the specific implementation manner of step 104 includes:
under the condition that the type of the target attachment is the audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images; and calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, the video or the image on the third display template.
Specifically, under the condition that the type of the target attachment is an audio/video file (video file, music file or image file), aiming at the video file, adopting a video (video) tag to analyze the video file to obtain a video, calling a third display template corresponding to the video file from a display template library, and displaying and viewing the video on the third display template, namely playing the video; aiming at the music file, analyzing the music file by adopting an audio (audio) tag to obtain music, calling a third display template corresponding to the music file from a display template library, and displaying and viewing the music on the third display template, namely playing the music; aiming at the image file, analyzing the image file by adopting an image (img) label to obtain an image, calling a third display template corresponding to the image file from a display template library, and displaying and viewing the image on the third display template; the third display template is used for displaying images.
Optionally, the specific implementation manner of step 104 includes:
under the condition that the type of the target attachment is the document file, analyzing the document file by adopting a corresponding document library to obtain document content; and calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template.
Specifically, when the type of the target attachment is a document file (WORD, PPT, PDF or EXCEL format), an aspose.words.cpp library is installed for the document file in the WORD format by using a package management development tool (NuGet), the WORD document is parsed by using a corresponding document library (aspose.words.cpp library), the document content, style and layout of the document file in the WORD format are read, the WORD document content is obtained, a fourth display template corresponding to the document file in the WORD format is called from the display template library, HTML and CSS are used, and the WORD document content is displayed and checked on the fourth display template.
And for the document file in the PPT format, using NuGet to install an Aspose.PPT.Cpp library, adopting a corresponding document library (the Aspose.PPT.Cpp library) to analyze the document file in the PPT format to obtain texts and images in the document file in the PPT format, calling a fourth display template corresponding to the document file in the PPT format from a display template library, using HTML and CSS, and displaying and viewing the content of the PPT document on the fourth display template.
And for the document file in the PDF format, using NuGet to install an aspose.PDF.Cpp library, adopting a corresponding document library (aspose.PDF.Cpp library) to analyze the document file in the PDF format to obtain text, image and layout information in the document file in the PDF format, calling a fourth display template corresponding to the document file in the PDF format from a display template library, and displaying and viewing the text and image in the document file in the PDF format on the fourth display template according to the layout information.
And for the file in the EXCEL format, using NuGet to install an aspose. Cells. Cpp library, adopting a corresponding file library (aspose. Cells. Cpp library) to analyze the file in the EXCEL format to obtain data and a table structure in the file in the EXCEL format, calling a fourth display template corresponding to the file in the EXCEL format from a display template library, and displaying and viewing the data in the file in the EXCEL format on the fourth display template according to the table structure.
The fourth display template is used for displaying WORD, PPT, PDF or EXCEL format document content.
Optionally, the specific implementation manner of step 104 includes:
loading the three-dimensional model file by using a loader provided by a three-dimensional model library under the condition that the type of the target accessory is the three-dimensional model file, so as to obtain a three-dimensional model; and adding the three-dimensional model into the scene based on the created scene, and displaying and viewing the three-dimensional model.
Specifically, under the condition that the type of the target accessory is a three-dimensional model file (3D model file), loading the three-dimensional model file by using a loader provided by a three-dimensional model library (three.js library), and analyzing the three-dimensional model file by the three-dimensional model library to obtain a three-dimensional model; according to actual requirements, a scene is created in advance for the three-dimensional model, the loaded three-dimensional model is added into the scene according to the created scene, and the three-dimensional model is displayed and checked.
Optionally, the specific implementation manner of step 104 includes:
importing an analysis plug-in under the condition that the type of the target attachment is the application program file, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name; and calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template.
Specifically, under the condition that the type of the target attachment is an application program file (APK file), an analysis plug-in (app-info-player-master plug-in) is imported, and the analysis plug-in is used for loading and analyzing the application program file to obtain application program information; wherein the application information includes at least one of: application name, version number, picture path, package name, application file name; calling a fifth display template corresponding to the application program file from the display template library, and displaying and viewing the application program information on the fifth display template; the fifth display template is used for displaying application program information.
Optionally, under the condition that the type of the target attachment is an executable file, analyzing the executable file to obtain a file name and a version number corresponding to the executable file, calling a sixth display template corresponding to the executable file, and displaying and viewing the file name and the version number corresponding to the executable file on the sixth display template; the sixth display template is used for displaying the file name and the version number corresponding to the executable file.
If the current device is a Windows system, an operation button is arranged on the sixth display template, and the user clicks and installs an operation interface for entering the executable file; if the current device is another system, only the file name and version number of the executable file are displayed.
Optionally, under the condition that the type of the target attachment is a compressed file, decompressing the compressed file to obtain text, image, audio or other file types in the compressed file, and viewing the text, image, audio or other file types according to viewing modes corresponding to the text, image, audio or other file types.
FIG. 2 is a second flow chart of a method for viewing the content of an attachment in an open format document OFD, as shown in FIG. 2, comprising steps 201-220; wherein,
step 201, parsing the OFD document. And analyzing the obtained OFD document to obtain the analyzed OFD document.
Step 202, determining whether the parsed OFD document includes an attachment in at least one format. In case the parsed OFD document comprises attachments in at least one format, go to step 203; in the case that the parsed OFD document includes attachments in at least one format, go to step 220.
In step 203, the type of the target attachment is detected. Based on the viewing request of the target accessory, determining the type of the target accessory by adopting an accessory format type detection method.
And step 204, analyzing the text file. And under the condition that the type of the target attachment is a text file, analyzing the text file to obtain the content of the text file.
In step 205, the text file is viewed. And calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template.
Step 206, web page file parsing. And under the condition that the type of the target attachment is a webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content.
Step 207, viewing the web page file. And calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template.
And step 208, analyzing the audio and video files. And under the condition that the type of the target attachment is an audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images.
Step 209, viewing the audio and video file. And calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, video or image on the third display template.
Step 210, the document file is parsed. And under the condition that the type of the target attachment is a document file, analyzing the document file by adopting a corresponding document library to obtain document content.
Step 211, document file viewing. And calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template.
And step 212, analyzing the three-dimensional model file. And under the condition that the type of the target accessory is a three-dimensional model file, loading the three-dimensional model file by using a loader provided by a three-dimensional model library to obtain a three-dimensional model.
And step 213, viewing the three-dimensional model file. And adding the three-dimensional model into the scene based on the created scene, and displaying and viewing the three-dimensional model.
In step 214, the application file is parsed. Under the condition that the type of the target attachment is an application program file, importing an analysis plug-in, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name.
At step 215, the application file is viewed. And calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template.
In step 216, the executable file is parsed. And under the condition that the type of the target attachment is an executable file, analyzing the executable file to obtain a file name and a version number corresponding to the executable file.
Step 217, executable file view. And calling a sixth display template corresponding to the executable file, and displaying and viewing the file name and the version number corresponding to the executable file on the sixth display template.
Step 218, compressed file parsing. And under the condition that the type of the target attachment is a compressed file, decompressing the compressed file to obtain text, image, audio or other file types in the compressed file.
Step 219, the compressed file is viewed. And viewing the text, image, audio or other file types according to the viewing modes corresponding to the text, image, audio or other file types.
Step 220, end.
The method for checking the accessory content in the open format document OFD supports integration into any OFD document reader, so that a user can check accessories in various formats in the OFD document more conveniently, more quickly and more clearly in the reader, skip among applications is not needed, consistency of user operation is guaranteed, checking efficiency is improved, and satisfaction of the user is improved.
The device for viewing the accessory content in the open format document OFD provided by the invention is described below, and the device for viewing the accessory content in the open format document OFD described below and the method for viewing the accessory content in the open format document OFD described above can be referred to correspondingly.
Fig. 3 is a schematic structural diagram of a device for viewing attachment content in an open format document OFD provided by the present invention, and as shown in fig. 3, a device 300 for viewing attachment content in an open format document OFD includes an parsing module 301, a first determining module 302, a second determining module 303, and a viewing module 304; wherein,
the parsing module 301 is configured to parse the obtained OFD document to obtain a parsed OFD document;
a first determining module 302, configured to determine a target attachment to be viewed if the parsed OFD document includes an attachment in at least one format;
a second determining module 303, configured to determine a type of the target accessory based on a view request of the target accessory;
and the viewing module 304 is configured to invoke a viewing mode corresponding to the type based on the type of the target attachment, and view the target attachment.
According to the viewing device for the accessory content in the open format document OFD, the acquired OFD document is analyzed, and the analyzed OFD document is obtained; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; based on the type of the target accessory, a viewing mode corresponding to the type is called to view the target accessory, so that the accessories in different formats in the OFD document are viewed without jumping to other applications, the consistency of user operation is ensured, the viewing efficiency of a user is improved, and meanwhile, the reading experience of the user can be improved.
Optionally, the second determining module 303 is specifically configured to:
and determining the type of the target accessory by adopting an accessory format type detection method based on the viewing request of the target accessory.
Optionally, the attachment included in the parsed OFD document includes at least one of the following: text files, web page files, audio-video files, document files, three-dimensional model files, and application files.
Optionally, the view module 304 is specifically configured to:
analyzing the text file to obtain the content of the text file under the condition that the type of the target attachment is the text file;
and calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template.
Optionally, the viewing module 304 is further configured to:
under the condition that the type of the target attachment is the webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content;
and calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template.
Optionally, the viewing module 304 is further configured to:
under the condition that the type of the target attachment is the audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images;
and calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, the video or the image on the third display template.
Optionally, the viewing module 304 is further configured to:
under the condition that the type of the target attachment is the document file, analyzing the document file by adopting a corresponding document library to obtain document content;
and calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template.
Optionally, the viewing module 304 is further configured to:
loading the three-dimensional model file by using a loader provided by a three-dimensional model library under the condition that the type of the target accessory is the three-dimensional model file, so as to obtain a three-dimensional model;
and adding the three-dimensional model into the scene based on the created scene, and displaying and viewing the three-dimensional model.
Optionally, the viewing module 304 is further configured to:
importing an analysis plug-in under the condition that the type of the target attachment is the application program file, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name;
and calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template.
Fig. 4 is a schematic physical structure of an electronic device according to the present invention, as shown in fig. 4, the electronic device may include: processor 410, communication interface (Communications Interface) 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other via communication bus 440. The processor 410 may invoke logic instructions in the memory 430 to perform a method of viewing the attachment content in the open layout document OFD, the method comprising: analyzing the obtained OFD document to obtain an analyzed OFD document; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; and based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory.
Further, the logic instructions in the memory 430 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 invention 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 invention. 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 still another aspect, the present invention further 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 for viewing attachment content in an open layout document OFD provided by the methods described above, the method comprising: analyzing the obtained OFD document to obtain an analyzed OFD document; determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment; determining a type of the target attachment based on the view request for the target attachment; and based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory.
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 invention 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 invention, and are not limiting; although the invention 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 invention.

Claims (3)

1. The method for viewing the accessory content in the open format document OFD is characterized by comprising the following steps:
analyzing the obtained OFD document to obtain an analyzed OFD document;
determining a target attachment to be checked under the condition that the parsed OFD document comprises at least one format attachment;
determining a type of the target attachment based on the view request for the target attachment;
based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory;
the parsed OFD document comprises an accessory comprising at least one of the following: text files, web page files, audio and video files, document files, three-dimensional model files, application files, executable files, compressed files;
and based on the type of the target accessory, calling a viewing mode corresponding to the type to view the target accessory, wherein the method comprises the following steps:
analyzing the text file to obtain the content of the text file under the condition that the type of the target attachment is the text file; calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template;
under the condition that the type of the target attachment is the webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content; calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template;
under the condition that the type of the target attachment is the audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images; calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, the video or the image on the third display template;
under the condition that the type of the target attachment is the document file, analyzing the document file by adopting a corresponding document library to obtain document content; calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template;
loading the three-dimensional model file by using a loader provided by a three-dimensional model library under the condition that the type of the target accessory is the three-dimensional model file, so as to obtain a three-dimensional model; based on the created scene, adding the three-dimensional model into the scene, and displaying and viewing the three-dimensional model;
importing an analysis plug-in under the condition that the type of the target attachment is the application program file, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name; calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template;
analyzing the executable file to obtain a file name and a version number corresponding to the executable file when the type of the target attachment is the executable file, calling a sixth display template corresponding to the executable file, and displaying and viewing the file name and the version number corresponding to the executable file on the sixth display template; the sixth display template is used for displaying a file name and a version number corresponding to the executable file;
and under the condition that the type of the target attachment is the compressed file, decompressing the compressed file to obtain text, image, audio or other file types in the compressed file, and viewing the text, the image, the audio or the files of other file types according to viewing modes corresponding to the text, the image, the audio or the other file types respectively.
2. The method for viewing attachment content in an open layout document OFD according to claim 1, wherein the determining the type of the target attachment based on the viewing request for the target attachment comprises:
and determining the type of the target accessory by adopting an accessory format type detection method based on the viewing request of the target accessory.
3. A viewing device for attachment content in an open format document OFD, comprising:
the analysis module is used for analyzing the obtained OFD document to obtain an analyzed OFD document;
the first determining module is used for determining a target attachment to be checked when the parsed OFD document comprises at least one format attachment;
a second determining module configured to determine a type of the target attachment based on a view request for the target attachment;
the viewing module is used for calling a viewing mode corresponding to the type based on the type of the target accessory to view the target accessory;
the parsed OFD document comprises an accessory comprising at least one of the following: text files, web page files, audio and video files, document files, three-dimensional model files, application files, executable files, compressed files;
the viewing module is specifically configured to:
analyzing the text file to obtain the content of the text file under the condition that the type of the target attachment is the text file; calling a first display template corresponding to the text file, and displaying and viewing the content of the text file on the first display template;
under the condition that the type of the target attachment is the webpage file, analyzing the webpage file by adopting an analysis engine to obtain webpage structure content; calling a second display template corresponding to the webpage file, and displaying and viewing the webpage structural content on the second display template;
under the condition that the type of the target attachment is the audio-video file, analyzing the audio-video file by adopting a corresponding analysis tag to obtain audio, video or images; calling a third display template corresponding to the audio and video file, and displaying and viewing the audio, the video or the image on the third display template;
under the condition that the type of the target attachment is the document file, analyzing the document file by adopting a corresponding document library to obtain document content; calling a fourth display template corresponding to the document file, and displaying and viewing the document content on the fourth display template;
loading the three-dimensional model file by using a loader provided by a three-dimensional model library under the condition that the type of the target accessory is the three-dimensional model file, so as to obtain a three-dimensional model; based on the created scene, adding the three-dimensional model into the scene, and displaying and viewing the three-dimensional model;
importing an analysis plug-in under the condition that the type of the target attachment is the application program file, and loading the application program file by using the analysis plug-in to obtain application program information; the application information includes at least one of: application name, version number, picture path, package name, application file name; calling a fifth display template corresponding to the document file, and displaying and viewing the application program information on the fifth display template;
analyzing the executable file to obtain a file name and a version number corresponding to the executable file when the type of the target attachment is the executable file, calling a sixth display template corresponding to the executable file, and displaying and viewing the file name and the version number corresponding to the executable file on the sixth display template; the sixth display template is used for displaying a file name and a version number corresponding to the executable file;
and under the condition that the type of the target attachment is the compressed file, decompressing the compressed file to obtain text, image, audio or other file types in the compressed file, and viewing the text, the image, the audio or the files of other file types according to viewing modes corresponding to the text, the image, the audio or the other file types respectively.
CN202311050407.0A 2023-08-21 2023-08-21 Method and device for checking accessory content in open format document OFD Active CN116776031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311050407.0A CN116776031B (en) 2023-08-21 2023-08-21 Method and device for checking accessory content in open format document OFD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311050407.0A CN116776031B (en) 2023-08-21 2023-08-21 Method and device for checking accessory content in open format document OFD

Publications (2)

Publication Number Publication Date
CN116776031A CN116776031A (en) 2023-09-19
CN116776031B true CN116776031B (en) 2023-11-07

Family

ID=88008439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311050407.0A Active CN116776031B (en) 2023-08-21 2023-08-21 Method and device for checking accessory content in open format document OFD

Country Status (1)

Country Link
CN (1) CN116776031B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790459A (en) * 2016-12-08 2017-05-31 北京致远互联软件股份有限公司 A kind of online method for previewing of file and system
CN110362793A (en) * 2019-07-18 2019-10-22 江苏中威科技软件系统有限公司 A method of it converts and shows for layout files
CN114647412A (en) * 2020-12-18 2022-06-21 华为技术有限公司 Content display method and terminal equipment
CN114648775A (en) * 2022-04-02 2022-06-21 金蝶票据云科技(深圳)有限公司 Method and device for collecting electronic invoice based on mail
WO2023098448A1 (en) * 2021-12-02 2023-06-08 江苏中威科技软件系统有限公司 Method for converting ofd file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790459A (en) * 2016-12-08 2017-05-31 北京致远互联软件股份有限公司 A kind of online method for previewing of file and system
CN110362793A (en) * 2019-07-18 2019-10-22 江苏中威科技软件系统有限公司 A method of it converts and shows for layout files
CN114647412A (en) * 2020-12-18 2022-06-21 华为技术有限公司 Content display method and terminal equipment
WO2023098448A1 (en) * 2021-12-02 2023-06-08 江苏中威科技软件系统有限公司 Method for converting ofd file
CN114648775A (en) * 2022-04-02 2022-06-21 金蝶票据云科技(深圳)有限公司 Method and device for collecting electronic invoice based on mail

Also Published As

Publication number Publication date
CN116776031A (en) 2023-09-19

Similar Documents

Publication Publication Date Title
US9959269B1 (en) Method and system for implementing a website builder
US9276758B2 (en) Analyzing and repairing documents
CN102929646B (en) Application program generation method and device
CN111797336A (en) Webpage parsing method and device, electronic equipment and medium
CN113760729A (en) Code detection method and device
CN110780874A (en) Method and apparatus for generating information
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN114398673A (en) Application compliance detection method and device, storage medium and electronic equipment
CN112632425B (en) Method, device, equipment and storage medium for generating offline resource file
CN116776031B (en) Method and device for checking accessory content in open format document OFD
CN111737621A (en) OFD rendering method, system and device based on WASM
CN110737588A (en) automatic point burying method, device, medium and electronic equipment
CN110717134A (en) Product description issuing method and device, storage medium and electronic equipment
CN109240660B (en) Access method of advertisement data, storage medium, electronic device and system
CN114048048A (en) Information sharing method and device, electronic equipment and storage medium
CN112000416B (en) Card view generation method, device and computer readable storage medium
CN113778820A (en) Application program data export method, device, electronic device and storage medium
CN113190509A (en) Animation processing method and device, electronic equipment and computer readable storage medium
CN111414331A (en) Document importing method and device of online collaborative knowledge base, storage medium and equipment
CN116009863B (en) Front-end page rendering method, device and storage medium
CN117687684A (en) Method and device for generating component document
CN117270847A (en) Front-end page generation method and device, equipment and storage medium
CN114840269A (en) Dialog box display method and device, electronic equipment and storage medium
CN114595663A (en) ParaX file analysis method, system, device and computer storage medium

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