CN115630608A - Visual document display method and device, electronic equipment and medium - Google Patents

Visual document display method and device, electronic equipment and medium Download PDF

Info

Publication number
CN115630608A
CN115630608A CN202211373469.0A CN202211373469A CN115630608A CN 115630608 A CN115630608 A CN 115630608A CN 202211373469 A CN202211373469 A CN 202211373469A CN 115630608 A CN115630608 A CN 115630608A
Authority
CN
China
Prior art keywords
document
canvas
visual
data
page
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
CN202211373469.0A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202211373469.0A priority Critical patent/CN115630608A/en
Publication of CN115630608A publication Critical patent/CN115630608A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Abstract

The invention discloses a visual document display method, a visual document display device, electronic equipment and a visual document display medium, wherein the visual document display method comprises the following steps: when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label; acquiring binary data of the visual document; converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in; rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page. According to the invention, the binary data of the visual document is restored to the DOM of the canvas through the canvas tag of the bearing page, and the DOM is rendered and displayed on the bearing page, so that the compatibility of the visual document is improved.

Description

Visual document display method and device, electronic equipment and medium
Technical Field
The invention relates to the technical field of data processing, in particular to a visual document display method, a visual document display device, electronic equipment and a visual document display medium.
Background
The pdf file has good user experience due to its powerful functions. The method is widely applied to the fields of review, evidence, sharing and the like, and is an important carrier for users to acquire information on the internet. Compared with the traditional file, the file flow has the characteristics of good flexibility and high safety. Combining the advantages of pdf files, the application of pdf formatted file streams on the internet is very wide, such as file downloading, online review, security documents, etc.
The browser is used as an information tool of the internet, various browsers are in a infinite state from the birth date of the internet, various APPs are born along with the explosion of the mobile internet, and the browser is also essentially the browser. Since different browser standards may be different or versions of the same browser may be different, file compatibility issues arise where the same pdf file is presented to the user differently in different browsers or different versions. Since some files contain important information, such as the seal of the pdf file, if lost in some browsers. Creating distrust for the customer and affecting customer satisfaction.
Disclosure of Invention
The embodiment of the invention aims to provide a visual document display method, a visual document display device, electronic equipment and a computer-readable storage medium.
In a first aspect, to achieve the above object, an embodiment of the present invention provides a visualized document displaying method, including:
when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
acquiring binary data of the visual document;
converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in;
rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page.
In a second aspect, to solve the same technical problem, an embodiment of the present invention provides a visual document presentation apparatus, including:
the page jump module is used for jumping to a bearing page provided with a canvas label when the visual document to be displayed is obtained;
the data acquisition module is in communication connection with the page skip module and is used for acquiring binary data of the visual document;
the parameter analysis module is in communication connection with the data acquisition module and is used for converting the binary data into a document object model of the canvas and configuring the document object model under the drawing parameters in the display configuration file of the document analysis plug-in;
and the document display module is in communication connection with the page jump module and the parameter analysis module, and is used for rendering the document object model to the canvas based on the drawing parameters and displaying the document object model on the bearing page.
In a third aspect, to solve the same technical problem, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the memory is coupled to the processor, and the processor implements the steps in the visual document presentation method described in any one of the above when executing the computer program.
In a fourth aspect, to solve the same technical problem, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, where, when the computer program runs, a device in which the computer-readable storage medium is located is controlled to execute the steps in the visualized document presentation method according to any one of the above.
The embodiment of the invention provides a visual document display method and device, electronic equipment and a computer readable storage medium, when a visual document to be displayed is obtained, by means of the canvas standard that almost all browser manufacturers support W3C, binary data of the visual document is restored to a DOM structure of canvas through a canvas tag of a bearing page, and the faithful visual document is displayed on the bearing page. Through the underlying restoration operation, the visualized document can not cause compatibility problems due to differences of browsers.
Drawings
The above features, technical features, advantages and modes of implementing the present invention will be further described in the following detailed description of preferred embodiments in a clearly understandable manner by referring to the accompanying drawings.
Fig. 1 is a schematic flowchart of a visual document display method according to an embodiment of the present application;
fig. 2 is another schematic flow chart of a visualized document displaying method provided in an embodiment of the present application;
fig. 3 is another schematic flowchart of a visualized document displaying method according to an embodiment of the present application;
fig. 4 is another schematic flowchart of a visualized document displaying method provided in an embodiment of the present application;
fig. 5 is another schematic flowchart of a visualization document displaying method according to an embodiment of the present application;
fig. 6 is another schematic flowchart of a visualized document displaying method according to an embodiment of the present application;
fig. 7 is another schematic flowchart of a visualized document displaying method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 9 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. Moreover, in the interest of brevity and understanding, only one of the components having the same structure or function is illustrated schematically or designated in some of the drawings. In this document, "a" means not only "only one of this but also a case of" more than one ".
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
In addition, in the description of the present application, the terms "first," "second," and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
Referring to fig. 1, fig. 1 is a schematic flow chart of a visualized document displaying method according to an embodiment of the present invention, including steps S101 to S104.
S101, when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
specifically, the visual document includes, but is not limited to, a pdf (portable document format) document, the canvas tag is a canvas tag of H5, and almost all browser manufacturers support the canvas standard of W3C, so that when the visual document to be displayed is acquired, a carrier page provided with the canvas tag is skipped. H5 is an abbreviation for HTML5, H5 being the 5 th language of HTML. HTML English is called Hyper Text markup language, and Chinese is translated into a hypertext markup language, which is a markup compiling language for constituting web pages.
The method includes the steps that a three-party open source project document analysis plug-in (such as pdf.js) is introduced into a bearing page, the document analysis plug-in comprises a document analysis file (such as pdf.worker.js) and a corresponding display configuration file (viewer.js), the document analysis file is used for analyzing a visual document to be displayed, and the display configuration file is used for configuring parameters when the bearing page displays the visual document to be displayed.
Referring to fig. 2, fig. 2 is a schematic flow diagram illustrating a process of jumping to a bearer page provided with a canvas tag when a visual document to be displayed is acquired in the visual document display method according to the embodiment of the present invention, and the process includes steps S201 to S202.
S201, when a visual document to be displayed is acquired, acquiring a target document format which is directly displayed by a current browser;
specifically, there may be different browser standards or different versions of the same browser, which may cause a file compatibility problem, and the same visualized document presents to the user in different browsers or different versions, that is, the visualized document directly opens possible data, such as a watermark, a common seal, and the like, in a certain browser. Therefore, when the visual document to be displayed is obtained, the target document format which is directly displayed by the current browser is obtained. The current browser is used for a user to view a visual document to be displayed, and the situations of data loss, abnormal display and the like can not occur when the current browser directly opens a document corresponding to a target document format.
The target document format which the current browser supports direct display is preset and can be written into the configuration parameters of the current browser. The target document format can be obtained by comparing a complete target document opened by using a specific reader with the same target document opened by the browser to be identified, and if the document contents of the target document displayed by the two are the same, the document format of the target document is the target document format supported by the browser to be identified. In addition, the data loss of the documents in the formats opened by the browser to be identified can be determined through manual observation and recorded so as to obtain the target document format of the browser.
S202, if the target document format does not comprise the document format of the visual document, jumping to a bearing page provided with a canvas label;
specifically, when the visual document to be displayed is acquired, the document format corresponding to the visual document may be acquired, for example, the document format of the visual document is determined by a name suffix or attribute information of the visual document. If the target document format does not comprise the document format of the visual document, it is indicated that the current browser does not support the direct opening of the visual document, and if the current browser directly opens the visual document, data loss may be caused, so that the browser jumps to a bearing page provided with a canvas label, and the visual document is displayed on the bearing page through canvas rendering.
S102, acquiring binary data of the visual document;
specifically, a document parsing file (e.g., pdf. Worker. Js) needs to receive binary data, and then converts the binary data into canvas, so as to obtain the binary data of the visual document. The page initially obtains the binary data of the server file stream through the ajax request, and may also request the binary data through a method such as fetch, which is not specifically limited in this embodiment. The ajax request is critical and needs to be set at the request header, for example, mimeType:' text/plane; charset = x-user-defined' to ensure that the returned data is binary data of the visual document.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating that binary data of a visual document is acquired in the visual document presentation method according to the embodiment of the present invention, and the method includes steps S301 to S303.
S301, obtaining a description text of the visual document;
s302, extracting a plurality of object data of the visual document and position information of each object data according to the description text;
s303, obtaining binary data of the visual document according to the object data and the position information.
The specific visual document comprises a description text, and the description text comprises file header information, a file body, a cross reference table and a file tail of the visual document. For example, a cross reference table is an important part of a visual document that holds all profile objects at physically offset addresses in the visual document, including indirect object information in the file. Typically, the cross reference table begins with the word "xref". The purpose of the cross reference table is to allow random access to objects in the file. Therefore, several object data of the visualized document and position information of each object data can be extracted from the description text. The object data at least comprises one or more of picture elements, vector elements and text elements. The position information is information such as the placing position and the size of each object data in the visual document, and a page can be reconstructed according to the information and displayed to a user. And finally, obtaining the binary data of the visualized document according to the object data and the position information, wherein the binary data contains necessary information for displaying the visualized document to be displayed.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a process of acquiring binary data of a visual document and then storing the binary data in the visual document displaying method according to the embodiment of the present invention, where the process includes steps S401 to S403.
S401, opening up a continuous storage space, and establishing a data view of the visual document in the continuous storage space, wherein the space size of the continuous storage space is the same as the data size of the binary data;
specifically, when the binary data is acquired, a continuous storage space is opened up for storing the binary data, and therefore the size of the continuous storage space is the same as the size of the binary data. The method comprises the steps of storing binary data in a continuous storage space, calling the binary data in the continuous storage space, and establishing a data view of a visual document in the continuous storage space, wherein the data view is in a format of binary storage information.
S402, storing the binary data in a continuous storage space provided with the data view, and referring to an address of the data view through a preset variable parameter;
specifically, binary data is stored in a continuous storage space provided with a data view, and the stored binary data is called through the data view. In addition, a preset variable parameter is set, and then the address of the data view is referred by the preset variable parameter so as to locate data during subsequent calling.
S403, configuring the address parameter of the file to be previewed in the display configuration file as the preset variable parameter.
Specifically, the address parameter of the file to be previewed in the display configuration file is configured as the preset variable parameter. For example, a preset variable parameter pdfRawData refers to the address of the data view, and when the binary data is stored, a configuration item is set for the imported viewer. // pdfRawData, view data in memory.
In this embodiment, a preset variable parameter is set to refer to an address of a data view of a continuous storage space where binary data is stored, and the variable parameter is configured in a file address parameter to be previewed in a display configuration file, so that a correct position of the binary data is determined to be called, and display of a visual document is achieved.
Referring to fig. 5, fig. 5 is a schematic flow chart illustrating the determination of the data view of the visualized document in the visualized document displaying method according to the embodiment of the present invention, and the method includes steps S501 to S502.
S501, acquiring a document format of the visual document;
s502, determining the data view of the visual document according to the corresponding relation between the document format and a preset information storage format.
Specifically, the document format of the visualized document is obtained, and is determined, for example, by a name suffix or attribute information of the visualized document. The preset information storage format corresponding relationship comprises a corresponding relationship between a document format and a data view format, the data view format is a binary information storage format, and the binary digits of the stored information are different according to different files, for example, the data view of the pdf document is Uint8Array. Therefore, the data view of the visualized document is determined according to the corresponding relation between the document format and the preset information storage format.
S103, converting the binary data into a document object model of a canvas, and configuring the document object model under a drawing parameter in a display configuration file of a document analysis plug-in;
specifically, the Document parsing file (e.g., pdf. Worker. Js) receives the binary data, and then converts the binary data into canvas, that is, converts the binary data into a Document Object Model (DOM) of the canvas, and then places the Document Object Model under the rendering parameters in the display configuration file of the Document parsing plug-in. For example, when the binary data is stored, setting a configuration item, printContainer (drawing parameter), to the imported viewer. // canvas's dom element.
The document object model for converting binary data into canvas is as follows: drawing each object data in the binary data on an HTMLCanvasElement canvas of the current browser by using a CanvasSenderingContext 2D.putImageData interface of the current browser, calling the HTMLCanvasElemen.toDataURL interface of the current browser to obtain a uniform resource locator URL of each object data, converting the URL into a node type of a DOM node described by HTML, and converting information in each object data into description contents in a CSS format.
In this embodiment, the visual documents to be displayed are restored to their corresponding original binary files, and converted to binary views in the memory of the browser, and then converted to a canvas standard supporting W3C by almost all browser manufacturers, and the binary views in the memory are restored to a DOM structure of the canvas through the canvas tags of the web pages, thereby solving the problem of incompatibility of various files.
Referring to fig. 6, fig. 6 is a schematic flow diagram illustrating a process of configuring a document parsing file of a document parsing plugin after converting the binary data into a document object model of a canvas and configuring the document object model under a drawing parameter in a display configuration file of the document parsing plugin in the visual document presentation method according to the embodiment of the present invention, including steps S601 to S602.
S601, configuring preset data under a preset address;
s602, assigning the uniform resource locator of the preset data to a trusted certificate of the document analysis file of the document analysis plug-in.
Specifically, a document parsing file (pdf.worker.js) source code of the document parsing plug-in has a trustedCerts variable, which may be a file or a picture. Word js uses this variable to perform various processing on the binary, and if the trusted certificate is not read, an error is reported. After the configuration of the drawing parameters in the display configuration file of the document analysis plug-in and the address parameters of the file to be previewed is completed, it may be found that the trusted certificate of pdf. Therefore, preset data (without limitation, pictures, files and the like) are placed under the preset address, and the uniform resource locator of the preset data is assigned to the trusted certificate of the document analysis file of the document analysis plug-in, wherein the preset address can be set as required.
S104, rendering the document object model to the canvas based on the drawing parameters, and displaying the document object model on the bearing page;
specifically, the document object model is rendered to a canvas based on the rendering parameters and displayed on a bearing page through a document parsing plug-in. And then, designing UI.js and css to control canvas by the service requirement or better experience, and processing the displayed document to provide good user experience for the client.
In addition, after the visual document is displayed on the bearing page, the DOM can be operated through the api, such as page turning, rotation, zooming and the like, and therefore the customer satisfaction is improved. Under the premise that the address parameter of the file to be previewed in the display configuration file is configured to be a preset variable parameter, and the preset variable parameter refers to an address of a data view storing binary data, when an adjusting instruction of the visual document displayed on the bearing page is obtained, wherein the adjusting instruction comprises but is not limited to instructions of zooming in, zooming out, sliding and the like, the binary data is positioned according to the address parameter of the file to be previewed, the document object model is adjusted according to the adjusting instruction, and then the visual document displayed on the bearing page is adjusted.
Referring to fig. 7, fig. 7 is a schematic flowchart illustrating the determination and rendering of a canvas container in a visualization document presentation method according to an embodiment of the present invention, and includes steps S701 to S705.
S701, acquiring the document page number of the visual document;
s702, creating canvas containers with the same number according to the document page number;
s703 rendering the document object model to the canvas container based on the drawing parameters;
s704, obtaining the page number of the page to be displayed of the visual document;
s705, displaying the page to be displayed on the bearing page according to the canvas container after rendering and the page number.
Specifically, after jumping to a carrier page provided with a canvas tag, the document page number of the visual document is determined, so that canvas containers with the same number as the document page number are created for displaying the visual document, and each page of document corresponds to the created canvas container one to one. Rendering the document object model of each page to a corresponding canvas container based on the drawing parameters, when the visual document has more pages, acquiring the pages of the page to be displayed of the visual document, determining the canvas container corresponding to the pages, and then displaying the page corresponding to the visual document on the bearing page.
In addition, the number of pages of the visual document is too many, the canvas containers with the same number are created, the data volume needing to be processed at the same time is rendered at the same time, the requirement on equipment is high, but the current browser does not need to display all the data at the same time, and therefore resources are not reasonably and efficiently utilized. Therefore, the preset number of the created canvas containers is set according to the display parameters of the current browser and the display requirements of the user, and only the page to be displayed and the pages in the preset range in front of and behind the page to be displayed are rendered into the canvas containers with the preset number, so that the data volume needing to be rendered at the same time is reduced.
The invention solves the compatibility problem of the visual document based on canvas, and when the network requests the visual document, the returned binary data is converted into the binary view in the memory of the browser. The in-memory binary views are then restored to the DOM structure of the canvas by the canvas tag of the web page, with the canvas standard of W3C supported by almost all browser vendors, and a faithful visual document is displayed to the client on the web page. Through the underlying restoration operation, the visual document does not cause compatibility problems due to differences of browsers. After obtaining the DOM for the canvas, the developer can use various powerful apis of the canvas to manipulate the DOM, such as page turn, rotate, zoom, etc., which also increases customer satisfaction.
According to the method described in the foregoing embodiment, the embodiment will be further described from the perspective of a visual document display device, which may be specifically implemented as an independent entity, or may be implemented by being integrated in an electronic device, such as a terminal, where the terminal may include a mobile phone, a tablet computer, and the like.
In addition, this application still provides a visual document display device, includes:
the page jump module is used for jumping to a bearing page provided with a canvas label when the visual document to be displayed is obtained;
the data acquisition module is in communication connection with the page skip module and is used for acquiring binary data of the visual document;
the parameter analysis module is in communication connection with the data acquisition module and is used for converting the binary data into a document object model of the canvas and configuring the document object model under the drawing parameters in the display configuration file of the document analysis plug-in;
and the document display module is in communication connection with the page jump module and the parameter analysis module, and is used for rendering the document object model to the canvas based on the drawing parameters and displaying the document object model on the bearing page.
In specific implementation, each module and/or unit may be implemented as an independent entity, or may be implemented as one or multiple entities by any combination, where the specific implementation of each module and/or unit may refer to the foregoing method embodiment, and specific achievable beneficial effects also refer to the beneficial effects in the foregoing method embodiment, which are not described herein again.
In addition, referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a mobile terminal such as a smart phone and a tablet computer. As shown in fig. 8, the electronic device 800 includes a processor 801, a memory 802. The processor 801 is electrically connected to the memory 802.
The processor 801 is a control center of the electronic device 800, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 800 and processes data by running or loading an application program stored in the memory 802, and calling data stored in the memory 802, thereby monitoring the electronic device 800 as a whole.
In this embodiment, the processor 801 in the electronic device 800 loads instructions corresponding to processes of one or more application programs into the memory 802, and the processor 801 executes the application programs stored in the memory 802 according to the following steps, so as to implement various functions:
when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
acquiring binary data of the visual document;
converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in;
rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page.
The electronic device 800 may implement the steps in any embodiment of the visual document presentation provided by the embodiment of the present invention, and therefore, the beneficial effects that can be achieved by any visual document presentation provided by the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiment and will not be described herein again.
Referring to fig. 9, fig. 9 is a specific block diagram of an electronic device provided in an embodiment of the present application, where the electronic device may be used to implement the visual document presentation method provided in the foregoing embodiment. The electronic device 900 may be a mobile terminal such as a smart phone or a notebook computer.
The RF circuit 910 is used for receiving and transmitting electromagnetic waves, and interconverting the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. RF circuit 910 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 910 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network described above may use various Communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), enhanced Mobile Communication (Enhanced Data GSM Environment, EDGE), wideband Code Division Multiple Access (WCDMA), code Division Multiple Access (CDMA), time Division Multiple Access (TDMA), wireless Fidelity (Wi-Fi) (e.g., IEEE802.11a, IEEE802.11 b, IEEE802.1 g and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), world wide Internet Access (micro for Access, max), other suitable protocols for instant messaging, and other suitable protocols, including those currently developed for instant messaging, and even any other protocols that are not yet available.
The memory 920 may be configured to store software programs and modules, such as program instructions/modules corresponding to the visual document presentation method in the foregoing embodiment, and the processor 980 executes the visual document presentation process by executing the software programs and modules stored in the memory 920, as follows:
when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
acquiring binary data of the visual document;
converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in;
rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page.
The memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 920 can further include memory located remotely from the processor 980, which can be connected to the electronic device 900 over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 930 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 930 may include a touch-sensitive surface 931 as well as other input devices 932. Touch-sensitive surface 931, also referred to as a touch screen or touch pad, may collect user touch operations (e.g., user operations on or near touch-sensitive surface 931 using a finger, stylus, or any other suitable object or attachment) and drive the corresponding connecting device according to a predetermined program. Alternatively, the touch sensitive surface 931 may include both a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch sensitive surface 931 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 930 may also include other input devices 932 in addition to the touch-sensitive surface 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 940 may be used to display information input by or provided to the user and various graphical user interfaces of the electronic device 900, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 940 may include a Display panel 941, and optionally, the Display panel 941 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 931 may overlay the display panel 941, and when a touch operation is detected on or near the touch-sensitive surface 931, the touch operation is transmitted to the processor 980 to determine the type of touch event, and the processor 980 then provides a corresponding visual output on the display panel 941 according to the type of touch event. Although the touch-sensitive surface 931 and the display panel 941 are shown as two separate components to implement input and output functions, in some embodiments, the touch-sensitive surface 931 and the display panel 941 may be integrated to implement input and output functions.
The electronic device 900 may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor that may generate an interrupt when the folder is closed or closed. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of identifying the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration identification related functions (such as pedometer and tapping), and the like; other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that may also be configured with the electronic device 900 are not described herein.
The audio circuitry 960, speaker 961, microphone 962 may provide an audio interface between a user and the electronic device 900. The audio circuit 960 may transmit the electrical signal converted from the received audio data to the speaker 961, and convert the electrical signal into a sound signal for output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 960 and converted into audio data, which is then processed by the audio data output processor 980, and then passed through the RF circuit 910 to be transmitted to, for example, another terminal, or the audio data is output to the memory 920 for further processing. The audio circuit 960 may also include an earbud jack to provide communication of a peripheral headset with the electronic device 900.
The electronic device 900, via the transport module 970 (e.g., wi-Fi module), may assist the user in receiving requests, sending messages, etc., which provides the user with wireless broadband internet access. Although the transmission module 970 is illustrated in the drawings, it is understood that it does not necessarily belong to the essential constitution of the electronic device 900 and may be omitted entirely as needed within a range not changing the essence of the invention.
The processor 980 is a control center of the electronic device 900, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device 900 and processes data by operating or executing software programs and/or modules stored in the memory 920 and calling data stored in the memory 920, thereby integrally monitoring the electronic device. Optionally, processor 980 may include one or more processing cores; in some embodiments, the processor 980 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 980.
The electronic device 900 also includes a power supply 990 (e.g., a battery) that provides power to the various components and, in some embodiments, may be logically coupled to the processor 980 via a power management system that provides management of charging, discharging, and power consumption. Power supply 990 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 900 further includes a camera (e.g., a front camera, a rear camera), a bluetooth module, etc., which are not described in detail herein. Specifically, in this embodiment, the display unit of the electronic device is a touch screen display, the mobile terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
acquiring binary data of the visual document;
converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in;
rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium, where multiple instructions are stored, and the instructions can be loaded by a processor to execute steps of any embodiment of the visual document presentation method provided in the embodiment of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any embodiment of the visual document presentation method provided in the embodiment of the present application, beneficial effects that can be achieved by any visual document presentation method provided in the embodiment of the present application may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The above detailed description is given to a visual document display, a visual document display apparatus, an electronic device, and a storage medium provided in the embodiments of the present application, and specific examples are applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application. Moreover, it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present application and these modifications and adaptations are intended to be within the scope of the present application.

