CN115328588A - Method and system for rendering OFD (office file) based on browser front end - Google Patents

Method and system for rendering OFD (office file) based on browser front end Download PDF

Info

Publication number
CN115328588A
CN115328588A CN202210393537.3A CN202210393537A CN115328588A CN 115328588 A CN115328588 A CN 115328588A CN 202210393537 A CN202210393537 A CN 202210393537A CN 115328588 A CN115328588 A CN 115328588A
Authority
CN
China
Prior art keywords
browser
svg
rendering
page
ofd
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
CN202210393537.3A
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.)
Baiwang Co ltd
Original Assignee
Baiwang 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 Baiwang Co ltd filed Critical Baiwang Co ltd
Priority to CN202210393537.3A priority Critical patent/CN115328588A/en
Publication of CN115328588A publication Critical patent/CN115328588A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention belongs to the technical field of OFD document reading, and particularly provides a method and a system for rendering an OFD document based on a browser front end, wherein the method comprises the steps of downloading a server file or opening a local file through the browser front end, and loading the OFD document into a memory; analyzing the OFD document at the front end of the browser and extracting non-visual data; analyzing the appointed page and the required resources according to the appointed page which is required to be displayed at the front end of the browser; rendering the appointed page into an SVG at the front end of the browser, and storing the SVG file stream in a memory; extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the page is zoomed in and zoomed out by the front end of the browser. The scheme does not occupy the computing resource and the transmission bandwidth resource of the server, and has no security risk; and the display can be ensured to be clear after zooming, and fuzzy distortion can not be caused.

Description

