Method for previewing electronic contract

文档序号:1922107 发布日期:2021-12-03 浏览:20次 中文

阅读说明:本技术 一种电子合同预览的方法 (Method for previewing electronic contract ) 是由 刘颖 罗子骞 余超 胡挺 于 2021-09-06 设计创作,主要内容包括:本发明公开了一种电子合同预览的方法,属于报文转换显示处理技术领域,解决了传统技术中制作时间成本高、内容存在出错概率、预览合同展示格式与实际签署合同格式存在差异的问题,其包括以下步骤:步骤A:提供word版本合同;步骤B:在word版本合同中预留反写字段;步骤C:根据传入数据,填写word版本合同;步骤D:将word版本合同转换为图片数据;步骤E:将图片数据嵌入html上,并返回前端进行展示,实现了保证预览和签署的合同完全一致、提高前段的兼容性,并易于管理的技术效果。(The invention discloses a method for previewing an electronic contract, which belongs to the technical field of message conversion display processing and solves the problems of high cost of manufacturing time, error probability of contents and difference between a previewing contract display format and an actual signing contract format in the prior art, and comprises the following steps: step A: providing a word version contract; and B: reserving a rewriting field in the word version contract; and C: filling a word version contract according to the input data; step D: converting the word version contract into picture data; step E: the picture data is embedded into the html and returned to the front end for displaying, so that the technical effects of ensuring the complete consistency of the previewed and signed contracts, improving the compatibility of the front section and being easy to manage are achieved.)

1. A method of electronic contract preview, comprising the steps of:

step A: providing a word version contract;

and B: reserving a rewriting field in the word version contract;

and C: filling a word version contract according to the input data;

step D: converting the word version contract into picture data;

step E: and embedding the picture data into the html, and returning to the front end for displaying.

2. The method for previewing the electronic contract according to claim 1, wherein the specific steps of the step C are:

step C1: acquiring service data needing to be rewritten from each service system, and converting the service data into data streams in a map format;

step C2: extracting locally stored word contract template data and converting the extracted word contract template data into a data stream file

Step C3: converting the data stream file in the step C2 into a base64 encoded file input stream;

step C4: creating an open-source XWPtemplate processing class, and transmitting the data stream in the map format and the file input stream coded by base64 into the XWPtemplate processing class for processing;

step C5: after the processing is finished, outputting the stream to a standard file stream through an XWPtemplate processing class;

step C6: the XWPtemplate processing class is closed.

3. The method for previewing the electronic contract according to claim 1, wherein the specific steps of the step D are:

step D1: converting the word version contract into a data stream file of pdf through an xdocreport technology;

step D2: and D, converting the data stream file of the pdf obtained in the step D1 into picture data by a freemarker technology.

4. The method for previewing the electronic contract according to claim 3, wherein the specific steps of said step D1 are:

step D11: converting an output file stream obtained by upper layer processing into a byte format;

step D12: converting byte-formatted streams into byte input streams

Step D13: creating an XWPtemplate object integrated with the POIXMLPcument according to the byte input stream in step D12;

step D14: setting format information of a word file stream processing class DocPdfConverter;

step D15: and reading word byte input streams line by using the DocPdfConverter processing class, and converting the word byte input streams into pdf file output streams.

5. The method for previewing the electronic contract according to claim 3, wherein said step D2 specifically comprises the steps of:

step D21: reading a pdf output stream file through PDdocument, and initializing a PDFRENDER processor;

step D22: obtaining page number of pdf output stream file through PDdocument processing class

Step D23: setting the compression ratio of each page of picture according to requirements;

step D24: the pdf data is compressed by the PDFRenderer by a ratio;

step D25: the utility Image10 converts the pdf file stream into a standard file output stream;

step D26: converting the file output stream into standard base64 codes;

step D27: and E6, assembling the standard base64 codes to obtain a standard base64 picture information list.

6. The method for previewing the electronic contract according to claim 5, wherein the specific steps of the step E comprise:

step E1: looping the base64 picture information list obtained in the step D27;

step E2: adding format information in an html format at the beginning and the end of each base picture according to the format of an html page;

step E3: and forming an html file list which can be previewed by the front end.

Technical Field

The invention belongs to the technical field of message conversion display processing, and particularly relates to a method for previewing an electronic contract.

Background