Claims (10)

1. A visual document display method is characterized by comprising the following steps:
when a visual document to be displayed is obtained, jumping to a bearing page provided with a canvas label;
acquiring binary data of the visual document;
converting the binary data into a document object model of the canvas, and configuring the document object model under the drawing parameters in a display configuration file of a document analysis plug-in;
rendering the document object model to the canvas based on the drawing parameters, and displaying on the bearing page.
2. A visualized document presentation method according to claim 1, wherein said obtaining binary data of said visualized document comprises:
opening up a continuous storage space, and establishing a data view of the visual document in the continuous storage space, wherein the size of the continuous storage space is the same as the data size of the binary data;
storing the binary data in a continuous storage space provided with the data view, and referring to an address of the data view through a preset variable parameter;
configuring the address parameter of the file to be previewed in the display configuration file as the preset variable parameter;
the rendering the document object model to the canvas based on the drawing parameters and after the displaying of the bearing page further comprises:
acquiring an adjusting instruction of the visual document displayed by the bearing page;
and positioning the binary data according to the address parameter of the file to be previewed, and adjusting the document object model according to the adjusting instruction.
3. A visualized document presentation method according to claim 2, wherein said creating a continuous storage space and before said continuous storage space establishes a data view of said visualized document, further comprises:
acquiring a document format of the visual document;
and determining the data view of the visual document according to the corresponding relation between the document format and a preset information storage format.
4. A visualized document presentation method according to claim 1 or 2, wherein said converting said binary data into a document object model of a canvas and configuring said document object model under rendering parameters in a display configuration file of a document parsing plug-in, further comprises:
configuring preset data under a preset address;
and assigning the uniform resource locator of the preset data to a trusted certificate of a document analysis file of the document analysis plug-in.
5. A visualized document showing method according to claim 1, wherein when the visualized document to be displayed is obtained, jumping to a bearing page provided with a canvas tag comprises:
when a visual document to be displayed is obtained, obtaining a target document format which is directly displayed by the current browser;
and if the target document format does not comprise the document format of the visual document, jumping to a bearing page provided with a canvas label.
6. A visualized document showing method according to claim 1, wherein when the visualized document to be displayed is obtained, after jumping to a carrier page provided with a canvas label, the method further comprises:
acquiring the document page number of the visual document;
creating canvas containers with the same number according to the document pages;
the rendering the document object model to the canvas based on the drawing parameters and displaying on the bearing page comprises:
rendering the document object model to the canvas container based on the drawing parameters;
acquiring the page number of a page to be displayed of the visual document;
and displaying the page to be displayed on the bearing page according to the canvas container and the page number after rendering.
7. A visualized document presentation method according to claim 1, wherein said obtaining binary data of said visualized document comprises:
acquiring a description text of the visual document;
extracting a plurality of object data of the visualized document and position information of each object data according to the description text;
and obtaining binary data of the visual document according to the object data and the position information.
8. A visual document presentation device, comprising:
the page jump module is used for jumping to a bearing page provided with a canvas label when the visual document to be displayed is obtained;
the data acquisition module is in communication connection with the page skip module and is used for acquiring binary data of the visual document;
the parameter analysis module is in communication connection with the data acquisition module and is used for converting the binary data into a document object model of canvas and configuring the document object model under drawing parameters in a display configuration file of a document analysis plug-in;
and the document display module is in communication connection with the page jump module and the parameter analysis module, and is used for rendering the document object model to the canvas based on the drawing parameters and displaying the document object model on the bearing page.
9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the memory being coupled to the processor, and the processor, when executing the computer program, implementing the steps in a visualization document presentation as recited in any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the steps in the visual document presentation according to any one of claims 1 to 7.
CN202211373469.0A 2022-11-03 2022-11-03 Visual document display method and device, electronic equipment and medium Pending CN115630608A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211373469.0A CN115630608A (en) 2022-11-03 2022-11-03 Visual document display method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211373469.0A CN115630608A (en) 2022-11-03 2022-11-03 Visual document display method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN115630608A true CN115630608A (en) 2023-01-20