Method and system for rendering OFD document based on browser front end
Technical Field
The invention relates to the technical field of OFD document reading, in particular to a method and a system for rendering an OFD document based on a front end of a browser.
Background
Compared with paper files, electronic files are more convenient to share, and reading is a mode of electronic file sharing, so that demands are made in numerous fields, for example, electronic files and national standards opened to the public on the internet, electronic invoices pushed to consumers, electronic certificates issued to the citizens on government affairs outer networks, rules and regulations published to employees in inner networks, technical OFD documents pushed to the employees and the like, as a receiving party, the demands of reading are made, and when the OFD documents are in an OFD format, the existing solutions are two: the first scheme is that the user downloads and installs OFD reading software or OFD reading plug-in, then downloads OFD documents to be read to the local or memory, and finishes reading at the client. The second solution is to use a reading service to render the OFD document into a picture on the server side, then place the picture in an html page, and display the picture in the browser of the client side after reading.
For the first scheme, each client needs to download and install OFD reading software or plug-in, and needs to download OFD files, and the downloading of the software and the files not only occupies disk space, mobile phone capacity or memory, but also the software may be implanted with trojans or viruses, which brings safety problems to the terminal.
Even if the space is large enough and no potential safety hazard exists, if each OFD document needs to be installed with specific reading software, each application needs to be installed with a specific application program, the burden is brought to a computer and a mobile phone, and the user, particularly the user of the mobile phone, is worried. When the software is upgraded, the client also needs to be updated in time, and communication cost is increased between the software provider and the reader whether the software is updated or not.
For the second scheme, the picture volume is usually about 100-200KB, the client download amount is not negligible during reading, and when the concurrency is large, the requirements on the server computing resources and bandwidth are high, and if the server computing resources are insufficient or the bandwidth is insufficient, the phenomenon that the requested stack cannot be processed in time and finally the service is stopped is caused. The image can generate a fuzzy distortion phenomenon when the client amplifies the page, and the method for avoiding the fuzzy distortion is to download the image with the size suitable for the current size again, so that the server is further stressed on calculation and bandwidth.
Disclosure of Invention
The invention aims at the technical problems of unclear OFD electronic OFD document and difficult reading in the prior art.
The invention provides a method for rendering an OFD document based on a front end of a browser, which comprises the following steps:
s1, loading an OFD document into a memory in a mode of downloading a server file or opening a local file by a front end of a browser;
s2, analyzing the OFD document at the front end of the browser and extracting non-visual data;
s3, analyzing the appointed page and the needed resources according to the appointed page needing to be displayed at the front end of the browser;
s4, rendering the appointed page into an SVG at the front end of the browser, and storing the SVG file stream in a memory;
s5, extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser;
s6, modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page;
and S7, when other pages are displayed, repeating the steps S3 to S5.
Preferably, the non-visual data includes metadata information of title, author, subject, creation date, modification date of the OFD document, and further includes information of data index, electronic signature, and page number of the OFD document.
Preferably, the content rendered in S4 includes text, and the text rendering specific process includes:
extracting the attributes of each character in the appointed page, wherein the attributes comprise a Unicode code, a position, a font name, a font size, a filling color, a stroke color, transparency, whether stroke is performed and whether filling is performed;
converting the color and the transparency into numerical values in an SVG format;
converting the position and font size to the value of the SVG, converting the unit from millimeter to pound, and then adding characters in the SVG description stream according to the converted position and font size.
Preferably, the content rendered in S4 includes graphics, and the specific process of graphics rendering includes:
extracting the position, width and height, whether to fill, whether to trace, a filling rule, drawing parameters, coordinates of all points in the graph and operators, wherein the drawing parameters comprise line width, end point style, connection style, transparency, filling color and tracing color, and the operators comprise a starting point (S), a movement (M), a straight line (L), a quadratic Bezier curve (Q), a cubic Bezier curve (B), an arc (A) and a closure (C);
converting the drawing parameters into SVG values and names, adding the SVG values and names into SVG description streams, and performing numerical value conversion on positions, sizes and coordinates of all points;
constructing a path of the SVG, and adding all points of the graph into the path according to an operator;
and adding the path into the description stream of the SVG according to the converted position and size.
Preferably, the numerical conversion specifically includes:
the method comprises the following steps of color conversion, wherein the values (x, y, z) of three channels with RGB color spaces in an OFD document are converted and then can be written as RGB (x, y, z) or converted into hexadecimal;
transparency conversion, wherein the transparency value in the OFD document is alpha, and the conversion result = alpha/255;
converting the position coordinates, width and height and the numerical value of the font size, wherein the original numerical value is length, and the conversion result = length/25.4 × 72;
converting end point styles, wherein end point sample types in the OFD document are Butt, round and Square, the initials need to be lowercase when the end point sample types are converted into the SVG names, and the end point sample types are Butt, round and Square after conversion;
and (4) connection style conversion, wherein the intermediate sample application type value of the OFD document is Miter, round and Bevel, the initial letters need to be lowercase when the intermediate sample application type value is converted into the SVG name, and the converted initial letters are Miter, round and Bevel respectively.
Preferably, the content rendered in S4 includes an image, and the image rendering specific process includes:
extracting the position, the size, the transformation matrix and the binary byte stream of the image resource of the image object;
and coding the binary byte stream of the image resource into a picture object which can be directly utilized by the SVG, converting the position and the size of the picture object according to a transformation matrix of the picture object in a page, and adding the picture into the SVG description stream.
The invention also provides a system for rendering the OFD document based on the front end of the browser, which is used for realizing the steps of the method for rendering the OFD document based on the front end of the browser, and specifically comprises the following steps:
the OFD document extraction module is used for loading the OFD document into the memory in a mode of downloading a server file or opening a local file through the front end of the browser; analyzing the OFD document at the front end of the browser and extracting non-visual data;
the OFD document analysis module is used for analyzing the specified page and the required resources according to the specified page needing to be displayed at the front end of the browser; rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory;
the display module is used for extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into a webpage and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page.
The invention also provides electronic equipment which comprises a memory and a processor, wherein the processor is used for realizing the steps of the method for rendering the OFD document based on the front end of the browser when executing the computer management program stored in the memory.
The present invention also provides a computer readable storage medium having stored thereon a computer management-like program, which when executed by a processor, implements the steps of a method for rendering an OFD document based on a browser front-end.
Has the advantages that: the invention provides a method and a system for rendering an OFD document based on a browser front end, wherein the method comprises the steps of loading the OFD document into a memory in a mode of downloading a server file or opening a local file through the browser front end; analyzing the OFD document at the front end of the browser and extracting non-visual data; analyzing a specified page and required resources according to the specified page needing to be displayed at the front end of the browser; rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory; extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the page is zoomed in and zoomed out by the front end of the browser. According to the scheme, the analysis and rendering of the OFD electronic OFD document are realized at the front end of the browser, but the client does not need to download and install OFD reading software or plug-in, so that the disk space can be saved, the computing resource and the transmission bandwidth resource of a server are not occupied, and the safety risk is avoided. The rendering result is carried by using a vector diagram (SVG format), so that the method has no dependence on an operating system and hardware of the client, different clients can also present a uniform effect, the re-rendering is not needed when the client is zoomed in and zoomed out, the display can be ensured to be clear after the client is zoomed in and the fuzzy distortion is avoided.
Drawings
FIG. 1 is a flowchart of a method for rendering an OFD document based on a browser front end according to the present invention;
fig. 2 is a schematic diagram of a hardware structure of a possible electronic device provided in the present invention;
FIG. 3 is a schematic diagram of a hardware structure of a possible computer-readable storage medium provided by the present invention;
FIG. 4 is a schematic diagram of endpoint style conversion provided by the present invention;
fig. 5 is a schematic diagram of the connection style conversion provided by the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention, but are not intended to limit the scope of the invention.
Fig. 1 is a method and a system for rendering an OFD document based on a browser front end according to the present invention, where the method includes loading the OFD document into a memory by downloading a server file or opening a local file through the browser front end; analyzing the OFD file at the front end of the browser and extracting non-visual data; analyzing the appointed page and the required resources according to the appointed page required to be displayed at the front end of the browser; rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory; extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the page is zoomed in and zoomed out by the front end of the browser. According to the scheme, the analysis and rendering of the OFD electronic OFD document are realized at the front end of the browser, but the client does not need to download and install OFD reading software or plug-in, so that the disk space can be saved, the computing resource and transmission bandwidth resource of a server are not occupied, and the safety risk is avoided. The rendering result is carried by using a vector diagram (SVG format), so that the operating system and hardware of the client are independent, different clients can also present a uniform effect, re-rendering is not needed during magnification and reduction, and the display can be ensured to be clear after the magnification and the distortion are avoided.
The method for rendering the OFD document based on the front end of the browser provided by the embodiment of the invention specifically comprises the following steps:
s1, loading the OFD document into a memory at the front end of the browser in a mode of downloading a server file or opening a local file.
S2, analyzing the OFD document at the front end of the browser and extracting non-visual data, wherein the non-visual data comprises metadata information such as title, author, theme, creation date and modification date of the OFD document, data index, electronic signature, page number of the OFD document and the like.
And S3, analyzing the specified page and the required resources according to the specified page displayed at the front end of the browser as required, and acquiring data such as page width, height, rotation, page content, labels, seals and the like.
And S4, rendering the appointed page into SVG at the front end of the browser and storing the SVG file stream in a memory.
During the rendering process, the contents to be rendered can be divided into three basic types of characters, graphics and images.
For characters, extracting attributes of each character in a specified page, wherein the attributes comprise a Unicode code, a position, a font name, a font size, a filling color, an edge drawing color, transparency, whether the edge is drawn and whether the edge is filled; converting the color and the transparency into numerical values in an SVG format; converting the position and font size to the value of the SVG, converting the unit from millimeter to pound, and then adding characters in the SVG description stream according to the converted position and font size.
For a graph, extracting the position, width and height, filling or not, drawing or not, filling rules, drawing parameters, coordinates of all points in the graph and operators, wherein the drawing parameters comprise line width, end point styles, connection styles, transparency, filling colors, drawing colors and the like, and the operators comprise a starting point (S), a movement (M), a straight line (L), a quadratic Bezier curve (Q), a cubic Bezier curve (B), an arc (A), a closure (C) and the like; converting the drawing parameters into SVG values and names, adding the SVG values and names into an SVG description stream, and performing value conversion on positions, sizes and coordinates of all points; constructing a Path (Path) of the SVG, adding all points of the graph into the Path according to an operator; adding the path into the description stream of the SVG according to the converted position and size;
for an image, extracting the position, size, transformation matrix and binary byte stream of image resources of an image object; the binary byte stream of the image resource is coded into a picture object which can be directly utilized by the SVG, and the image is added into the SVG description stream after the position and the size of the picture object are converted according to the transformation matrix of the picture object in the page.
The numerical conversion mode is as follows:
the color conversion method takes red with RGB as color space in OFD document as an example, the values of three channels of red, green and blue are 255,0 and 0 respectively, and the converted values can be written as RGB (255, 0 and 0) or converted into hexadecimal # FF0000.
And in the transparency conversion method, the transparency value in the OFD document is alpha, and the conversion formula is that the result = alpha/255.
And (3) a position coordinate, width and height numerical value conversion method, wherein the original numerical value is length, and the conversion formula is the result = length/25.4 × 72.
As shown in fig. 4, in the endpoint style transformation method, the endpoint sample type in the OFD document may be Butt, round and Square, and when transforming into the SVG name, the initials need to be lowercase, and after transformation, butt, round and Square are respectively used.
As shown in fig. 5, in the connection style conversion method, the intermediate sample application formula in the OFD document may be set to Miter, round and Bevel, and when the intermediate sample application formula is converted into the SVG name, the initials are required to be lowercase, and the initial samples are referred to as Miter, round and Bevel after the conversion.
And S5, extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser.
S6, modifying the transform attribute of the SVG tag in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page.
And S7, when other pages are displayed, repeating the step S3 to the step S5.
Has the advantages that:
the client does not need to download or install any OFD reading software and plug-in, so that the disk space can be saved, and no safety risk exists;
the analysis and rendering of the OFD document are realized at the front end of the browser, and the computing resources and the transmission bandwidth resources of the server are not occupied;
the rendering result of the OFD document is carried by the SVG description stream, so that the operation system and hardware of the client side are independent, different client sides can also present a uniform effect, re-rendering is not needed after zooming, and the rendering efficiency is greatly improved.
The embodiment of the present invention further provides a system for rendering an OFD document based on a front end of a browser, where the system is configured to implement the steps of the method for rendering an OFD document based on a front end of a browser, and the method specifically includes:
the OFD document extraction module is used for loading the OFD document into the memory in a mode of downloading a server file or opening a local file through the front end of the browser; analyzing the OFD document at the front end of the browser and extracting non-visual data;
the OFD document analysis module is used for analyzing the specified page and the required resources according to the specified page needing to be displayed at the front end of the browser; rendering the appointed page into an SVG at the front end of the browser, and storing the SVG file stream in a memory;
the display module is used for extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page.
Fig. 2 is a schematic diagram of an embodiment of an electronic device according to an embodiment of the invention. As shown in fig. 2, an embodiment of the present invention provides an electronic device, which includes a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320, where the processor 1320, when executing the computer program 1311, implements the following steps:
s1, loading an OFD document into a memory in a mode of downloading a server file or opening a local file by a front end of a browser;
s2, analyzing the OFD document at the front end of the browser and extracting non-visual data;
s3, analyzing the appointed page and the needed resources according to the appointed page needing to be displayed at the front end of the browser;
s4, rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory;
s5, extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser;
s6, modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page;
and S7, when other pages are displayed, repeating the step S3 to the step S5.
Please refer to fig. 3, which is a schematic diagram of an embodiment of a computer-readable storage medium according to the present invention. As shown in fig. 3, the present embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored, the computer program 1411 when executed by a processor implements the steps of:
s1, loading an OFD document into a memory in a mode of downloading a server file or opening a local file by a front end of a browser;
s2, analyzing the OFD document at the front end of the browser and extracting non-visual data;
s3, analyzing the appointed page and the needed resources according to the appointed page needing to be displayed at the front end of the browser;
s4, rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory;
s5, extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser;
s6, modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page;
and S7, when other pages are displayed, repeating the step S3 to the step S5.
It should be noted that, in the foregoing embodiments, descriptions of the respective embodiments are respectively emphasized, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (9)

