CN116304425A - Electronic document previewing method and related device - Google Patents

Electronic document previewing method and related device Download PDF

Info

Publication number
CN116304425A
CN116304425A CN202310245646.5A CN202310245646A CN116304425A CN 116304425 A CN116304425 A CN 116304425A CN 202310245646 A CN202310245646 A CN 202310245646A CN 116304425 A CN116304425 A CN 116304425A
Authority
CN
China
Prior art keywords
document
browser
transcoding
preview
file
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
CN202310245646.5A
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.)
Beijing Jidu Technology Co Ltd
Original Assignee
Beijing Jidu 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 Beijing Jidu Technology Co Ltd filed Critical Beijing Jidu Technology Co Ltd
Priority to CN202310245646.5A priority Critical patent/CN116304425A/en
Publication of CN116304425A publication Critical patent/CN116304425A/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

According to the method and the device for previewing the electronic document, the document triggering request comprising the browser identification is obtained, the electronic document corresponding to the document triggering request is transcoded according to the document triggering request, so that a transcoded file corresponding to the browser type is obtained, the transcoded file can be suitable for previewing and displaying of the corresponding type of browser in the client, the probability that the transcoded file cannot be previewed and displayed by some browsers is reduced on the basis that the requirements of previewing and displaying of the electronic documents of the types of word, excel and the like are met, and the adaptability of the method for previewing the electronic document is improved. In addition, the preview method of the electronic document can be privately deployed in an SDK mode, so that leakage possibly caused by transferring the electronic document through a third-party tool is avoided, and privacy and safety of the electronic document are guaranteed.

Description