Family

ID=84909392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211373469.0A Pending CN115630608A (en) 2022-11-03 2022-11-03 Visual document display method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115630608A (en)

Similar Documents

Publication Publication Date Title
US20190342334A1 (en) Method, client, and server for preventing web page hijacking
EP3751425A1 (en) Method and apparatus for viewing historically used file, and terminal
CN110795666B (en) Webpage generation method, device, terminal and storage medium
WO2017084452A1 (en) Method and apparatus for processing tag page in graphical interface
CN107247691B (en) Text information display method and device, mobile terminal and storage medium
CN110413501B (en) Browser compatibility testing method, device and system and readable storage medium
US10643021B2 (en) Method and device for processing web page content
EP3416054B1 (en) Method and device for page display, and storage medium
US20110287750A1 (en) Link server and program thereof, website browsing system, website browsing method, and website browsing program
WO2018196588A1 (en) Information sharing method, apparatus and system
US20110078593A1 (en) Web browser transmission server and method of controlling operation of same
CN108197264B (en) Webpage acceleration display method and device, mobile terminal and storage medium
CN110020293B (en) Multimedia data display method, device and storage medium
WO2014206055A1 (en) A method and system for generating a user interface
US20150128033A1 (en) Method and apparatus for webpage browsing
CN108763297B (en) Webpage resource processing method and device and mobile terminal
JP2022518724A (en) Document input processing methods, devices, electronic devices and storage media
CN106156097B (en) Method and device for processing browser input records
US9977661B2 (en) Method and system for generating a user interface
US20240089223A1 (en) Information display method and apparatus, and electronic device
CN110069186B (en) Method and equipment for displaying operation interface of application
CN112256370A (en) Information display method and device and electronic equipment
CN107295035B (en) Method and device for sharing content of mobile terminal
CN114626332A (en) Content display method and device and electronic equipment
CN115630608A (en) Visual document display method and device, electronic equipment and 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