The electronic contract, also called electronic commerce contract, is defined according to the international trade commission of the united nations 'electronic commerce demonstration law' and the electronic transaction law promulgated by countries in the world, and simultaneously in combination with the relevant provisions of the 'contractual law' of China as follows: an electronic contract is an agreement between two or more parties to establish, alter, terminate property civil rights obligations electronically over an electronic information network. The above definition shows that the electronic contract is an electronically contracted contract, which mainly refers to an electronic agreement that is signed by a party under network conditions in the form of data telegraph, e-mail or the like to define the obligation relationship between both parties and rights, in order to achieve a certain purpose.

In the traditional implementation steps, firstly, a word version contract is provided by law. And secondly, manually copying into html according to paragraphs. And thirdly, manually adjusting according to the character format in the paragraph. And fourthly, reserving a rewriting field according to the service requirement, and then making a previewable html page. The implementation scheme has the advantages of good compatibility and customizable development. But the disadvantages are that the production time cost is high, the development mode determines the error probability of contract content, and the preview contract display format and the actual signing contract format are different.

Disclosure of Invention

Aiming at the problems of high production time cost, error probability of contents and difference between the preview contract display format and the actual signing contract format in the prior art, the invention provides an electronic contract previewing method, which aims to solve the problems that: the complete consistency of the previewing contract and the signed contract is ensured, the compatibility of the front section is improved, and the management is easy.

The technical scheme adopted by the invention is as follows:

a method of electronic contract preview, comprising the steps of:

step A: providing a word version contract;

and B: reserving a rewriting field in the word version contract;

and C: filling a word version contract according to the input data;

step D: converting the word version contract into picture data;

step E: and embedding the picture data into the html, and returning to the front end for displaying.

By adopting the scheme, the same word contract is signed and previewed, compared with a sentence fragment in the traditional technology which is manually copied into the html file and is subjected to subsequent processing and previewing, the html file is easy to manage, the displayed file is the html embedded with the picture, and the compatibility of previewing to the front end is improved through the technology.

Preferably, the specific steps of step C are:

step C1: acquiring service data needing to be rewritten from each service system, and converting the service data into data streams in a map format;

step C2: extracting locally stored word contract template data and converting the extracted word contract template data into a data stream file

Step C3: converting the data stream file in the step C2 into a base64 encoded file input stream;

step C4: creating an open-source XWPtemplate processing class, and transmitting the data stream in the map format and the file input stream coded by base64 into the XWPtemplate processing class for processing;

step C5: after the processing is finished, outputting the stream to a standard file stream through an XWPtemplate processing class;

step C6: the XWPtemplate processing class is closed.

Preferably, the specific steps of step D are:

step D11: converting an output file stream obtained by upper layer processing into a byte format;

step D12: converting byte-formatted streams into byte input streams

Step D13: creating an XWPtemplate object integrated with the POIXMLPcument according to the byte input stream in step D12;

step D14: setting format information of a word file stream processing class DocPdfConverter;

step D15: and reading word byte input streams line by using the DocPdfConverter processing class, and converting the word byte input streams into pdf file output streams.

Preferably, the step D2 specifically includes the following steps:

step D21: reading a pdf output stream file through PDdocument, and initializing a PDFRENDER processor;

step D22: obtaining page number of pdf output stream file through PDdocument processing class

Step D23: setting the compression ratio of each page of picture according to requirements;

step D24: the pdf data is compressed by the PDFRenderer by a ratio;

step D25: the utility Image10 converts the pdf file stream into a standard file output stream;

step D26: converting the file output stream into standard base64 codes;

step D27: and E6, assembling the standard base64 codes to obtain a standard base64 picture information list.

Preferably, the specific steps of step E include:

step E1: looping the base64 picture information list obtained in the step D27;

step E2: adding format information in an html format at the beginning and the end of each base picture according to the format of an html page;

step E3: and forming an html file list which can be previewed by the front end.

By adopting the scheme, the previewing and signing use technologies are ensured to be the same, the technical effect is that the contract signed by the signer is completely consistent with the previewed contract, and the technical defect of error probability in the traditional technology is overcome.

In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:

1. compared with a sentence fragment in the traditional technology, the same word contract is signed and used for previewing, html files are manually copied and subsequently processed and previewed, the files are easy to manage, the displayed files are html embedded with pictures, and compatibility of previewing to the front end is improved through the technology.

