File generation method, device, equipment, medium and product
By responding to user signature confirmation, querying and obtaining protocol rich text content, and dynamically generating target signature protocol files, the inconvenience and inflexibility of protocol files in the existing technology is solved, and the convenient and flexible generation of protocol files is achieved.
Patent Information
- Application Number
- CN202411800606.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, when the agreement or contract content is adjusted, it is difficult to realize the dynamic configuration of PDF template content, which affects the convenience and flexibility of the generation of protocol files.
By responding to user signature confirmation, querying the preset database to obtain the protocol rich text content, and generating the target signature protocol file based on the user signature confirmation and protocol rich text content, and dynamically adjusting the protocol content and signature location.
It realizes the convenience and flexibility of protocol file generation, and can dynamically adjust the protocol rich text content when the protocol content changes, avoiding the use of fixed PDF templates.
Smart Images

Figure CN119740565A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of online protocol technology, and in particular to a file generation method, device, equipment, medium and product. Background Art
[0002] With the rapid development of e-commerce, the demand for online shopping is increasing, and there are more and more online signed agreements such as user registration, privacy agreements, customization agreements, and online contracts, and the use of paperless agreements and contracts is becoming more and more widespread. With the changes and improvements of relevant laws and regulations, and the adjustments of merchant systems and policies, merchants need to adjust the content of user registration, privacy agreements, customization agreements, and online contracts from time to time.
[0003] In the prior art, if the content of an agreement or contract is adjusted, the content in the PDF form needs to be modified again, wherein the content of the form field can be replaced dynamically, but it is difficult to achieve dynamic configuration of the PDF template content, thereby affecting the convenience and flexibility of generating the agreement document. Summary of the invention
[0004] The main purpose of this application is to provide a file generation method, device, equipment, medium and product, aiming to improve the convenience and flexibility of protocol file generation.
[0005] To achieve the above object, the present application provides a file generation method, the method comprising:
[0006] In response to receiving the user signature confirmation, querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation;
[0007] Generate a target signature agreement file based on the user signature confirmation and the agreement rich text content.
[0008] In one embodiment, in response to receiving the user signature confirmation, before the step of querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation, the step also includes:
[0009] Get the agreement content template;
[0010] The protocol content template is edited and variables are configured to obtain the protocol rich text content, and the protocol rich text content is stored in the preset database.
[0011] In one embodiment, the step of generating a target signature agreement file based on the user signature confirmation and the agreement rich text content includes:
[0012] Generating a signature image file according to the user signature confirmation, and determining the agreement content, form field width and form elements according to the rich text content of the agreement;
[0013] A target protocol file is generated based on the protocol content, form field width and form elements, and the signature image file is spliced to the target protocol file to obtain the target signature protocol file.
[0014] In one embodiment, the step of generating a target protocol file based on the protocol content, form field width, and form elements includes:
[0015] Traversing the form elements to create cells, and assigning the protocol content to the cells to obtain the assigned cells;
[0016] Create a PDF table according to the form field width, and write the assigned cells into the PDF table to obtain a PDF table row;
[0017] Calculate the required number of PDF pages, the subscript value of each page, and the height of the last page of the PDF table row;
[0018] The target protocol file is generated according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last table page.
[0019] In one embodiment, the step of generating the target protocol file according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last table page includes:
[0020] Get the height of the signature image file;
[0021] Calculate the height of the last page of the table after signing and the position of the signature image according to the height of the signature image file, the required number of PDF pages and the height of the last page of the table;
[0022] According to the required number of PDF pages, PDF blank pages are added dynamically and cyclically, and according to the subscript value of each page, the PDF table row is dynamically written into the PDF blank page to obtain the target protocol file.
[0023] In one embodiment, after the step of generating a target signature agreement file based on the user signature confirmation and the agreement rich text content, the step further includes:
[0024] Upload the target signature protocol file to the cloud storage server and associate it with the user;
[0025] Generate a file link corresponding to the target signature protocol file, so that the user can access and / or download the target signature protocol file online through the file link.
[0026] In addition, to achieve the above-mentioned purpose, the present application also proposes a file generation device, the file generation device comprising:
[0027] A query module, configured to, in response to receiving a user signature confirmation, query a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation;
[0028] A generation module is used to generate a target signature protocol file based on the user signature confirmation and the protocol rich text content.
[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a file generation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the file generation method described above.
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the file generation method described above are implemented.
[0031] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the file generation method described above are implemented.
[0032] One or more technical solutions proposed in this application have at least the following technical effects:
[0033] In response to receiving a user signature confirmation, a preset database is queried according to the user signature confirmation to obtain the rich-text content of the agreement corresponding to the user signature confirmation; a target signature agreement file is generated based on the user signature confirmation and the rich-text content of the agreement, and the corresponding rich-text content of the agreement is queried according to the received user signature confirmation. Since the rich-text content of the agreement can be edited and configured through the background management system, the rich-text content of the agreement can be dynamically adjusted when the agreement content mode changes. By generating the target signature agreement file based on the user signature confirmation and the rich-text content of the agreement, the target signature agreement file can be dynamically generated instead of using a fixed PDF template, thereby improving the convenience and flexibility of agreement file generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 A flowchart of the first embodiment of the method for generating application documents is provided;
[0037] Figure 2 This is a schematic diagram of a protocol rich text content editing page according to the first embodiment of the present application;
[0038] Figure 3 A schematic diagram of a process flow provided for Example 2 of the method for generating application documents;
[0039] Figure 4 This is a schematic diagram of a backend service process according to the second embodiment of the present application;
[0040] Figure 5 Schematic diagram of the process for generating application documents in Example 3
[0041] Figure 6 This is a schematic diagram of the module structure of the file generation device according to an embodiment of the present application;
[0042] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the file generation method in the embodiment of the present application.
[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] The main solution of the embodiment of the present application is: in response to receiving a user signature confirmation, querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation; generating a target signature agreement file based on the user signature confirmation and the rich text content of the agreement, by querying the corresponding rich text content of the agreement according to the received user signature confirmation. Since the rich text content of the agreement can be edited and configured through the background management system, the rich text content of the agreement can be dynamically adjusted when the agreement content mode changes. By generating the target signature agreement file based on the user signature confirmation and the rich text content of the agreement, the target signature agreement file can be dynamically generated instead of using a fixed PDF template, thereby improving the convenience and flexibility of agreement file generation.
[0047] Technical terms involved in the embodiments of this application:
[0048] PC-Web: web pages on the browser of the computer;
[0049] H5: web page on mobile browser;
[0050] JAVA: A backend development language;
[0051] Database: A warehouse that stores data;
[0052] OSS: A massive, secure, low-cost, and highly reliable object cloud storage service;
[0053] POI: A Java library for reading and writing Microsoft Office binary and OOXML file formats.
[0054] In this embodiment, for the convenience of description, the following description is made with the file generating device as the execution subject.
[0055] With the rapid development of e-commerce, the demand for online shopping is increasing. There are more and more online signed agreements such as user registration, privacy agreements, customization agreements, and online contracts, and the use of paperless agreements and contracts is becoming more and more widespread. With the changes and improvements of relevant laws and regulations, and the adjustments of merchant systems and policies, merchants need to adjust the content of user registration, privacy agreements, customization agreements, and online contracts from time to time.
[0056] In the prior art, if the content of an agreement or contract is adjusted, the method of signing a third-party content with an online document requires re-modifying the content in the PDF form. The content is fixed and cannot be configured, and the signature position is fixed and cannot be adjusted dynamically. PDFs cannot be created dynamically, and only form field content can be filled, so the text clauses in the agreement cannot be modified and adjusted dynamically. Or, except for the form field content that can be dynamically replaced, the PDF template content cannot be dynamically configured.
[0057] This application is based on web front-end and back-end technologies, and can dynamically create PDF forms, generate agreements and contract signatures online, and store and view and download agreements. Specifically, this application can save the content of the agreement in the editing of the background management system. After the content of the agreement is changed, there is no need to readjust the PDF template. The file generation method in this application can be in accordance with the agreement text format of the background management system, including fonts, font size, font color and other rich text formats, dynamically generated PDF agreements, PDF pages are also dynamically generated according to the content, and the user signature position is automatically adjusted according to the end position of the PDF text.
[0058] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a file generating device, etc. The following takes the file generating device as an example to illustrate this embodiment and the following embodiments.
[0059] Based on this, the present application embodiment provides a method for generating a file, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the method for generating documents of this application.
[0060] In this embodiment, the file generation method includes steps S10 to S20:
[0061] Step S10, in response to receiving the user signature confirmation, querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation;
[0062] Exemplarily, the user can enter the mall system through the client and select customized products, where the client includes but is not limited to PC-WEB, WeChat applet, and H5. Before checkout, the product customization agreement pops up for the user to read. After the user checks the option to agree, an online signature SMS can be sent to the user. After the user receives the SMS, he accesses the H5 signature page through the SMS signature link to sign and confirm; the signature page can also pop up directly for the user to sign and confirm.
[0063] Exemplarily, the user may confirm the signature through electronic means (such as a handwriting tablet, a touch screen, etc.).
[0064] Exemplarily, when confirming, the signature page calls the backend service customized agreement generation interface to read the rich text content of the agreement from the database.
[0065] Exemplarily, in response to receiving the user signature confirmation, before the step of querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation, the step also includes:
[0066] Get the agreement content template;
[0067] The protocol content template is edited and variables are configured to obtain the protocol rich text content, and the protocol rich text content is stored in the preset database.
[0068] Reference Figure 2 , Figure 2 This is a schematic diagram of a protocol rich text content editing page according to the first embodiment of the present application, as shown in FIG. Figure 2 As shown, the agreement content template can be edited in the backend management system. The content is in rich text format, including the agreement title, body, and agreement signing time. Variables can be configured, such as date, time, user name, product information, etc. They will be replaced by actual data when the final agreement is generated. After editing, the system will save the rich text content of the agreement to the preset database and assign it a unique identifier for subsequent query and call.
[0069] Exemplarily, the edited rich text content of the agreement can be saved in a database for query and call upon receiving the user's signature confirmation.
[0070] Exemplarily, after receiving the user signature confirmation, the identification information carried by the user signature confirmation can be parsed first, which is usually a unique identifier related to the user and the selected product or service. The identifier is used to query the preset database, in which the rich text content of the agreement related to various products or services has been pre-stored. When querying, not only can the corresponding rich text content of the agreement be retrieved, but the variable part in the rich text content can also be dynamically replaced according to the user's specific selection (such as the specific specifications and quantity of the customized product). For example, if the agreement mentions "the product you purchased is XXX", "XXX" can be replaced with the name of the product actually selected by the user.
[0071] Step S20, generating a target signature agreement file based on the user signature confirmation and the agreement rich text content.
[0072] Furthermore, in response to receiving the user signature confirmation, a preset database is queried according to the user signature confirmation, and after obtaining the rich text content of the agreement corresponding to the user signature confirmation, a target signature agreement file can be generated based on the user signature confirmation and the rich text content of the agreement.
[0073] Exemplarily, the database returns the rich text content of the agreement, and then generates a PDF agreement document.
[0074] Exemplarily, after obtaining the user's signature confirmation and the corresponding rich text content of the agreement, the system begins to generate the target signature agreement file. This process not only includes the basic step of converting the agreement content into a PDF document, but also involves the processing of the user's signature. If the user signs by accessing the H5 signature page through a text message signature link, the system will accurately embed the user's signature image or vector graphic into the specified location of the document when generating the PDF document. If the user signs directly through the client (such as PC-WEB, WeChat applet), the system will also capture and save the user's signature information, and then embed it when generating the PDF.
[0075] Exemplarily, after the step of generating a target signature agreement file based on the user signature confirmation and the agreement rich text content, the step further includes:
[0076] Upload the target signature protocol file to the cloud storage server and associate it with the user;
[0077] Generate a file link corresponding to the target signature protocol file, so that the user can access and / or download the target signature protocol file online through the file link.
[0078] For example, the temporary PDF agreement file is uploaded to the OSS storage server and associated with the user, and the temporary PDF agreement file is deleted. The user can be notified of the signing result and the signed agreement file link via WebSocket. The user can click the contract file link to view and download the target signed agreement file online.
[0079] For example, after the PDF agreement document is generated, the system will not send it to the user immediately, but will first upload it to a cloud storage server (such as OSS) and establish an association with the user's identity. The purpose of this is to ensure the secure storage and convenient access of files. At the same time, the system will generate a unique file link, which can be accessed or downloaded online by the user through any device that supports network access. In order to ensure that the user can know the signature results and the link to the signature agreement file in a timely manner, the system will send notifications to the user through real-time communication technologies such as WebSocket. The user only needs to click the link in the notification to view or download the signed target signature agreement file online.
[0080] For example, before uploading to the cloud storage server, the system will also create a temporary PDF protocol file for preview and verification before final generation. Once the official file is uploaded successfully, this temporary file will be deleted to save storage space and avoid the risk of data leakage.
[0081] This embodiment adopts the above scheme, specifically in response to receiving the user signature confirmation, querying the preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation; generating the target signature agreement file based on the user signature confirmation and the rich text content of the agreement, by querying the corresponding rich text content of the agreement according to the received user signature confirmation, because the rich text content of the agreement can be edited and configured through the background management system, the rich text content of the agreement can be dynamically adjusted when the agreement content mode changes, and by generating the target signature agreement file based on the user signature confirmation and the rich text content of the agreement, the target signature agreement file can be dynamically generated instead of using a fixed PDF template, thereby improving the convenience and flexibility of agreement file generation.
[0082] Based on the first embodiment of the present application, a second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated later.
[0083] On this basis, please refer to Figure 3 , step S20 includes steps S201 to S202:
[0084] Step S201: generating a signature image file according to the user signature confirmation, and determining the agreement content, form field width and form elements according to the agreement rich text content;
[0085] Step S202: Generate a target protocol file based on the protocol content, form field width and form elements, and splice the signature image file to the target protocol file to obtain the target signature protocol file.
[0086] Exemplarily, the step of generating a target protocol file based on the protocol content, form field width, and form elements includes:
[0087] Traversing the form elements to create cells, and assigning the protocol content to the cells to obtain the assigned cells;
[0088] Create a PDF table according to the form field width, and write the assigned cells into the PDF table to obtain a PDF table row;
[0089] Calculate the required number of PDF pages, the subscript value of each page, and the height of the last page of the PDF table row;
[0090] The target protocol file is generated according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last table page.
[0091] Exemplarily, the step of generating the target protocol file according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last page of the table includes:
[0092] Get the height of the signature image file;
[0093] Calculate the height of the last page of the table after signing and the position of the signature image according to the height of the signature image file, the required number of PDF pages and the height of the last page of the table;
[0094] According to the required number of PDF pages, PDF blank pages are added dynamically and cyclically, and according to the subscript value of each page, the PDF table row is dynamically written into the PDF blank page to obtain the target protocol file.
[0095] Exemplarily, the user signature confirmation is converted into a file in image format to facilitate embedding in the protocol file while ensuring the authenticity and non-tamperability of the signature.
[0096] Exemplarily, by parsing the rich text content of the agreement, extracting the agreement terms, form field widths and form elements, basic data is provided for the subsequent generation of the agreement file. Exemplarily, an HTML parser or an XML parser can be used to extract the agreement terms, form field widths and form elements from the rich text content to ensure the accuracy and completeness of the information.
[0097] For example, traverse the form elements, create cells for each element, and assign values according to the agreement content to form a complete PDF table row. Create a PDF table according to the form field width, and write the PDF table rows into the PDF table in order to ensure a beautiful layout. Get the height of the signature image file, calculate the height of the last page of the table after the signature and the position of the signature image, and ensure that the signature image is correctly embedded in the agreement file. Dynamically add PDF blank pages according to the required number of PDF pages to ensure that the agreement content is fully presented.
[0098] For example, traverse the form elements (such as name, date, etc.), create a cell for each element, and assign values according to the agreement content. Then, create a PDF table according to the form field width (such as 200 pixels), and write the PDF table rows into the PDF table. The system calculates the required number of PDF pages (such as 3 pages), the subscript value of each page, and the height of the last page table (such as 200 pixels). Next, the system obtains the height of the signature image file (such as 50 pixels), calculates the height of the last page table after signing (such as 250 pixels) and the signature image position (such as the bottom center of the page). Finally, the system dynamically adds PDF blank pages (3 pages in total) in a loop, and writes PDF table rows and signature images according to the subscript value of each page to generate the target signature agreement file.
[0099] Reference Figure 4 , Figure 4FIG. 1 is a schematic diagram of a backend service process according to the second embodiment of the present application, such as Figure 4 As shown, after receiving the Base64-encoded signature image, the backend custom protocol generation interface converts it into a signature image file and stores it in a temporary directory. For example, the decode function in the Base64 class provided by java.util is decoded and converted into a byte array, and then the byte array is output as a specified png format image through the OutputSream class provided by java.io.
[0100] For example, use the PdfReader class in POI to read the PDF template and instantiate it as a PdfStamper object, prepare to edit the PDF content, and use the Rectangle class in POI to get the width of the PDF template protocol content form field. For example, PDFStamper is part of the iText library, which allows developers to add watermarks, signatures, and other elements to PDF documents. After instantiating it as a PDFStamper object, you can get all the elements and replace elements of the PDF form.
[0101] Exemplarily, use the PdfTable class in POI to create a PDF table, set the obtained form field width to the width of the new table, use ItextPdf to parse the rich text content of the database query and generate an ElementList object, and replace the variables in the agreement content with actual values, such as the date of agreement signing.
[0102] Exemplarily, the determined form elements (ElementList) are traversed to create PdfCell cells, the cell borders are removed and the protocol content is assigned to the cells, and then the PdfCell cells are written into the created PdfTable table. After the cells are written into the table, the number of PDF pages required for the table, the subscript value of each page, and the table height of the last page are calculated.
[0103] Exemplarily, the height of the last page is recalculated by the total height of the generated PdfTable and the number of PDF pages. The height between the agreement content and the signature position needs to be added, and finally the height of the signature file needs to be added to determine whether it exceeds the PDF page height. If it exceeds, another page needs to be added and the signature image position of the last page needs to be calculated.
[0104] For example, the PdfTable table turns on the automatic page-spanning setting, dynamically adds blank pages based on the calculated number of pages, and then dynamically writes table rows to the blank pages of the PDF file based on the subscript value of each page. Based on the calculated signature image position, the signature image file is spliced into the target protocol file through the PdfContentByte in the POI to obtain the target signature protocol file.
[0105] This embodiment adopts the above scheme, specifically by generating a signature image file according to the user signature confirmation, and determining the agreement content, form field width and form elements according to the rich text content of the agreement; generating a target agreement file based on the agreement content, form field width and form elements, and splicing the signature image file to the target agreement file to obtain the target signature agreement file, and dynamically generating a PDF agreement according to the agreement text format of the background management system, including other rich text formats such as font, font size, font color, etc., PDF pages can be dynamically produced according to the content, and the signature image file position is also automatically adjusted according to the end position of the PDF text, thereby improving the convenience and flexibility of agreement file generation.
[0106] Based on any of the foregoing embodiments of the present application, a third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as any of the foregoing embodiments can be referred to the above introduction and will not be described in detail later. Figure 5 The main steps of the file generation method include:
[0107] 1. The agreement content template can be edited in the backend management system. The content is in rich text format, including the agreement title, body, and agreement signing time. Variables can be configured, such as time can be configured as a variable;
[0108] 2. The edited rich text content of the agreement is saved in the database;
[0109] 3. The user enters the mall system through the client, including but not limited to PC-WEB, WeChat applet, H5, selects customized products, and the product customization agreement pops up for the user to read before settlement. After the user ticks the "Agree" option, an online signature SMS is sent to the user. After the user receives the SMS, he accesses the H5 signature page through the SMS signature link to sign and confirm;
[0110] 4. When confirming the signature page, call the backend service custom agreement generation interface to read the rich text content of the agreement from the database;
[0111] 5. The database returns the rich text content of the agreement, and then generates the PDF agreement document. The specific logic is as follows:
[0112] 5.1 After receiving the Base64-encoded signature image, the backend custom protocol generation interface converts it into a signature image file and stores it in a temporary directory;
[0113] 5.2 Use the PdfReader class in POI to read the PDF template and instantiate it into a PdfStamper object, ready to edit the PDF content, and use the Rectangle class in POI to obtain the width of the PDF template protocol content form field;
[0114] 5.3 Use the PdfTable class in POI to create a PDF table, and set the form field width in 5.2 to the width of the new table;
[0115] Use ItextPdf to parse the rich text content of the database query and generate an ElementList object, and replace the variables in the agreement content with actual values, such as the date of agreement signing;
[0116] 5.4 Traverse the ElementList in 5.3 to create PdfCell cells, remove the cell borders and assign the protocol content to the cells, then write the PdfCell cells into the PdfTable created in 5.3. After the cells are written into the table, calculate the number of PDF pages required for the table, the subscript value of each page, and the table height of the last page;
[0117] 5.5 Recalculate the height of the last page by using the total height of the PdfTable generated in 5.4 and the number of PDF pages. You need to add the height between the agreement content and the signature position, and finally add the height of the signature file in 5.1 to determine whether it exceeds the PDF page height. If it does, you need to add another page and calculate the signature image position on the last page.
[0118] 5.6 The PdfTable table turns on the automatic page-spanning setting, and dynamically adds blank pages based on the number of pages calculated in 5.4. Then, the table rows are dynamically written to the blank pages of the PDF file based on the subscript value of each page.
[0119] 5.7 Based on the signature image position calculated in 5.5, use PdfContentByte in POI to stitch the signature image in 4.1 into the PDF file;
[0120] 6. Upload the temporary PDF protocol file to the OSS storage server and associate the user, and delete the temporary PDF protocol file;
[0121] 7. Notify the user of the signature result and signature agreement file link through WebSocket;
[0122] 8. Users can click on the contract document link to view and download the agreement document online.
[0123] Through the above solution, this embodiment can flexibly adjust the text of the agreement content, and the adjustment will take effect in real time without the need for version release. Compared with the fixed template form field filling, there is no need to design a template separately, no need to replace the template, and the signature position can be generated adaptively, which improves the convenience and flexibility of the agreement file generation.
[0124] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the document generation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0125] This application also provides a file generation device, please refer to Figure 6 , the file generating device comprises:
[0126] A query module, configured to, in response to receiving a user signature confirmation, query a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation;
[0127] A generation module is used to generate a target signature protocol file based on the user signature confirmation and the protocol rich text content.
[0128] The file generation device provided by the present application adopts the file generation method in the above embodiment to solve the technical problem of file generation. Compared with the prior art, the beneficial effects of the file generation device provided by the present application are the same as the beneficial effects of the file generation method provided by the above embodiment, and other technical features in the file generation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0129] The present application provides a file generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file generation method in the above-mentioned embodiment 1.
[0130] Reference below Figure 7 , which shows a schematic diagram of the structure of a file generating device suitable for implementing the embodiment of the present application. The file generating device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The file generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0131] like Figure 7As shown, the file generating device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the file generating device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the file generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a file generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0132] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0133] The file generation device provided by the present application adopts the file generation method in the above embodiment to solve the technical problem of file generation. Compared with the prior art, the beneficial effects of the file generation device provided by the present application are the same as the beneficial effects of the file generation method provided by the above embodiment, and other technical features in the file generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0134] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0136] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the file generation method in the above-mentioned embodiment.
[0137] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0138] The computer-readable storage medium may be included in the file generating device; or may exist independently without being assembled into the file generating device.
[0139] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the file generating device, the file generating device: in response to receiving a user signature confirmation, queries a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation; generates a target signature agreement file based on the user signature confirmation and the rich text content of the agreement, and queries the corresponding rich text content of the agreement according to the received user signature confirmation. Since the rich text content of the agreement can be edited and configured through the background management system, the rich text content of the agreement can be dynamically adjusted when the agreement content mode changes. By generating the target signature agreement file based on the user signature confirmation and the rich text content of the agreement, the target signature agreement file can be dynamically generated instead of using a fixed PDF template, thereby improving the convenience and flexibility of agreement file generation.
[0140] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0143] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned file generation method, and can solve the technical problem of file generation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the file generation method provided in the above-mentioned embodiment, and will not be repeated here.
[0144] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned file generation method when executed by a processor.
[0145] The computer program product provided by the present application can solve the technical problem of file generation. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the file generation method provided by the above embodiment, which will not be repeated here.
[0146] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A file generation method, characterized in that: The method comprises: In response to receiving the user signature confirmation, querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation; Generate a target signature agreement file based on the user signature confirmation and the agreement rich text content.
2. The method according to claim 1, characterized in that In response to receiving the user signature confirmation, before the step of querying a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation, the step also includes: Get the agreement content template; The protocol content template is edited and variables are configured to obtain the protocol rich text content, and the protocol rich text content is stored in the preset database.
3. The method according to claim 1, characterized in that The step of generating a target signature protocol file based on the user signature confirmation and the protocol rich text content includes: Generating a signature image file according to the user signature confirmation, and determining the agreement content, form field width and form elements according to the rich text content of the agreement; A target protocol file is generated based on the protocol content, form field width and form elements, and the signature image file is spliced to the target protocol file to obtain the target signature protocol file.
4. The method according to claim 3, characterized in that The step of generating a target protocol file based on the protocol content, form field width and form elements comprises: Traversing the form elements to create cells, and assigning the protocol content to the cells to obtain the assigned cells; Create a PDF table according to the form field width, and write the assigned cells into the PDF table to obtain a PDF table row; Calculate the required number of PDF pages, the subscript value of each page, and the height of the last page of the PDF table row; The target protocol file is generated according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last table page.
5. The method according to claim 4, characterized in that The step of generating the target protocol file according to the required number of PDF pages of the PDF table row, the subscript value of each page, and the height of the last page table includes: Get the height of the signature image file; Calculate the height of the last page of the table after signing and the position of the signature image according to the height of the signature image file, the required number of PDF pages and the height of the last page of the table; According to the required number of PDF pages, PDF blank pages are added dynamically and cyclically, and according to the subscript value of each page, the PDF table row is dynamically written into the PDF blank page to obtain the target protocol file.
6. The method according to claim 1, characterized in that The step of generating a target signature agreement file based on the user signature confirmation and the agreement rich text content also includes: Upload the target signature protocol file to the cloud storage server and associate it with the user; Generate a file link corresponding to the target signature protocol file, so that the user can access and / or download the target signature protocol file online through the file link.
7. A file generating device, characterized in that: The device comprises: A query module, configured to, in response to receiving a user signature confirmation, query a preset database according to the user signature confirmation to obtain the rich text content of the agreement corresponding to the user signature confirmation; A generation module is used to generate a target signature protocol file based on the user signature confirmation and the protocol rich text content.
8. A file generating device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the file generation method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the file generation method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the file generation method according to any one of claims 1 to 6 are implemented.