CN116579296A - B/S architecture electronic document preview processing method, device, medium and equipment - Google Patents

B/S architecture electronic document preview processing method, device, medium and equipment Download PDF

Info

Publication number
CN116579296A
CN116579296A CN202310806311.6A CN202310806311A CN116579296A CN 116579296 A CN116579296 A CN 116579296A CN 202310806311 A CN202310806311 A CN 202310806311A CN 116579296 A CN116579296 A CN 116579296A
Authority
CN
China
Prior art keywords
electronic document
preview
svg
document
data
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
CN202310806311.6A
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.)
Jiameng Ruipu Science & Technology Development Co ltd Beijing
Original Assignee
Jiameng Ruipu Science & Technology Development Co ltd Beijing
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 Jiameng Ruipu Science & Technology Development Co ltd Beijing filed Critical Jiameng Ruipu Science & Technology Development Co ltd Beijing
Priority to CN202310806311.6A priority Critical patent/CN116579296A/en
Publication of CN116579296A publication Critical patent/CN116579296A/en
Pending legal-status Critical Current

Links

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
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application belongs to the technical field of data processing, and particularly discloses a B/S architecture electronic document preview processing method, which comprises the following steps: acquiring an electronic document input by a user; preprocessing according to the acquired electronic document and a set format, and storing the preprocessed electronic document; acquiring a preview page selected by a user; acquiring a processed preview page according to the preview page selected by the user, converting the processed preview page to generate SVG data, and sending the SVG data to a webpage end; and analyzing and generating a document drawing path of the webpage end according to the acquired SVG data of the preview page, drawing a vector graphic document on a canvas, and displaying the vector graphic document on the webpage. According to the application, SVG is used as an intermediate interaction mode, so that high-precision preview of the electronic document at the webpage end is realized, preview data can be generated in real time, functions such as stamping and labeling can be further expanded, and the problems that in the prior art, the preview effect is inaccurate, the preview data occupies large storage space, and related functions are not easily expanded in a preview interface are solved.

Description