Electronic document previewing method and related device
Technical Field
The embodiments in the present specification relate to the field of computer application technologies, and in particular, to browser application technologies in the field of computer application technologies, and more particularly, to a preview method of an electronic document and a related device.
Background
With the development of computer networks, documents are increasingly frequently transmitted and shared online, users have increasingly strong demands for online previewing of documents, and online previewing does not need to download original files, so that more convenient reading experience can be provided for the users.
However, the existing electronic document online previewing technology has poor adaptability and often has the situation of previewing failure.
Disclosure of Invention
Various embodiments in the present disclosure provide a preview method of an electronic document and a related device, so as to achieve the purpose of improving adaptability of the preview method of the electronic document.
In a first aspect, an embodiment of the present specification provides a preview method of an electronic document, applied to a server, the preview method of the electronic document including:
acquiring a document triggering request, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type;
and transcoding the electronic document corresponding to the document triggering request according to the document triggering request to obtain a transcoding file corresponding to the browser type, wherein the transcoding file is used for being transmitted to a client for preview display.
In a second aspect, an embodiment of the present specification provides a preview method of an electronic document, applied to a client, the preview method of the electronic document including:
Generating a document triggering request in response to a document triggering operation, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type; the document triggering request is used for requesting a server to transcode an electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type;
and acquiring the transcoding file and performing preview display.
In some implementations, the document trigger request is an HTTP request, and the browser identification is stored in an HTTP header of the HTTP request.
In a third aspect, an embodiment of the present specification provides a preview apparatus of an electronic document, applied to a server, the preview apparatus of the electronic document including:
the request acquisition module is used for acquiring a document triggering request, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type;
and the document transcoding module is used for transcoding the electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoding file corresponding to the browser type, and the transcoding file is used for being transmitted to a client for preview display.
In some embodiments, the browser identification includes a kernel identification for characterizing a kernel type of the browser and a version identification for characterizing a version level of the browser;
the document transcoding module transcodes the electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type, wherein the transcoded file is specifically used for:
if the version grade of the browser represented by the version identification is higher than or equal to a preset grade, converting the electronic document corresponding to the document triggering request into a first type of transcoding file, wherein the first type of transcoding file is used for being transmitted to the client and is previewed in a vector graphic mode; the preset grade corresponds to the kernel type of the browser characterized by the kernel identifier;
if the version grade of the browser represented by the version identification is lower than the preset grade, converting the electronic document corresponding to the document triggering request into a second type of transcoding file, wherein the second type of transcoding file is used for being transmitted to the client and is displayed in a previewing mode in a bitmap mode.
In some embodiments, the first type of transcoded file includes a portable file format PDF file;
the second type of transcoded file includes an image file.
In some embodiments, the document triggering request further includes: the transcoding identification is used for representing whether the electronic document corresponding to the document triggering request needs transcoding or not;
the document transcoding module is specifically configured to: if the transcoding identifier characterizes that the electronic document request corresponding to the document trigger needs transcoding, transcoding the electronic file corresponding to the document trigger request according to the document trigger request;
and if the transcoding identifier characterizes that the electronic document request corresponding to the document triggering does not need transcoding, transmitting the electronic document corresponding to the browser identifier to the client for display.
In some embodiments, the document triggering request further includes: the preview identifier is used for representing whether the client needs to preview the electronic document corresponding to the document triggering request;
the preview device of the electronic document further includes:
the task determining module is used for executing the step of transcoding the electronic file corresponding to the document triggering request according to the document triggering request if the preview identification characterizes that the client needs to preview the electronic file corresponding to the document triggering request;
And if the transcoding identification characterizes that the client does not need to preview the electronic file corresponding to the document triggering request, sending a downloading task to the client, wherein the downloading task is used for downloading the electronic file corresponding to the document triggering request.
In some embodiments, the document triggering request further includes: a history progress identifier, wherein the history progress identifier is used for representing a history preview page, and the history preview page is a page of an electronic document corresponding to the document triggering request which is previewed by the client last time;
the preview device of the electronic document further includes:
and the document sending module is used for sending the transcoding file carrying the history progress mark to the client so as to instruct the client to preview and display the transcoding file from the history preview page.
In a fourth aspect, an embodiment of the present specification provides a preview apparatus of an electronic document, applied to a client, the preview apparatus of the electronic document including:
the operation response module is used for responding to the document triggering operation and generating a document triggering request, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing the type of the browser; the document triggering request is used for requesting a server to transcode an electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type;
And the document display module is used for acquiring the transcoding file and performing preview display.
In some implementations, the document trigger request is an HTTP request, and the browser identification is stored in an HTTP header of the HTTP request.
In a fifth aspect, one embodiment of the present specification provides an electronic device comprising a processor and a memory;
wherein the memory is connected with the processor and is used for storing a computer program;
the processor is configured to implement the electronic document previewing method according to any one of the above claims by running a computer program stored in the memory.
In a sixth aspect, an embodiment of the present specification provides a computer readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing a method for previewing an electronic document as described above.
In a seventh aspect, one embodiment of the present specification provides a computer program product or a computer program, the computer program product comprising a computer program stored in a computer readable storage medium; the processor of the computer device reads the computer program from the computer readable storage medium, and the processor implements the steps of the above-described preview method of the electronic document when executing the computer program.
According to the embodiments provided by the specification, the document triggering request comprising the browser identification is obtained, and the electronic document corresponding to the document triggering request is transcoded according to the document triggering request, so that the transcoded file corresponding to the browser type is obtained, the transcoded file can be suitable for preview display of the corresponding type of browser in the client, the probability that the transcoded file cannot be previewed by some browsers is reduced on the basis of meeting the requirements of preview display of word, excel and other types of electronic documents, and the adaptability of the preview method of the electronic document is improved. In addition, the preview method of the electronic document can be privately deployed in a mode of SDK (Software Development Kit, software tool development kit), so that leakage possibly caused by transferring the electronic document through a third-party tool is avoided, and privacy and safety of the electronic document are guaranteed.
Drawings
FIG. 1 is a schematic illustration of an application product of a browser-server architecture provided in one embodiment of the present description;
fig. 2 is a schematic application scenario diagram of a preview method of an electronic document according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of a method for previewing an electronic document according to one embodiment of the present disclosure;
FIG. 4 is a flow chart of another method for previewing an electronic document according to one embodiment of the present disclosure;
FIG. 5 is a flow chart of a preview method of still another electronic document according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural flow diagram of a preview device for electronic documents according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural flow diagram of a preview device of another electronic document according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Unless defined otherwise, technical or scientific terms used in the embodiments of the present specification should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present specification belongs. The terms "first," "second," and the like, as used in the embodiments of the present disclosure, do not denote any order, quantity, or importance, but rather are used to avoid intermixing of the components.
Throughout the specification, unless the context requires otherwise, the word "plurality" means "at least two", and the word "comprising" is to be construed as open, inclusive meaning, i.e. as "comprising, but not limited to. In the description of the present specification, the terms "one embodiment," "some embodiments," "example embodiments," "examples," "particular examples," or "some examples," etc., are intended to indicate that a particular feature, structure, material, or characteristic associated with the embodiment or example is included in at least one embodiment or example of the present specification. The schematic representations of the above terms do not necessarily refer to the same embodiment or example.
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
SUMMARY
In the related art, a browser-Server (B/S) architecture application program is widely used, and referring to fig. 1, fig. 1 shows a schematic diagram of a browser-Server architecture application program product, where a Server 20 may be responsible for data processing tasks, a browser 10 may provide a man-machine interaction interface 11, and may be responsible for completing interaction tasks with a user, and in some cases, the browser 10 may also be responsible for part of the data processing tasks. It will be appreciated that although one server 20 is shown in fig. 1 as interacting with one browser 10, in some possible scenarios one server 20 may interact with multiple browsers 10, i.e. one server 20 may provide data processing functionality for multiple browsers 10, performing background services. The application of the browser-server structure has the main advantages that a user can use the browser only by installing specific client software on the client of the user, and part of application programs can run on the client, so that the load of the server is reduced.
Because of the above advantages of browser-server architecture applications, a large number of application products are currently built using browser-server architecture. The process when the user accesses the application in the server through the browser may be: the user operates in the browser, which generates an HTTP (Hyper Text Transfer Protocol ) message, sends it to the server, and waits for a response. The server receives the HTTP message, analyzes the message, processes the data, generates a response HTTP message, transmits the data range requested by the user to the client, and the client analyzes an HTML (Hyper Text Mark-up Language) file to acquire the required data.
As described in the background art, when a user obtains an electronic document through a browser, there is generally a need to preview the electronic document. For example, after a user wants to download a technical book and searches for an electronic document in which the technical book is recorded, the user needs to preview whether or not the content recorded in the found electronic document is correct or complete. Also for example, after uploading an electronic document to a server through a browser, a user typically needs to check through previewing the uploaded electronic document to ensure that the correct electronic document is uploaded. However, the inventor finds that the current popular browsers are numerous, more than one browser can be installed on the client by a user, and file formats supported by previews can be different by different browsers, so that after the user sends a preview request to the server through the browser, the user can obtain file formats not supported by the browser, and the previewing fails. To solve this problem, the inventors have studied to propose the following solutions: the browser identification is arranged in the document triggering request, so that the server can transcode the electronic document corresponding to the document triggering request according to the document triggering request, so as to obtain a transcoded file corresponding to the browser type, and the transcoded file obtained in this way corresponds to the browser type, so that the transcoded file can be suitable for previewing and displaying of the corresponding type of browser in the client, the probability that the transcoded file cannot be previewed and displayed by some browsers is reduced, and the adaptability of the previewing method of the electronic document is improved.
Based on the above conception, the inventor provides a preview method of an electronic document, and a possible application scenario and implementation of the preview method of the electronic document will be exemplarily described with reference to the accompanying drawings.
Exemplary scenario
Referring to fig. 2, fig. 2 shows a possible application scenario of a preview method of an electronic document, in fig. 2, a client used by a user may establish a communication connection with a server through an HTTP protocol, then the user may send a document triggering request to a server 20 through a browser 10 running on the client, the server 20 responds to and parses the document triggering request, perform document transcoding, and send a transcoded file to the browser 10, so that the browser 10 parses the transcoded file, obtains an electronic file to be previewed, and displays the electronic file for the user to preview.
Exemplary method
The embodiment of the present specification provides a preview method of an electronic document, as shown in fig. 3, exemplarily described as being applied to the server 20 shown in fig. 1, including:
s101: a document triggering request is acquired, wherein the document triggering request comprises a browser identification, and the browser identification is used for representing a browser type.
The document trigger request may be generated by the client in response to a document trigger operation (which may be, for example, a click operation of a button by a mouse, a click operation of a link by a mouse, or the like).
The browser types may be divided according to the types of file formats that the browser may support previewing, with different browser types supporting at least partially different file formats for previewing. For example, browser a supports previewing image files, browser B supports previewing PDF files, and browser C supports previewing PDF (Portable Document Format, portable file format) files and image files, and these three browsers can be divided into three browser types. Of course, the above-mentioned division manner is merely for example, and in other embodiments of the present specification, other browser types may be used, for example, a browser supporting a preview txt file and a browser supporting a preview image file may be divided into different browser types, which is not limited in this specification.
The browser identifier may be built-in the browser and may be used to directly or indirectly characterize parameters of the browser type, for example, the browser identifier may include one or more of a User Agent (User Agent, UA), a browser kernel identifier, a browser version identifier, and so on, where the User Agent is a comprehensive identifier that provides information about a vendor and version of the browser, an operating system and version, a browser kernel, and so on that are used by you to access a website.
S102: and transcoding the electronic document corresponding to the document triggering request according to the document triggering request to obtain a transcoding file corresponding to the browser type, wherein the transcoding file is used for being transmitted to a client for preview display.
The electronic documents corresponding to the document triggering request include, but are not limited to, word documents (Microsoft office Word), excel documents (Microsoft office Excel), PPT documents (Microsoft Office PowerPoint), json documents (JavaScript Object Notation, json object profile), xml documents (Extensible Markup Language ), txt documents (Text, text files), and PDF documents (Portable Document Format ).
In step S102, after the server obtains the document triggering request, the type of the browser used by the user (that is, the type of the browser sending the document triggering request) can be identified according to the browser identifier in the document triggering request, and the electronic document corresponding to the document triggering request is transcoded pertinently according to the type of the browser, so that the transcoded file can be suitable for previewing and displaying by the corresponding type of browser in the client, the probability that the transcoded file cannot be previewed and displayed by some browsers is reduced, and the adaptability of the previewing method of the electronic document is improved.
It can be understood that some browsers support previewing of PDF files, and the format of the electronic document corresponding to the document triggering request is also PDF files, so that after the server obtains the document triggering request, the server may not transcode the electronic document corresponding to the document triggering request, and may send the electronic document corresponding to the document triggering request to the client, so that the client performs previewing display by analyzing the electronic document.
In some embodiments, a feasible manner of browser identification and transcoding manner is provided, specifically, the browser identification comprises a kernel identification and a version identification, the kernel identification is used for representing the kernel type of the browser, and the version identification is used for representing the version level of the browser;
transcoding the electronic document corresponding to the document triggering request according to the document triggering request to obtain a transcoded file corresponding to the browser type includes:
if the version grade of the browser represented by the version identification is higher than or equal to a preset grade, converting the electronic document corresponding to the document triggering request into a first type of transcoding file, wherein the first type of transcoding file is used for being transmitted to the client and is previewed in a vector graphic mode; and the preset grade corresponds to the kernel type of the browser characterized by the kernel identification.
If the version grade of the browser represented by the version identification is lower than the preset grade, converting the electronic document corresponding to the document triggering request into a second type of transcoding file, wherein the second type of transcoding file is used for being transmitted to the client and is displayed in a previewing mode in a bitmap mode.
The browser kernel refers to the most central part of the browser, and is responsible for interpreting the webpage grammar (such as an application HTML, javascript in standard universal markup language) and rendering (displaying) the webpage. The browser kernel may be referred to as a rendering engine employed by the browser, which determines how the browser displays the content of the web page and the format information of the page. Types of browser kernels include, but are not limited to: tricent kernel (also known as MSHTML), gecko kernel, prest kernel, webkit kernel, blink kernel, etc.
Vector graphics (Vector graphics), also known as object-oriented images or pictorial images, are defined mathematically as a series of lines connected by points. The method is characterized in that the amplified image is not distorted and has no relation with resolution.
Bitmap images (bitmaps), also known as dot matrix images or raster images, are made up of individual dots called pixels (picture elements). The dots may be arranged and dyed differently to form a pattern.
In general, each version level browser supports rendering display of bitmap images, and only a browser with a version level higher than a certain level (i.e., a preset level) can support rendering display of vector image files. However, the preset grades of the browsers based on different kernels are different, so in the embodiment, the preset grades are corresponding to the kernel types of the browsers characterized by the kernel identifiers, the determination accuracy of the browser types is improved, and the transcoded files obtained by transcoding can be rendered and displayed by the corresponding browsers.
Optionally, the first type of transcoded file includes a portable file format PDF file.
The second type of transcoded file includes an image file.
In some cases, in order to meet the requirement of more individualization of the user, some embodiments of the present specification further enrich the preview method of the electronic document, and in one embodiment, the document triggering request further includes: the transcoding identification is used for representing whether the electronic document corresponding to the document triggering request needs transcoding or not;
if the transcoding identifier characterizes that the electronic document request corresponding to the document trigger needs transcoding, transcoding the electronic file corresponding to the document trigger request according to the document trigger request;
And if the transcoding identifier characterizes that the electronic document request corresponding to the document triggering does not need transcoding, transmitting the electronic document corresponding to the browser identifier to the client for display.
In some cases, the user may make clear that the electronic document to be previewed is directly displayable by the browser, and at this time, whether the server is required to perform transcoding operation or not may be marked by the transcoding identifier, which is beneficial to reducing the data processing capacity of the server and improving the execution efficiency of the method. That is, in this embodiment, the support client fills in the transcoding identifier in the document triggering request, and after the server obtains the document triggering request, the server may determine whether the user needs to transcode the electronic document corresponding to the document triggering request according to the transcoding identifier.
In another embodiment, the document triggering request further includes: the preview identifier is used for representing whether the client needs to preview the electronic document corresponding to the document triggering request;
the method further comprises the following steps before transcoding the electronic document corresponding to the document triggering request according to the document triggering request:
if the preview identifier characterizes that the client needs to preview the electronic file corresponding to the document triggering request, executing a step of transcoding the electronic file corresponding to the document triggering request according to the document triggering request;
And if the transcoding identification characterizes that the client does not need to preview the electronic file corresponding to the document triggering request, sending a downloading task to the client, wherein the downloading task is used for downloading the electronic file corresponding to the document triggering request.
As described above, the document triggering request may be generated by the client in response to the document triggering operation, and the document triggering operation of the user may be the need to preview the electronic document or may be the need to download the electronic document, so that the need of marking the user by the preview identifier may be reduced, unnecessary transcoding operation of the electronic document by the server may be reduced, the data processing capacity of the server may be reduced, and the execution efficiency of the preview method of the electronic document may be improved.
In yet another embodiment, the document triggering request further includes: a history progress identifier, wherein the history progress identifier is used for representing a history preview page, and the history preview page is a page of an electronic document corresponding to the document triggering request which is previewed by the client last time;
the preview method of the electronic document further comprises the following steps: and sending the transcoding file carrying the history progress mark to the client so as to instruct the client to preview and display the transcoding file from the history preview page.
In some usage scenarios, a user may preview the same electronic file multiple times, in order to mark the preview history of the user, in this embodiment, the last browsed history preview page of the user is marked by the history progress identifier, so that the client can directly display the history preview page when previewing this time, without the need for the user to slide the preview page again to find the history preview page, thereby improving user experience.
The history progress mark can be set through a page number of a history preview page, or can be set through a progress percentage of the history preview page in the whole electronic document, and a specific setting mode of the history progress mark is not limited in the specification, and is specific according to actual conditions.
In still another embodiment of the present disclosure, taking a client as an example, there is provided a method for previewing an electronic document, as shown in fig. 4, the method for previewing an electronic document includes:
s201: generating a document triggering request in response to a document triggering operation, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type; the document triggering request is used for requesting a server to transcode an electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type;
S202: and acquiring the transcoding file and performing preview display.
The preview method applied to the respective electronic documents of the Client and the server may be packaged in a SDK (Software Development Kit ) for the respective operations of the server and the Client, where the SDK may be developed based on a C/S (Client/server) architecture using a Java script language and a nodjs language.
In some implementations, the document trigger request is an HTTP request, and the browser identification is stored in an HTTP header of the HTTP request. Storing the browser identification in the HTTP header may enable the method to be generic without requiring modification of the linked content of each HTTP request.
In still another embodiment of the present disclosure, taking application to a client and a server as an example, there is provided a method for previewing an electronic document, as shown in fig. 5, the method for previewing an electronic document includes:
s301: the method comprises the steps that a client responds to a document triggering operation, and a document triggering request is generated, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type; the document triggering request is used for requesting a server to transcode the electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type.
S302: the server obtains a document trigger request.
S303: and the server transcodes the electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type, and sends the transcoded file to the client.
S304: and the client acquires the transcoding file and performs preview display.
The preview method of the electronic document applied to the client, the client and the server provided in the embodiments of the present disclosure is the same conception as the preview method of the electronic document applied to the server provided in the embodiments of the present disclosure. Technical details not described in detail in this embodiment may be referred to the specific processing content of the preview method of the electronic document provided in the foregoing embodiment of the present disclosure, and will not be described herein again.
In addition, the preview method of the electronic document applied to the server and the client can be privately deployed on the corresponding server and client in an SDK mode, so that the problem of leakage possibly caused by shifting the electronic document through a third-party tool is avoided, and the privacy and the safety of the electronic document are ensured.
Exemplary apparatus
One embodiment of the present specification provides a preview apparatus of an electronic document, applied to a server, as shown in fig. 6, the preview apparatus of the electronic document including:
a request acquisition module 100, configured to acquire a document trigger request, where the document trigger request includes a browser identifier, and the browser identifier is used to characterize a browser type;
the document transcoding module 200 is configured to transcode an electronic document corresponding to the document triggering request according to the document triggering request, so as to obtain a transcoded file corresponding to the browser type, where the transcoded file is used for being transmitted to a client for preview display.
In some embodiments, the browser identification includes a kernel identification for characterizing a kernel type of the browser and a version identification for characterizing a version level of the browser;
the document transcoding module transcodes the electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type, wherein the transcoded file is specifically used for:
if the version grade of the browser represented by the version identification is higher than or equal to a preset grade, converting the electronic document corresponding to the document triggering request into a first type of transcoding file, wherein the first type of transcoding file is used for being transmitted to the client and is previewed in a vector graphic mode; the preset grade corresponds to the kernel type of the browser characterized by the kernel identifier;
If the version grade of the browser represented by the version identification is lower than the preset grade, converting the electronic document corresponding to the document triggering request into a second type of transcoding file, wherein the second type of transcoding file is used for being transmitted to the client and is displayed in a previewing mode in a bitmap mode.
In some embodiments, the first type of transcoded file includes a portable file format PDF file;
the second type of transcoded file includes an image file.
In some embodiments, the document triggering request further includes: the transcoding identification is used for representing whether the electronic document corresponding to the document triggering request needs transcoding or not;
the document transcoding module is specifically configured to: if the transcoding identifier characterizes that the electronic document request corresponding to the document trigger needs transcoding, transcoding the electronic file corresponding to the document trigger request according to the document trigger request;
and if the transcoding identifier characterizes that the electronic document request corresponding to the document triggering does not need transcoding, transmitting the electronic document corresponding to the browser identifier to the client for display.
In some embodiments, the document triggering request further includes: the preview identifier is used for representing whether the client needs to preview the electronic document corresponding to the document triggering request;
The preview device of the electronic document further includes:
the task determining module is used for executing the step of transcoding the electronic file corresponding to the document triggering request according to the document triggering request if the preview identification characterizes that the client needs to preview the electronic file corresponding to the document triggering request;
and if the transcoding identification characterizes that the client does not need to preview the electronic file corresponding to the document triggering request, sending a downloading task to the client, wherein the downloading task is used for downloading the electronic file corresponding to the document triggering request.
In some embodiments, the document triggering request further includes: a history progress identifier, wherein the history progress identifier is used for representing a history preview page, and the history preview page is a page of an electronic document corresponding to the document triggering request which is previewed by the client last time;
the preview device of the electronic document further includes:
and the document sending module is used for sending the transcoding file carrying the history progress mark to the client so as to instruct the client to preview and display the transcoding file from the history preview page.
In addition, an embodiment of the present specification provides a preview apparatus of an electronic document, applied to a client, as shown in fig. 7, the preview apparatus of the electronic document including:
An operation response module 300, configured to generate a document trigger request in response to a document trigger operation, where the document trigger request includes a browser identifier, and the browser identifier is used to characterize a browser type; the document triggering request is used for requesting a server to transcode an electronic document corresponding to the document triggering request according to the document triggering request so as to obtain a transcoded file corresponding to the browser type;
and the document display module 400 is used for acquiring the transcoding file and performing preview display.
In some implementations, the document trigger request is an HTTP request, and the browser identification is stored in an HTTP header of the HTTP request.
The preview device of the electronic document applied to the server and the client can be privately deployed on the corresponding server and client in an SDK mode, so that the problem of leakage possibly caused by shifting the electronic document through a third-party tool is avoided, and the privacy and the safety of the electronic document are ensured.
The preview device of the electronic document provided in this embodiment belongs to the same application concept as the preview method of the electronic document provided in the above embodiment of the present specification, and may execute the preview method of the electronic document provided in any of the above embodiments of the present specification, and has a functional module and beneficial effects corresponding to executing the preview method of the electronic document. Technical details not described in detail in this embodiment may be referred to the specific processing content of the preview method of the electronic document provided in the foregoing embodiment of the present disclosure, and will not be described herein again.
Exemplary electronic device
Another embodiment of the present application further provides an electronic device, referring to fig. 8, and an exemplary embodiment of the present specification further provides an electronic device, including: a memory storing a computer program, and a processor that executes steps in the preview method of an electronic document according to various embodiments of the present specification described in the above embodiments of the present specification.
The internal structure of the electronic device may be as shown in fig. 8, and the electronic device includes a processor, a memory, a network interface, and an input device connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, performs the steps in the preview method of an electronic document according to various embodiments of the present specification described in the above embodiments of the present specification.
The processor may include a host processor, and may also include a baseband chip, modem, and the like.
The memory stores the computer program for executing the technical scheme of the invention, and can also store an operating system and other key services. In particular, the computer program may comprise program code comprising computer operating instructions. More specifically, the memory may include read-only memory (ROM), other types of static storage devices that may store static information and instructions, random access memory (random access memory, RAM), other types of dynamic storage devices that may store information and instructions, disk storage, flash, and the like.
The processor may be a general-purpose processor, such as a general-purpose Central Processing Unit (CPU), microprocessor, etc., or may be an Application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. But may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The input device may include means for receiving data and information entered by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer or gravity sensor, etc.
The output device may include means, such as a display screen, printer, speakers, etc., that allow information to be output to the user.
The communication interface may include means, such as any transceiver, for communicating with other devices or communication networks, such as ethernet, radio Access Network (RAN), wireless Local Area Network (WLAN), etc.
The processor executes the computer program stored in the memory and invokes other devices, which may be used to implement the steps of any of the preview methods for electronic documents provided in the embodiments described above.
The electronic equipment can also comprise a display component and a voice component, wherein the display component can be a liquid crystal display screen or an electronic ink display screen, an input device of the electronic equipment can be a touch layer covered on the display component, can also be a key, a track ball or a touch pad arranged on a shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of a portion of the structure associated with the present description and does not constitute a limitation of the electronic device to which the present description is applied, and that a particular electronic device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, the preview method of an electronic document provided by the embodiments of the present specification may also be a computer program product comprising a computer program which, when executed by a processor, causes the processor to perform the steps in the preview method of an electronic document according to the various embodiments of the present specification described in the "exemplary methods" section of the present specification.
The computer program product may write program code for performing the operations of embodiments of the present description in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, the present specification embodiment also provides a computer-readable storage medium having stored thereon a computer program that is executed by a processor to perform the steps in the preview method of an electronic document according to the various embodiments of the present specification described in the above-described "exemplary method" section of the present specification.
It will be appreciated that the specific examples herein are intended only to assist those skilled in the art in better understanding the embodiments of the present description and are not intended to limit the scope of the present description.
It should be understood that, in various embodiments of the present disclosure, the sequence number of each process does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
It will be appreciated that the various embodiments described in this specification may be implemented either alone or in combination, and are not limited in this regard.
Unless defined otherwise, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this specification belongs. The terminology used in the description is for the purpose of describing particular embodiments only and is not intended to limit the scope of the description. The term "and/or" as used in this specification includes any and all combinations of one or more of the associated listed items. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It will be appreciated that the processor of the embodiments of the present description may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method embodiments may be implemented by integrated logic circuits of hardware in a processor or instructions in software form. The processor may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
It will be appreciated that the memory in the embodiments of this specification may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable Programmable ROM (EPROM), an Electrically Erasable Programmable ROM (EEPROM), or a flash memory, among others. The volatile memory may be Random Access Memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. 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 specification.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and unit may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present specification may be integrated into one processing unit, each unit may exist alone physically, or two or more units may be integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present specification may be essentially or portions contributing to the prior art or portions of the technical solutions may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present specification. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a read-only memory (ROM), a random-access memory (RAM), a magnetic disk, or an optical disk, etc.
The foregoing is merely specific embodiments of the present disclosure, but the scope of the disclosure is not limited thereto, and any person skilled in the art who is skilled in the art can easily think about variations or substitutions within the scope of the disclosure of the present disclosure, and it is intended to cover the variations or substitutions within the scope of the disclosure. Therefore, the protection scope of the present specification shall be subject to the protection scope of the claims.

Claims (10)

1. A preview method of an electronic document, applied to a server, the preview method of the electronic document comprising:
acquiring a document triggering request, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type;
and transcoding the electronic document corresponding to the document triggering request according to the document triggering request to obtain a transcoding file corresponding to the browser type, wherein the transcoding file is used for being transmitted to a client for preview display.
2. The method of claim 1, wherein the browser identification comprises a kernel identification and a version identification, the kernel identification being used to characterize a kernel type of a browser, the version identification being used to characterize a version level of the browser;
transcoding the electronic document corresponding to the document triggering request according to the document triggering request to obtain a transcoded file corresponding to the browser type includes:
if the version grade of the browser represented by the version identification is higher than or equal to a preset grade, converting the electronic document corresponding to the document triggering request into a first type of transcoding file, wherein the first type of transcoding file is used for being transmitted to the client and is previewed in a vector graphic mode; the preset grade corresponds to the kernel type of the browser characterized by the kernel identifier;
If the version grade of the browser represented by the version identification is lower than the preset grade, converting the electronic document corresponding to the document triggering request into a second type of transcoding file, wherein the second type of transcoding file is used for being transmitted to the client and is displayed in a previewing mode in a bitmap mode.
3. The method of claim 2, wherein the first type of transcoded file comprises a portable file format PDF file;
the second type of transcoded file includes an image file.
4. The method of claim 1, wherein the document trigger request further comprises: the transcoding identification is used for representing whether the electronic document corresponding to the document triggering request needs transcoding or not;
if the transcoding identifier characterizes that the electronic document request corresponding to the document trigger needs transcoding, transcoding the electronic file corresponding to the document trigger request according to the document trigger request;
and if the transcoding identifier characterizes that the electronic document request corresponding to the document triggering does not need transcoding, transmitting the electronic document corresponding to the browser identifier to the client for display.
5. The method of claim 1, wherein the document trigger request further comprises: the preview identifier is used for representing whether the client needs to preview the electronic document corresponding to the document triggering request;
The method further comprises the following steps before transcoding the electronic document corresponding to the document triggering request according to the document triggering request:
if the preview identifier characterizes that the client needs to preview the electronic file corresponding to the document triggering request, transcoding the electronic file corresponding to the document triggering request according to the document triggering request;
and if the transcoding identification characterizes that the client does not need to preview the electronic file corresponding to the document triggering request, sending a downloading task to the client, wherein the downloading task is used for downloading the electronic file corresponding to the document triggering request.
6. The method of any one of claims 1-5, wherein the document trigger request further comprises: a history progress identifier, wherein the history progress identifier is used for representing a history preview page, and the history preview page is a page of an electronic document corresponding to the document triggering request which is previewed by the client last time;
the preview method of the electronic document further comprises the following steps: and sending the transcoding file carrying the history progress mark to the client so as to instruct the client to preview and display the transcoding file from the history preview page.
7. A preview method of an electronic document, applied to a client, the preview method of the electronic document comprising:
generating a document triggering request in response to a document triggering operation, wherein the document triggering request comprises a browser identifier, and the browser identifier is used for representing a browser type; the document triggering request is used for requesting a server to transcode an electronic document corresponding to the document triggering request so as to obtain a transcoded file corresponding to the browser type;
and acquiring the transcoding file and performing preview display.
8. The method of claim 7, wherein the document trigger request is an HTTP request, and the browser identification is stored in an HTTP header of the HTTP request.
9. An electronic device, comprising: a processor and a memory;
wherein the memory is connected with the processor and is used for storing a computer program;
the processor is configured to implement the preview method of an electronic document according to any one of claims 1 to 8 by running a computer program stored in the memory.
10. A computer program product, comprising: a computer program stored in a computer readable storage medium; a processor of a computer device reads the computer program from the computer readable storage medium, the processor implementing the steps of the preview method of an electronic document according to any of claims 1 to 8 when the computer program is executed.
CN202310245646.5A 2023-03-09 2023-03-09 Electronic document previewing method and related device Pending CN116304425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310245646.5A CN116304425A (en) 2023-03-09 2023-03-09 Electronic document previewing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310245646.5A CN116304425A (en) 2023-03-09 2023-03-09 Electronic document previewing method and related device

Publications (1)

Publication Number Publication Date
CN116304425A true CN116304425A (en) 2023-06-23

Family

ID=86833803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310245646.5A Pending CN116304425A (en) 2023-03-09 2023-03-09 Electronic document previewing method and related device

Country Status (1)

Country Link
CN (1) CN116304425A (en)

Similar Documents

Publication Publication Date Title
CN107766359B (en) Method and device for converting page content into picture and computing equipment
CN108733738B (en) Page loading method, system, server and terminal
US7647074B2 (en) Cellular telephone with print preview system
WO2017088509A1 (en) Page customization method and device
CN112114913B (en) Application program interface updating method and device, computer equipment and storage medium
US20100031139A1 (en) Network system
US9582232B2 (en) Information processing apparatus, processing method, and storage medium for building a print application using a hybrid application
US10389792B2 (en) Output function dividing system
US9117314B2 (en) Information output apparatus, method, and recording medium for displaying information on a video display
CN110837347A (en) Webpage printing method based on analysis plug-in, server and storage medium
US20110066678A1 (en) Webpage browsing system, server, webpage browsing method, program and recording medium for the same
CN110019037B (en) PDF file display method, device, equipment and storage medium
JP2021064359A (en) Web page processing method, web page processing device, electronic device, non-temporary computer-readable storage medium, and computer program
JP5530217B2 (en) Document browsing system and document conversion server
US9311040B2 (en) System, control method for same, and image processing apparatus
JP2005517255A (en) Upload style sheets to handle device diversity well
WO2010128339A2 (en) Method and apparatus for printing from a mobile device
CN116304425A (en) Electronic document previewing method and related device
CN114780888A (en) Webpage picture generation method and system, electronic equipment and storage medium
JP2004536413A (en) How to output content from the Internet
JP5427931B2 (en) Form server device, control method for form server device, and control program for form server device
JP4007452B2 (en) System and program for displaying device information using browser
US20150248347A1 (en) Content providing apparatus and method, and computer program product
JP2010041401A (en) Relay device, communication relay method, its program, and relay system
JP5069322B2 (en) Form generation device, form generation method, and form generation program

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