2. The method ensures that the previewing and signing use technologies are the same, has the technical effect that the contract signed by the signer is completely consistent with the previewed contract, and solves the technical defect of error probability in the traditional technology.

Drawings

The invention will now be described, by way of example, with reference to the accompanying drawings, in which:

FIG. 1 is a flow chart of one embodiment of the present invention;

Detailed Description

All of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations of features and/or steps that are mutually exclusive.

The present invention will be described in detail with reference to fig. 1.

The first embodiment is as follows:

a method of electronic contract preview, comprising the steps of:

step A: providing a word version contract;

and B: reserving a rewriting field in the word version contract;

and C: filling a word version contract according to the input data;

step D: converting the word version contract into picture data;

step E: and embedding the picture data into the html, and returning to the front end for displaying.

The concrete steps of the step C are as follows:

step C1: acquiring service data needing to be rewritten from each service system, and converting the service data into data streams in a map format;

step C2: extracting locally stored word contract template data and converting the extracted word contract template data into a data stream file

Step C3: converting the data stream file in the step C2 into a base64 encoded file input stream;

step C4: creating an open-source XWPtemplate processing class, and transmitting the data stream in the map format and the file input stream coded by base64 into the XWPtemplate processing class for processing;

step C5: after the processing is finished, outputting the stream to a standard file stream through an XWPtemplate processing class;

step C6: the XWPtemplate processing class is closed.

The specific steps of the step D are as follows:

step D1: converting the word version contract into a data stream file of pdf through an xdocreport technology;

step D2: and D, converting the data stream file of the pdf obtained in the step D1 into picture data by a freemarker technology.

The specific steps of the step D1 are as follows:

step D11: converting an output file stream obtained by upper layer processing into a byte format;

step D12: converting byte-formatted streams into byte input streams

Step D13: creating an XWPtemplate object integrated with the POIXMLPcument according to the byte input stream in step D12;

step D14: setting information such as font, format and the like of word file stream processing class DocPdfConverter;

step D15: and reading word byte input streams line by using the DocPdfConverter processing class, and converting the word byte input streams into pdf file output streams.

The step D2 specifically includes the following steps:

step D21: reading a pdf output stream file through PDdocument, and initializing a PDFRENDER processor;

step D22: obtaining page number of pdf output stream file through PDdocument processing class

Step D23: setting the compression ratio of each page of picture according to requirements;

step D24: the pdf data is compressed by the PDFRenderer by a ratio;

step D25: the utility Image10 converts the pdf file stream into a standard file output stream;

step D26: converting the file output stream into standard base64 codes;

step D27: and E6, assembling the standard base64 codes to obtain a standard base64 picture information list.

The specific steps of the step E comprise:

step E1: looping the base64 picture information list obtained in the step D27;

step E2: adding format information in an html format at the beginning and the end of each base picture according to the format of an html page;

step E3: and forming an html file list which can be previewed by the front end.

In the above embodiment, the word version contract of step a is provided by the legal affairs, wherein the source of all contract requirements, the contract sample after being legally reviewed by the legal affair providing, the contract text on the general line, does not directly preview the contract text, but needs to preview the contract information of the actual personal identification data and the business data, and therefore, the rewriting information needs to be reserved on the word contract, as shown in step B, so that the personal information and the cooperative business information of the user can be rewritten.

After the rewriting field is reserved, through a poi-tl technology, the personal information of the user and the service data are rewritten to the word contract version to obtain the word contract version of the rewriting data;

after the back writing process is completed, converting the contract of the word version into a data stream file of the pdf through an open source xdocreport technology, wherein the syntax of the xdocreport can be one of Velocity or Freemarker, converting the contract of the word version into the data stream file of the pdf, converting the data stream file of the pdf into a plurality of pieces of picture data through a Freemarker technology, embedding the picture data into a page of reverse html, and returning the page of the reverse html to the front end for displaying.

By adopting the scheme, the method has the following two technical advantages that: code development does not need to be carried out on each contract, so that manpower is saved; the second step is as follows: what is seen, i.e., signed, contract page the customer actually sees, i.e., the pdf contract that was finally signed, is achieved with the compatibility attributes satisfied.

The above-mentioned embodiments only express the specific embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for those skilled in the art, without departing from the technical idea of the present application, several changes and modifications can be made, which are all within the protection scope of the present application.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种字体设置方法、用户终端、服务器及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!