B/S architecture electronic document preview processing method, device, medium and equipment
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a B/S architecture electronic document preview processing method, device, medium and equipment.
Background
With the development of technology, both in the printing field and the office printing field, it is necessary to view and preview electronic documents, and whether there is an error in the electronic documents can be checked in advance, and in general, when an image is browsed at a web page end, a problem of blurring of the image content is caused in the zooming process.
In the prior art, in a BS software mode, electronic document data is stored at a server side, and a user views and previews the electronic document through a webpage side.
The most common method at present is to generate a preview image of each page of an electronic document, and a user needs to check which page, then obtain the preview image of the page, and transmit the preview image to a webpage end for display. The resolution of the preview image is usually low, otherwise, the time for generating the preview image is long, the preview image file itself is also large, and the storage space and the transmission bandwidth are occupied. The lower resolution results in a limited preview effect and may be obscured if the user needs to zoom in to view the detail.
Still another method is to directly transfer the electronic document data itself to the web page end, and preview is realized by means of the electronic document reader at the web page end. The method has the defects that firstly, complete electronic document data needs to be transmitted, one page cannot be transmitted, secondly, the existing electronic document reader at the webpage end is less, the interpretation capability is poor, and thirdly, other applications are difficult to continue to expand on the basis of the method.
The present application has been made in view of this.
Disclosure of Invention
The technical problem to be solved by the application is to overcome the defects of the prior art, and provide a B/S architecture electronic document preview processing method, which is characterized in that through acquiring an electronic document input by a user, preprocessing the electronic document, converting the electronic document into a privately owned document, after the user selects a preview page, processing the content in the preview page to obtain SVG format type data, transmitting the SVG format type data to a webpage end, acquiring SVG data of the preview page by the webpage end, analyzing the SVG data to obtain a drawing path of the preview page document at the webpage end, drawing a vector graphic document on a canvas, and displaying the vector graphic document on the webpage, the vector rendering of the electronic document at the webpage end is realized, so that the user can preview the document with high precision, and meanwhile, preview data of a certain page can be generated immediately, the speed is high, the storage space is not occupied, and functions such as seal and label can be further expanded on the basis of a preview interface, thereby solving the problems of inaccurate effect, large storage space occupied by the preview data, and the related functions of the preview interface are not easy to expand in the prior art.
In order to solve the technical problems, the application adopts the basic conception of the technical scheme that: the application provides a B/S architecture electronic document preview processing method, which comprises the following steps:
acquiring an electronic document input by a user;
preprocessing according to the acquired electronic document and a set format, and storing the preprocessed electronic document;
acquiring a preview page selected by a user;
acquiring a processed preview page according to the preview page selected by the user, converting the processed preview page to generate SVG data, and sending the SVG data to a webpage end;
and analyzing and generating a document drawing path of the webpage end according to the acquired SVG data of the preview page, drawing a vector graphic document on a canvas, and displaying the vector graphic document on the webpage.
Further, the preprocessing according to the set format includes:
and paging the electronic document, and converting the electronic document into a private format according to the set format to obtain the original structure of the electronic document.
Further, the SVG data is an XML-based graphic description data.
Further, the converting the processed preview page into SVG data includes:
acquiring characters, shapes and image structures in the preview page;
and generating corresponding text drawing paths, shape drawing paths and image data according to the acquired text, shape and image structure in the preview page.
Further, after the corresponding text drawing path, shape drawing path and image data are generated, the method further includes:
and generating each label and label attribute corresponding to the SVG format according to the set format, the generated text drawing path, the generated shape drawing path and the image data.
Further, the analyzing and generating the document drawing path of the web page end according to the obtained preview page SVG data includes:
acquiring each label and label attribute corresponding to the generated SVG format;
and according to the obtained label and label attribute corresponding to the SVG format, the webpage end analyzes the encountered path node data of the SVG format, and generates a text drawing path, a shape drawing path and image data of the preview page at the webpage end.
Further, the way that the web page end analyzes the path data node of the encountered SVG is as follows: DOM mode.
The application also provides a B/S architecture electronic document preview processing device, which comprises:
the first acquisition module is used for acquiring the electronic document uploaded by the user;
the processing module is used for processing the acquired electronic document according to a set format and storing the processed electronic document;
the second acquisition module is used for acquiring a preview page selected by a user;
the first conversion module is used for converting the content in the preview page after the user selects the preview page to obtain SVG format type data;
the second conversion module is used for analyzing the obtained SVG data to obtain a drawing path of the preview page document at the webpage end and an output vector graphic document;
and the display module is used for displaying the output vector graphic document on the webpage.
The present application also provides a readable storage medium having stored therein executable instructions that, when executed, cause a computing device to perform the above-described B/S architecture electronic document preview processing method.
The present application also provides a computer device comprising: the processor and the storage are connected with the processor, the storage stores executable instructions, and when the executable instructions are executed, the processor is caused to execute the B/S architecture electronic document preview processing method.
After the technical scheme is adopted, compared with the prior art, the application has the following beneficial effects:
(1) According to the application, after the electronic document input by a user is obtained, the electronic document is preprocessed, when the user needs to preview at the webpage end, the preview page document is converted into SVG data, then the SVG data is analyzed at the webpage end, the analyzed document is drawn at the webpage end and displayed, the SVG is used as an intermediate interaction mode to realize vector rendering of the preview page of the electronic document at the webpage end, so that the preview effect of vector characters and graphics is improved, the preview effect of the places can be arbitrarily scaled without blurring, high-precision preview is realized, meanwhile, preview data of a certain page is generated immediately, the speed is high, the storage space is not occupied, and the functions of stamping, labeling and the like can be further expanded on the basis of a preview interface.
(2) According to the application, through preprocessing the electronic document, the electronic documents with different formats are converted into the unified private format, and when SVG data is generated, only one format is required to be converted, so that the complexity of electronic document preview data processing is reduced, the processing flow is simplified, and the processing speed is improved.
The following describes the embodiments of the present application in further detail with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. It is evident that the drawings in the following description are only examples, from which other drawings can be obtained by a person skilled in the art without the inventive effort. In the drawings:
FIG. 1 is a flow chart of a B/S architecture electronic document preview processing method of the present application;
FIG. 2 is a block diagram of a B/S architecture electronic document preview processing apparatus of the present application;
FIG. 3 is a schematic diagram of a computer device of the present application.
It should be noted that these drawings and the written description are not intended to limit the scope of the inventive concept in any way, but to illustrate the inventive concept to those skilled in the art by referring to the specific embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present disclosure will be described below with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some of the block diagrams and/or flowchart illustrations are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations of blocks in the block diagrams and/or flowchart illustrations, 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, or other programmable data processing apparatus, such that the instructions, when executed by the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon, the computer program product being for use by or in connection with an instruction execution system.
As shown in FIG. 1, the method for previewing and processing the B/S architecture electronic document comprises the following steps:
step S1, acquiring an electronic document input by a user.
Step S1 in the present application obtains an electronic document input by a user, where the electronic document input by the user includes a document type such as PDF, OFD, postScript. The user imports the document into the client, the client receives the document, the client displays a prompt that the uploading of the electronic document is successful, and when the uploading fails, the client does not display the uploaded document and reminds the user.
In the application, the electronic document can be uploaded directly or added with accessories.
And S2, preprocessing according to the acquired electronic document and a set format, and storing the preprocessed electronic document.
In the step S2, after the electronic document input by the user is acquired, the electronic document is processed according to a set format, the electronic document is processed into a private format, meanwhile, the preprocessing processes of different types of electronic documents are different according to the different types of the electronic document, the set format comprises modes of watermark processing, identification processing and the like, the standardization of the electronic document is realized, and finally, the preprocessed electronic document is stored and waits for calling.
Meanwhile, the format of the electronic document processing set by the application can be changed according to the requirements of users.
The preprocessing of the electronic document is not simple, and meanwhile, the format of the electronic document after preprocessing is uniform, wherein the structure of the electronic document uploaded by a user, namely, different size information of each page composing the electronic document, and the like are unchanged after preprocessing, so that the accuracy of the electronic document is maintained.
And S3, acquiring a preview page selected by a user.
In step S3, after storing the electronic document after preprocessing, when the user selects a certain page of the document to preview, the user only needs to double-click the preview page of the electronic document after preprocessing, after acquiring the preview page selected by the user, an HTTP signal request will occur, and then the process of step S4 is started to be executed.
In this step S3, it is known that the user selects the preview page by pressing feedback or the like.
And S4, acquiring the processed preview page according to the preview page selected by the user, converting the processed preview page into SVG data, and sending the SVG data to the webpage end.
In the step S4, after the user selects the preview page and receives the HTTP request, the application acquires the pre-processed preview page, and performs data conversion on the page content information in the processed preview page, where the content information in the preview page is not limited to text, shape, table, etc., so as to obtain SVG data, and returns the SVG data as a response after receiving the HTTP request to the web page (client).
Specifically, when performing SVG data conversion on the page content information of the preview page, according to the difference of the page content information in the preview page, for example: and finally, returning all SVG data converted by the content information of the preview page document to a webpage end.
And S5, analyzing and generating a document drawing path of the webpage end according to the acquired SVG data of the preview page, drawing a vector graphic document on a canvas, and displaying the vector graphic document on the webpage.
In the step S5, after the webpage end obtains the SVG data of the preview page selected by the user, the current SVG data is parsed, an information drawing path in the preview page document of the webpage end is generated, and the vector graphic document is drawn on the canvas of the webpage end. In the step S5, SVG data is converted into document structure information of a preview page at a web page end for drawing, so that a vector of an electronic document is converted into a vector at the web page end, two graphic systems of the electronic document and the web page end are opened, and a vector preview effect of the electronic document at the web page end is realized.
Specifically, after the electronic document is input by a user, the electronic document is processed according to a set format, standardization of the private format of the electronic document is achieved, the private formats of the electronic documents in different formats are unified, then when a user selects one page in the electronic document to preview is obtained, the server side sends an HTTP request, the responding content is obtained, namely, document structure information in the processed preview page is subjected to data conversion, SVG data corresponding to the preview page is obtained, the SVG data is returned to a webpage side as the responding content, the webpage side analyzes the SVG data of the preview page, a drawing path of the preview page at the webpage side is generated, meanwhile, vector graphics of the drawn preview page are drawn on a canvas according to the current drawing path, finally, the vector graphics of the preview page are displayed on the webpage to provide previews for the user, the effect of vector rendering of the electronic document at the webpage side can be achieved in the zooming process, the vector text and graphics are improved, the previewing effect of the places is very good, and the text and graphics can be zoomed at will. Electronic signature operation can also be performed on the basis of the preview.
Further, the preprocessing according to the set format includes:
and paging the electronic document, and converting the electronic document into a private format according to the set format to obtain the original structure of the electronic document.
When the preprocessing is performed, the preprocessing format is obtained through user setting, and the set preprocessing format can be changed, for example, the electronic document is added with watermark, icon and other forms, so that standardized conversion of the private format of the electronic document is realized, the original structure of the electronic document is obtained, when the conversion of the document structure information in the preview page is performed, the conversion is performed on the basis of the document structure of the preprocessed preview page, namely, the original structure of the obtained electronic document, the set preprocessing format is uniform, the protection effect on the electronic document is improved, and when SVG data is generated, only one format is needed to be operated, so that the complexity of a system is reduced, and the conversion process is simplified.
The electronic document is made up of multiple pages, each page having its own size, as well as more complex multiple document situations. In the original structure of the electronic document after preprocessing, what we say is a document structure including how many pages the document is composed of, the size of each page, and so on. The document structure of the electronic file is preprocessed to keep the corresponding format unchanged, and the accuracy of the document is kept.
Further, the SVG data is an XML-based graphic description data.
After the user selects the preview page, the document structure information of the preview page is converted, rather than SVG rendering, into the XML-based graphic description data, wherein the image description data converted from different document structures are different, so that the analysis is convenient.
Further, the converting the processed preview page into SVG data includes:
acquiring characters, shapes and image structures in the preview page;
and generating corresponding text drawing paths, shape drawing paths and image data according to the acquired text, shape and image structure in the preview page.
Specifically, when converting document structure information in a preview page into SVG data, firstly, acquiring text, shape and image structure in the preview page, but not limited to the described text, shape and image structure types, and then obtaining corresponding drawing paths, namely a text drawing path, a shape drawing path and image data through an SVG generator.
Further, after the corresponding text drawing path, shape drawing path and image data are generated, the method further includes:
and generating each label and label attribute corresponding to the SVG format according to the set format, the generated text drawing path, the generated shape drawing path and the image data.
In the application, after the document structure information of the preview page is generated into different drawing paths, labels and label attributes are generated for the different drawing paths, so that analysis is convenient, for example: the SVG format is roughly as follows:
<svg>
the text and shape in the < path d= "/> -electronic document will be described using < path >;
an image and a complex graphic region in an < image href= "/> electronic document will be described using < image >;
</svg>
for example: electronic documents are exemplified by PostScript.
The PostScript parser encounters path-related instructions, such as newpath, moveto, lineto, curveto, closepath, etc., with the SVG having equivalent expression capabilities, gets < path d= "," via the SVG generator.
The PostScript parser encounters text rendering related instructions, such as setfont, show, etc., because SVG cannot be made to rely on external font resources, the SVG generator will extract the outline of the corresponding character and render using a path, resulting in < path d= ".
The PostScript parser encounters high-level instructions, such as embossed setovertrimts, and since SVG does not support these features, the SVG generator has two ways of processing, one directly ignores these instructions and the other interprets this area as an image to simulate the effect of the instruction, resulting in < image href= ". According to the process, the conversion from the electronic document to the SVG is realized, and finally the SVG data is returned to the webpage end as corresponding data.
Further, the analyzing and generating the document drawing path of the web page end according to the obtained preview page SVG data includes:
acquiring each label and label attribute corresponding to the generated SVG format;
and according to the obtained label and label attribute corresponding to the SVG format, the webpage end analyzes the encountered path node data of the SVG format, and generates a text drawing path, a shape drawing path and image data of the preview page at the webpage end.
In the application, each label and label attribute corresponding to the SVG format are obtained and generated at the webpage end, analysis is carried out at the webpage end, and in the analysis process, a text drawing path, a shape drawing path and image data of the document structure of the preview page at the webpage end are generated according to the path node data, so that vector rendering of the electronic document at the webpage end is realized by taking SVG as an intermediary.
In the prior art, the electronic document processed by SVG can be directly displayed at the webpage end, but other applications are difficult to continue to expand, so that the electronic document is firstly subjected to SVG conversion, then graphics are drawn out on a canvas of the webpage end < canvas >, and more complete preview functions such as zooming, moving a view such as a scroll bar, stamping, labeling and the like are realized through two-step conversion.
The web side needs to implement a parser for SVG and a < canvas > canvas renderer. This is very similar to the process of electronic document conversion to generate SVG, but is simpler because both graphics system capabilities are fully equivalent.
The SVG parser encounters path elements, < path d= ", invokes interfaces of beginPath (), moveTo (), lineTo (), beziercurreto (), closePath (), etc., via the canvas renderer.
The SVG parser encounters an image element, < image href= "," >, invokes a drawImage () interface via the canvas renderer. According to the process, vector rendering of SVG at the webpage end is realized.
Further, the way that the web page end analyzes the path data node of the encountered SVG is as follows: DOM mode.
Specifically, SVG content is received at the web page end. SVG is an XML-based graphic description that can be parsed in DOM fashion. The SVG data are packaged by using the labels, each label has own attribute, and the labels are analyzed in a DOM mode so as to be easy to obtain, namely, the drawing interface of the canvas is called according to the labels, so that the conversion process of the document is simplified. The application realizes the conversion from the graphic system of the electronic document to the canvas graphic system of the webpage end and the vector preview of the electronic document at the webpage end.
The application uses SVG as an intermediate data interaction format, but is not limited to using other modes as interaction intermediaries.
As shown in fig. 2, the present application further provides a B/S architecture electronic document preview processing apparatus, which includes a first acquisition module 1, a processing module 2, a second acquisition module 3, a first conversion module 4, a second conversion module 5, and a display module 6.
The first obtaining module 1 is configured to obtain an electronic document uploaded by a user.
The processing module 2 is configured to process the acquired electronic document according to a set format, and store the processed electronic document.
The second obtaining module 3 is configured to obtain a preview page selected by a user.
The first conversion module 4 is configured to convert, after a user selects a preview page, content in the preview page to obtain SVG format type data.
The second conversion module 5 is configured to parse the obtained SVG data to obtain a drawing path of the preview page document at the web page end and an output vector graphic document.
The display module 6 is used for displaying the output vector graphic document on a webpage.
According to the method, the electronic document uploaded by the user is acquired through the first acquisition module 1, then the electronic document uploaded by the user is preprocessed according to the preset format through the processing module 2, the original structure of the electronic document in the unified format is obtained, the processed electronic document is stored, the preview page selected by the user is determined through the second acquisition module 3, then the document structure information of the preview page selected by the user is subjected to SVG data conversion through the first conversion module 4, data in the SVG format type is obtained, namely, the drawing path format with the tag and the tag attribute is transmitted back to the webpage end, the obtained SVG data is analyzed through the second conversion module 5, the drawing path of the preview page document at the webpage end and the vector graphic document output are obtained, finally the output vector graphic document is displayed on the webpage through the display module 6, the rendering of the electronic document at the webpage end in the vector graphic mode is realized, and the user can preview with high precision.
The application also discloses a readable storage medium 102 and a computer device 100.
The storage medium 102 stores executable instructions that, when executed, cause the computing device 100 to perform the B/S architecture electronic document preview processing method described above.
The computer device 100 includes a processor 101 and a storage (not shown) connected to the processor, where the storage stores executable instructions that, when executed, cause the processor to execute the B/S architecture electronic document preview processing method described above.
The computer device 100 represents various forms of computers, such as minicomputers, desktop computers, workstations, servers, mainframe computers, or other suitable computers, and the like. The computer device 100 may also represent various forms of mobile devices, personal digital processing devices, smart mobile devices, and the like.
The processor 101 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the processor include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), an artificial intelligence computing chip, a computing unit that may also implement machine learning model algorithms, a digital signal processor, and a controller, microcontroller, and the like.
The presentation method according to the present application may be implemented as a computer software program embodied in a machine readable medium 102, such as a storage unit. In the present application, part or all of the computer program may be connected to the communication unit via the processor 101, and the presentation method may be loaded onto the computer apparatus 100, stored in the storage unit, and waiting for execution. When the computer device 100 needs to be executed, one or more steps of the above-described B/S architecture electronic document preview processing method may be performed by the processor 101.
Likewise, in the present application, the processor 101 may be configured as a process of a B/S architecture electronic document preview processing method in any other suitable manner (e.g., by means of firmware).
In the present application, the readable storage medium 102 may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device, and the readable storage medium 102 may be a readable signal medium or a readable storage medium. Such as a memory hard disk, random Access Memory (RAM), read Only Memory (ROM), optical fiber and optical storage devices, etc., or a combination of memories
The computer device 100 in the present application includes a client (not shown) and a server (not shown) for performing an interworking via a communication network, the server is not limited to a local or cloud server, and the like, and the computer device 100 has a recognition device (not shown), a display device (not shown), and an input device (not shown), and the input device may display an input page, and provide feedback to a user via the input device and the display device, so as to implement a preview of a document.
The foregoing description is only a preferred embodiment of the present application, and the present application is not limited to the above-mentioned embodiment, but is not limited to the above-mentioned embodiment, and any simple modification, equivalent change and modification made by the technical matter of the present application can be further combined or replaced by the equivalent embodiment without departing from the scope of the technical solution of the present application.

Claims (10)

1. A B/S architecture electronic document preview processing method is characterized by comprising the following steps:
acquiring an electronic document input by a user;
preprocessing according to the acquired electronic document and a set format, and storing the preprocessed electronic document;
acquiring a preview page selected by a user;
acquiring a processed preview page according to the preview page selected by the user, converting the processed preview page to generate SVG data, and sending the SVG data to a webpage end;
and analyzing and generating a document drawing path of the webpage end according to the acquired SVG data of the preview page, drawing a vector graphic document on a canvas, and displaying the vector graphic document on the webpage.
2. The B/S architecture electronic document preview processing method of claim 1, wherein the preprocessing according to a set format includes:
and paging the electronic document, and converting the electronic document into a private format according to the set format to obtain the original structure of the electronic document.
3. The method for previewing a B/S architecture electronic document according to claim 1, wherein said SVG data is an XML-based graphic description data.
4. The B/S architecture electronic document preview processing method of claim 3, wherein converting the processed preview page into SVG data includes:
acquiring characters, shapes and image structures in the preview page;
and generating corresponding text drawing paths, shape drawing paths and image data according to the acquired text, shape and image structure in the preview page.
5. The method for previewing a B/S architecture electronic document according to claim 4, wherein after generating the corresponding text drawing path, shape drawing path, and image data, further comprising:
and generating each label and label attribute corresponding to the SVG format according to the set format, the generated text drawing path, the generated shape drawing path and the image data.
6. The method for previewing a B/S architecture electronic document according to claim 5, wherein parsing the document rendering path of the web page according to the obtained preview page SVG data includes:
acquiring each label and label attribute corresponding to the generated SVG format;
and according to the obtained label and label attribute corresponding to the SVG format, the webpage end analyzes the encountered path node data of the SVG format, and generates a text drawing path, a shape drawing path and image data of the preview page at the webpage end.
7. The method for previewing B/S architecture electronic documents according to claim 6, wherein the web-side analyzes the path data node of the encountered SVG in the following manner: DOM mode.
8. A B/S architecture electronic document preview processing apparatus, comprising:
the first acquisition module is used for acquiring the electronic document uploaded by the user;
the processing module is used for processing the acquired electronic document according to a set format and storing the processed electronic document;
the second acquisition module is used for acquiring a preview page selected by a user;
the first conversion module is used for converting the content in the preview page after the user selects the preview page to obtain SVG format type data;
the second conversion module is used for analyzing the obtained SVG data to obtain a drawing path of the preview page document at the webpage end and an output vector graphic document;
and the display module is used for displaying the output vector graphic document on the webpage.
9. A readable storage medium having stored therein executable instructions that when executed cause a computing device to perform the B/S architecture electronic document preview processing method of any of claims 1-7.
10. A computer device, comprising: the electronic document preview processing system comprises a processor and a storage connected with the processor, wherein the storage stores executable instructions, and the executable instructions enable the processor to execute the B/S architecture electronic document preview processing method according to any one of claims 1-7 when executed.
CN202310806311.6A 2023-07-04 2023-07-04 B/S architecture electronic document preview processing method, device, medium and equipment Pending CN116579296A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310806311.6A CN116579296A (en) 2023-07-04 2023-07-04 B/S architecture electronic document preview processing method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310806311.6A CN116579296A (en) 2023-07-04 2023-07-04 B/S architecture electronic document preview processing method, device, medium and equipment