1. A method for rendering an OFD document based on a front end of a browser is characterized by comprising the following steps:
s1, loading an OFD document into a memory in a mode of downloading a server file or opening a local file by a front end of a browser;
s2, analyzing the OFD document at the front end of the browser and extracting non-visual data;
s3, analyzing the appointed page and the required resources according to the appointed page which is required to be displayed at the front end of the browser;
s4, rendering the specified page into SVG at the front end of the browser, and storing the SVG file stream in a memory;
s5, extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage, and displaying the SVG description stream by using an engine of the browser;
s6, modifying the transform attribute of the SVG label in the SVG description stream for zooming when the front end of the browser zooms in and zooms out the page;
and S7, when other pages are displayed, repeating the step S3 to the step S5.
2. The browser front-end based OFD document rendering method of claim 1, wherein the non-visual data includes metadata information of title, author, subject, creation date, modification date of the OFD document, and further includes information of data index, electronic signature, and page number of the OFD document.
3. The method for rendering the OFD document based on the browser front end according to claim 1, wherein the content rendered in S4 includes text, and a specific process of text rendering includes:
extracting the attributes of each character in the appointed page, wherein the attributes comprise a Unicode code, a position, a font name, a font size, a filling color, an edge painting color, transparency, whether the edge painting is performed or not and whether the filling is performed or not;
converting the color and the transparency into numerical values in an SVG format;
converting the position and font size to the value of the SVG, converting the unit from millimeter to pound, and then adding characters in the SVG description stream according to the converted position and font size.
4. The method for rendering the OFD document based on the browser front end according to claim 1, wherein the content rendered in S4 includes graphics, and the specific process of graphics rendering includes:
extracting the positions, the width and the height of a graphic object, whether to fill, whether to trace, a filling rule, drawing parameters, coordinates of all points in a graphic and operators, wherein the drawing parameters comprise line width, end point patterns, connection patterns, transparency, filling colors and tracing colors, and the operators comprise a starting point (S), a movement (M), a straight line (L), a secondary Bezier curve (Q), a tertiary Bezier curve (B), an arc (A) and a closure (C);
converting the drawing parameters into SVG values and names, adding the SVG values and names into an SVG description stream, and performing value conversion on positions, sizes and coordinates of all points;
constructing a path of the SVG, and adding all points of the graph into the path according to an operator;
and adding the path into the description stream of the SVG according to the converted position and size.
5. The method for rendering the OFD document based on the browser front-end according to claim 4, wherein the numerical conversion specifically includes:
the method comprises the following steps of color conversion, wherein the values (x, y, z) of three channels with RGB color spaces in an OFD document are converted and then can be written as RGB (x, y, z) or converted into hexadecimal;
transparency conversion, wherein the transparency value in the OFD document is alpha, and the conversion result = alpha/255;
converting the position coordinates, width and height and the numerical value of the font size, wherein the original numerical value is length, and the conversion result = length/25.4 × 72;
end point style conversion, wherein the middle point sample type value of the OFD document is Butt, round and Square, initials need to be lowercase when the end point sample type value is converted into the SVG name, and the end point sample type value is Butt, round and Square after the conversion;
and (3) connection style conversion, wherein the middle-end sample application type value of the OFD document is Miter, round and below, the initial letter needs to be lowercase when the OFD document is converted into the SVG name, and the converted OFD document is Miter, round and below.
6. The method for rendering the OFD document based on the browser front-end according to claim 1, wherein the content rendered in S4 includes an image, and a specific process of image rendering includes:
extracting the position, the size, the transformation matrix and the binary byte stream of the image resource of the image object;
the binary byte stream of the image resource is coded into a picture object which can be directly utilized by the SVG, and the image is added into the SVG description stream after the position and the size of the picture object are converted according to the transformation matrix of the picture object in the page.
7. A system for rendering OFD documents based on browser front-end, the system being configured to implement the steps of the method for rendering OFD documents based on browser front-end according to any one of claims 1 to 6, and specifically comprising:
the OFD document extraction module is used for loading the OFD document into the memory in a mode of downloading a server file or opening a local file through the front end of the browser; analyzing the OFD document at the front end of the browser and extracting non-visual data;
the OFD document analysis module is used for analyzing the appointed page and the required resources according to the appointed page which is required to be displayed at the front end of the browser; rendering the appointed page into SVG at the front end of the browser, and storing the SVG file stream in a memory;
the display module is used for extracting the SVG description stream of the page from the memory at the front end of the browser, inserting the SVG description stream into the webpage and displaying the SVG description stream by using an engine of the browser; and modifying the transform attribute of the SVG label in the SVG description stream for zooming when the page is zoomed in and zoomed out by the front end of the browser.
8. An electronic device, comprising a memory, a processor configured to implement the steps of the method of rendering an OFD document based on a browser front-end of any of claims 1-6 when executing a computer management class program stored in the memory.
9. A computer-readable storage medium, characterized in that a computer management like program is stored thereon, which when executed by a processor implements the steps of the method of rendering an OFD document based on a browser front-end according to any one of claims 1 to 6.
CN202210393537.3A 2022-04-07 2022-04-07 Method and system for rendering OFD (office file) based on browser front end Pending CN115328588A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210393537.3A CN115328588A (en) 2022-04-07 2022-04-07 Method and system for rendering OFD (office file) based on browser front end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210393537.3A CN115328588A (en) 2022-04-07 2022-04-07 Method and system for rendering OFD (office file) based on browser front end