Publications (1)

Publication Number Publication Date
CN116579296A true CN116579296A (en) 2023-08-11

Family

ID=87536084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310806311.6A Pending CN116579296A (en) 2023-07-04 2023-07-04 B/S architecture electronic document preview processing method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN116579296A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117786258A (en) * 2024-02-27 2024-03-29 浪潮通信信息系统有限公司 Model display method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101361059A (en) * 2006-04-12 2009-02-04 龙搜(北京)科技有限公司 System and method supporting displaying content on portable apparatus
CN115328588A (en) * 2022-04-07 2022-11-11 百望股份有限公司 Method and system for rendering OFD (office file) based on browser front end

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101361059A (en) * 2006-04-12 2009-02-04 龙搜(北京)科技有限公司 System and method supporting displaying content on portable apparatus
CN115328588A (en) * 2022-04-07 2022-11-11 百望股份有限公司 Method and system for rendering OFD (office file) based on browser front end

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王仲 等: "SVG――一种支持可缩放矢量图形的Web浏览语言规范", 《中国图象图形学报》, vol. 5, no. 12, pages 1039 - 1043 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117786258A (en) * 2024-02-27 2024-03-29 浪潮通信信息系统有限公司 Model display method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109408783B (en) Electronic document online editing method and system
CN106991154B (en) Webpage rendering method and device, terminal and server
US8549395B2 (en) Method and system for transforming an integrated webpage
US5897644A (en) Methods and apparatus for fixed canvas presentations detecting canvas specifications including aspect ratio specifications within HTML data streams
US20150046797A1 (en) Document format processing apparatus and document format processing method
CN106886551B (en) Method and device for displaying image by using markup language
US8782617B2 (en) Apparatus and method for translating open vector graphic application program interface
JP2008176820A (en) System and method for content delivery over wireless communication medium to portable computing device
CN109815451B (en) PDF (Portable document Format) generation method, device and equipment
US9117314B2 (en) Information output apparatus, method, and recording medium for displaying information on a video display
CN104050238A (en) Map labeling method and map labeling device
US8656055B2 (en) Protocol wrapper and serializer/deserializer for facilitating data exchanges
CN116579296A (en) B/S architecture electronic document preview processing method, device, medium and equipment
CN110837347A (en) Webpage printing method based on analysis plug-in, server and storage medium
CN112966469B (en) Method, device, equipment and storage medium for processing charts in document
CN112597101A (en) Method and device for converting topological graph file into SVG file based on web front end
CN105956133B (en) Method and device for displaying file on intelligent terminal
CN113742530A (en) System, method, device, processor and storage medium for realizing generation and processing of digital poster picture based on SVG
JP2002091726A (en) Printer system
CN110674437A (en) Method and device for converting webpage data into PDF (Portable document Format) attachment
CN114791988A (en) Browser-based PDF file analysis method, system and storage medium
CN112581568B (en) Dynamic poster generation method, device, server and storage medium
CN113326043A (en) Webpage rendering method, webpage manufacturing method and webpage rendering system
US20150269131A1 (en) Content conversion apparatus and method, and communication system
CN113382086B (en) Document transmission method and device, electronic equipment and computer program product

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230811