Publications (1)

Publication Number Publication Date
CN115328588A true CN115328588A (en) 2022-11-11

Family

ID=83916353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210393537.3A Pending CN115328588A (en) 2022-04-07 2022-04-07 Method and system for rendering OFD (office file) based on browser front end

Country Status (1)

Country Link
CN (1) CN115328588A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116579296A (en) * 2023-07-04 2023-08-11 北京佳萌锐普科技发展有限公司 B/S architecture electronic document preview processing method, device, medium and equipment
CN116822472A (en) * 2023-08-31 2023-09-29 青岛诺亚信息技术有限公司 Method and system for rapidly pulling multi-source data to fill complex interface form
CN117521605A (en) * 2024-01-04 2024-02-06 北京点聚信息技术有限公司 Electronic signature method and system for OFD format file
CN117892698A (en) * 2024-03-14 2024-04-16 成都数之联科技股份有限公司 Text gradual change rendering method, equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116579296A (en) * 2023-07-04 2023-08-11 北京佳萌锐普科技发展有限公司 B/S architecture electronic document preview processing method, device, medium and equipment
CN116822472A (en) * 2023-08-31 2023-09-29 青岛诺亚信息技术有限公司 Method and system for rapidly pulling multi-source data to fill complex interface form
CN116822472B (en) * 2023-08-31 2023-11-17 青岛诺亚信息技术有限公司 Method and system for rapidly pulling multi-source data to fill complex interface form
CN117521605A (en) * 2024-01-04 2024-02-06 北京点聚信息技术有限公司 Electronic signature method and system for OFD format file
CN117521605B (en) * 2024-01-04 2024-03-15 北京点聚信息技术有限公司 Electronic signature method and system for OFD format file
CN117892698A (en) * 2024-03-14 2024-04-16 成都数之联科技股份有限公司 Text gradual change rendering method, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN115328588A (en) Method and system for rendering OFD (office file) based on browser front end
CN103246830B (en) The cipher processing method of client script and device and decipher processing method and device
US20090225086A1 (en) Information output apparatus and information output method and recording medium
CN110990345A (en) Method and device for online preview of Excel file
CN113935294A (en) Format document annotation method and device
CN106776994B (en) Application method and system of engineering symbols in engineering report forms and web pages
CN111476006B (en) PDF file online annotation method, device, equipment and readable storage medium
CN108389244B (en) Implementation method for rendering flash rich text according to specified character rules
CN112487763A (en) SVG-based OFD file online display method, server side and system
CN111222611B (en) Color-based stacked three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium
CN111859210B (en) Image processing method, device, equipment and storage medium
CN115268904A (en) User interface design file generation method, device, equipment and medium
US8930808B2 (en) Processing rich text data for storing as legacy data records in a data storage system
CA2602749C (en) System and method of report representation
CN102467490B (en) Font data processing method and device
CN112035774A (en) Network page generation method and device, computer equipment and readable storage medium
CN116663496A (en) SVG technology-based browser small font display component, display method and creation method
CN108932330B (en) Data display method and device
US9412187B2 (en) Delayed rendering of content
CN115904167A (en) Processing method and device of webpage icon, storage medium and electronic equipment
CN115048665A (en) Excel file-based information hiding method, device, equipment and storage medium
CN113360930A (en) Encryption method for realizing front-end and back-end character dissimilarity and processing terminal
CN113377453A (en) Picture processing method and device and electronic equipment
CN110362790B (en) Font file processing method and device, electronic equipment and readable storage medium
US20100017708A1 (en) Information output apparatus, information output method, and recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication