Plug-in-free document form printing processing method and device

By generating PDF files on the server side and using the browser's native functions for preview and printing, the operational complexity, security, and compatibility issues caused by plug-in dependence are resolved, and efficient and secure plug-in-free document form printing is achieved.

CN120276691BActive Publication Date: 2025-09-09BEIJING JOIN CHEER SOFTWARE
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510759370.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-09
Estimated Expiration
2045-06-09

AI Technical Summary

Technical Problem

In the existing technology, the printing of business documents or spreadsheet files relies on client plug-ins, which leads to complex operations, resource occupation, high security risks and compatibility issues. There is a lack of efficient and stable plug-in-free printing solutions.

Method used

Generate PDF files on the server and convert them into file streams. Utilize the browser's native PDF preview and printing functions to achieve plug-in-free document form printing through a visual print template design interface. Combined with text adaptive typesetting and paging control algorithms, it supports multiple table row types and data binding.

Benefits of technology

It achieves high compatibility, security and efficient document form printing without the need to install plug-ins, supports intelligent paging of large amounts of data and printing of complex forms, improves system compatibility and security, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276691B_ABST
    Figure CN120276691B_ABST
Patent Text Reader

Abstract

The present invention discloses a plug-in-free document form printing processing method and device. The method comprises: upon receiving a print request sent by a Web front end, generating a corresponding PDF file according to the print request, wherein the print request includes: a print template identifier and a data resource identifier; converting the PDF file into a file stream format and returning it to the Web front end, so that the Web front end can print and preview the PDF file through the browser's native PDF preview function, and complete the printing of the PDF file through the browser's native print function. The document form printing processing method of the present invention does not need to rely on any client plug-in, avoids problems in plug-in installation, compatibility, security, etc., and realizes a document form printing method that does not require plug-ins, has strong compatibility, is simple to deploy, and has high security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a printing method, in particular to a plug-in-free document form printing processing method and device. Background Art

[0002] In existing information systems, users frequently need to print various business documents or spreadsheets for archiving, approval, or circulation purposes. Currently, printing these documents and spreadsheets typically relies on client-installed print plug-ins. These plug-ins are typically installed on user terminals as browser extensions or standalone software, supporting complex print output and preview control.

[0003] However, this approach presents numerous problems. First, plug-ins typically require manual installation and configuration, increasing operational complexity. Second, plug-ins consume system resources while running, potentially impacting terminal performance. Furthermore, plug-ins can easily become a gateway to security vulnerabilities, especially when they come from unknown sources or are out of date. Furthermore, plug-ins have limited compatibility and may not function properly across different operating systems or browser versions. Furthermore, plug-ins require regular updates and maintenance, increasing the management burden on users.

[0004] Therefore, the prior art lacks a technical solution that does not rely on a client printing plug-in and can stably and efficiently implement document form printing. Summary of the Invention

[0005] In order to solve at least one technical problem in the above-mentioned background technology, the present invention proposes a plug-in-free document form printing processing method and device.

[0006] To achieve the above-mentioned object, according to one aspect of the present invention, a plug-in-free document form printing processing method is provided, which is applied to a server and includes:

[0007] Upon receiving a print request sent by a Web front-end, a corresponding PDF file is generated according to the print request, wherein the print request includes: a print template identifier and a data resource identifier; wherein, in the process of generating the PDF file, a table row type setting is parsed from the print template design information corresponding to the print template identifier; and then, according to the table row type setting, a paging presentation mode of each type of table row in the generated PDF file is controlled, and text content in a cell is typeset based on a preset text adaptive typesetting algorithm; the table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page;

[0008] The PDF file is converted into a file stream format and returned to the Web front end, so that the Web front end can print preview the PDF file through the browser's native PDF preview function and complete the printing of the PDF file through the browser's native print function.

[0009] Optionally, converting the PDF file into a file stream format and returning it to the web front-end, so that the web front-end can print preview the PDF file through a native PDF preview function of the browser and print the PDF file through the native print function of the browser, includes:

[0010] The file stream and printing policy identifier of the PDF file are returned to the Web front-end, so that the Web front-end adopts the corresponding policy for print preview and printing according to the printing policy identifier, wherein the printing policy identifier includes: a first identifier for identifying the use of the browser's native PDF preview and printing functions and a second identifier for identifying the use of WebAssembly for PDF rendering and preview and the use of the browser's native printing function for printing; when the printing policy identifier is the first identifier, the Web front-end prints the PDF file through the browser's native PDF preview function and completes the printing of the PDF file through the browser's native printing function; when the printing policy identifier is the second identifier, the Web front-end loads a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the file stream of the PDF file, and render the decoded PDF content to a Canvas element or DOM container in the browser for preview, and completes printing through the browser's native printing function.

[0011] Optionally, the plug-in-free document form printing processing method further includes:

[0012] Acquire front-end operating environment indicator data collected by the Web front-end, wherein the front-end operating environment indicator data includes: network delay, downstream bandwidth, browser type, browser version, network type, memory size, and the number of print tasks queued by the current user;

[0013] The printing strategy is determined and the printing strategy identifier is generated based on the front-end operating environment indicator data and a preset printing strategy prediction model, wherein the printing strategy prediction model is obtained by training using a classification model based on training samples.

[0014] Optionally, the typesetting process of the text content in the cell based on a preset text adaptive typesetting algorithm includes:

[0015] When automatic row height is not enabled, the text is first wrapped and laid out based on the cell column width and the set fixed row height. If the text cannot be fully displayed after wrapping, the font size is automatically reduced by decreasing the font size until the text is fully displayed.

[0016] When automatic row height is enabled, the text content is wrapped according to the column width, and the row height of the cell is dynamically calculated based on the number of rows after wrapping and the row spacing. The final height of each row takes the row height of the highest cell in the row as the base row height.

[0017] Optionally, generating a corresponding PDF file according to the print request includes:

[0018] In the process of generating the PDF file, the calculation formula bound to the cell is parsed from the printing template design information corresponding to the printing template identifier, and the calculation formula is executed, and the formula calculation result is filled into the corresponding cell position to generate PDF content containing the formula calculation result.

[0019] Optionally, generating a corresponding PDF file according to the print request includes:

[0020] In the process of generating the PDF file, the configuration content of the extended table component is parsed from the print template design information corresponding to the print template identifier, and the approval process track data is structured based on the configuration content, and the approval node information is rendered into the cell corresponding to the table component, wherein the configuration content includes the bound approval process track field and signature field. The signature field is bound to the floating row area of ​​the table and is used to display the electronic signature image of the operator of each approval node in the PDF file to fully present the approval process and signature information.

[0021] Optionally, when the Web front end receives the file stream of the PDF file, it dynamically generates an iframe tag in the browser page, and embeds the file stream into the iframe tag for loading, so as to call the browser's native PDF preview function to complete the print preview of the PDF file.

[0022] Optionally, the plug-in-free document form printing processing method further includes:

[0023] A preset visual printing template design interface is displayed to the user through the Web front end, and the printing template designed by the user on the visual printing template design interface is converted into structured printing template design information, and a printing template identifier corresponding to the printing template design information is generated.

[0024] Optionally, the functions implemented by the visual printing template design interface include: supporting users to layout multiple component elements by dragging and dropping through a graphical interface, and the component elements include: form components, table components and image components; supporting the configuration of multiple table design parameters, and the table design parameters include: row height, column width, background color, border, alignment and font style; supporting the setting of cells, and binding cells to business fields or calculation formulas executed by the server; supporting the connection of the table component to an extended data set to meet personalized table data printing needs; supporting the setting of the table row type in the table component, and the table row type is used to control the paging presentation method of different table rows during the printing process, and the table row types include: single printing, printing per page, floating row, printing at the end of each page and printing at the end of the page; supporting the configuration of the table component for displaying approval process trajectory data, and supporting the binding of approval node fields and signature fields to corresponding cells, wherein the signature field is bound to the floating row area, and is used to display the electronic signature image of the approval node operator when printing, so as to fully display the approval process and signing information.

[0025] To achieve the above-mentioned object, according to another aspect of the present invention, a plug-in-free document form printing and processing device is provided, which is applied to a server and includes:

[0026] A PDF file generation unit, configured to, upon receiving a print request sent by a Web front end, generate a corresponding PDF file according to the print request, wherein the print request includes a print template identifier and a data resource identifier; wherein, in the process of generating the PDF file, a table row type setting is parsed from the print template design information corresponding to the print template identifier; and then, based on the table row type setting, a paging presentation mode of each type of table row in the generated PDF file is controlled, and text content in a cell is typeset based on a preset text adaptive typesetting algorithm; the table row types include: single printing, per-page printing, floating row, last-row printing, and last-page printing;

[0027] The file stream sending unit is used to convert the PDF file into a file stream format and return it to the Web front end, so that the Web front end can print preview the PDF file through the browser's native PDF preview function and complete the printing of the PDF file through the browser's native print function.

[0028] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned plug-in-free document form printing processing method are implemented.

[0029] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer-readable storage medium is further provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the above-mentioned plug-in-free document form printing processing method are implemented.

[0030] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer program product is further provided, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned plug-in-free document form printing processing method.

[0031] The beneficial effects of the present invention are:

[0032] The present invention generates a corresponding PDF file by receiving a print request sent by a Web front-end on the server side, thereby achieving unified rendering and format control of business print content. The generated PDF file is converted into a file stream format and returned to the Web front-end. The Web front-end running in the browser environment calls the browser's native PDF preview function to display the PDF file, and uses the browser's built-in print function to complete the printing operation. The above-mentioned processing flow of the present invention does not require reliance on any client plug-in, avoiding issues such as plug-in installation, compatibility, and security, and realizes a document form printing method that does not require plug-ins, has strong compatibility, is simple to deploy, and has high security. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0034] Figure 1 This is a flow chart of a plug-in-free document form printing processing method according to an embodiment of the present invention;

[0035] Figure 2 This is a flow chart of performing typesetting processing on text content in a cell according to an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the application scenario of the present invention;

[0037] Figure 4 It is a schematic diagram of the process of plug-in-free printing of the present invention;

[0038] Figure 5 This is a structural block diagram of a plug-in-free document form printing and processing device according to an embodiment of the present invention;

[0039] Figure 6 Schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0041] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0042] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or apparatuses.

[0043] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0044] The present invention aims to provide a plug-in-free, highly compatible, and highly flexible document form printing and processing method to achieve the following objectives:

[0045] 1. Eliminate plug-in dependencies and improve security and compatibility:

[0046] This solution overcomes traditional printing solutions' reliance on plug-ins like ActiveX and NPAPI, avoiding deployment challenges associated with plug-in installation, permission management, and version compatibility. It also addresses security risks introduced by plug-ins (such as Common Vulnerabilities and Exposures (CVEs) and malicious code injection), meeting the security requirements of Zero Trust Architecture (ZTA).

[0047] 2. Support intelligent paging and complex table printing:

[0048] This overcomes the limitations of native browser printing (window.print) for paging large tables, implementing dynamic paging logic (such as avoiding page breaks, duplicate headers, and custom paging rules). It also addresses the style confusion caused by incomplete support for CSS print media queries (@page, page-break-inside), ensuring paging accuracy exceeding 99.9%.

[0049] 3. Achieve data-driven efficient batch printing:

[0050] Provides a templated printing interface, supports JSON data binding, avoids manual DOM operations, and can process more than 100,000 rows of data at a time (measured memory usage is <500MB).

[0051] The present invention provides a plug-in-free document form printing system, such as Figure 3 As shown, the plug-in-free document form printing system of the present invention includes: a server and a Web front end, and the Web front end is set to run in a browser.

[0052] The server receives print requests from the web frontend, parses the print template design information, generates the corresponding PDF file based on the business data, and converts the PDF file into a file stream format and returns it to the web frontend. The server can be a backend service system deployed on a cloud server, a local server, or an enterprise intranet. It can consist of a web application server, a PDF generation module, a template parsing engine, and data processing components.

[0053] The web front-end is located in the user's browser and is responsible for initiating a print request and carrying a print template identifier and data resource identifier. After receiving the PDF file stream returned by the server, it dynamically generates an iframe tag within the browser page and embeds the PDF file within it for display, enabling print preview. The web front-end can also provide a visual print template design interface for users to customize print templates. In one embodiment of the present invention, the web front-end can be built based on HTML5 and Canvas technology.

[0054] The browser hosts and runs the web front-end, providing native PDF preview and printing capabilities. Without installing any plugins, the browser can call upon the system's built-in rendering and printing modules to preview and print PDF files. This browser can be Chrome, Edge, Firefox, Safari, and other browsers.

[0055] Figure 4 This is a flow chart of the present invention's plug-in-free printing process. Figure 4As shown, in one embodiment of the present invention, the plug-in-free printing process of the present invention can be as follows: after a user initiates a print request on the front-end interface (i.e., the web front-end), the request is sent to the server. The server first parses the print template design information and data resource identifier corresponding to the print template identifier carried in the request, then generates the corresponding PDF file through a PDF generator. The PDF content is then converted into a PDF file stream and sent to the browser. After receiving the file stream, the browser uses an iframe embedded method to perform native PDF preview. The user can perform printing operations through the browser's built-in printing API. The entire process does not require the installation of any plug-ins, and structured and standardized print output can be achieved.

[0056] It should be noted that the plug-in-free document form printing processing method of the following embodiments of the present invention is applied to the server, that is, the implementation subject of the plug-in-free document form printing processing method of the following embodiments of the present invention is the server.

[0057] Figure 1 This is a flow chart of a method for printing a form of receipt without a plug-in according to an embodiment of the present invention. Figure 1 As shown, in one embodiment of the present invention, the plug-in-free document form printing processing method of the present invention includes step S101 and step S102.

[0058] Step S101: upon receiving a print request sent by a Web front end, generating a corresponding PDF file according to the print request, wherein the print request includes: a print template identifier and a data resource identifier.

[0059] In the present invention, in the process of generating the PDF file, the setting of the table row type is parsed from the printing template design information corresponding to the printing template identifier, and then the paging presentation method of various types of table rows in the generated PDF file is controlled according to the setting of the table row type, and the text content in the cell is typeset based on a preset text adaptive typesetting algorithm. The table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page.

[0060] In the present invention, the print template identifier is used to identify the print template design information. The print template identifier corresponds one-to-one with the print template design information, and the server can obtain the corresponding specific print template design information based on the print template identifier. The data resource identifier is used to identify the specific data to be filled in the print template. For example, in a document system, the data resource identifier can refer to the document number.

[0061] In the present invention, a print request is initiated by a Web front-end and includes a print template identifier and a data resource identifier. The print template identifier corresponds one-to-one with the print template design information. The print template design information can be structured data (e.g., in JSON format) and records information such as the document form's layout structure, style settings, bound fields, and paging control. After receiving the request, the server parses the print template design information corresponding to the print template identifier and extracts layout information, thereby generating a standardized PDF file based on the back-end business data determined by the data resource identifier. This process is completed centrally on the server, ensuring uniformity of the output format and logical consistency, and avoiding printing issues caused by front-end layout deviations or browser differences.

[0062] In one embodiment of the present invention, the print template design information is specifically generated by a web front-end displaying a preset visual print template design interface to the user, allowing the user to design the print template through graphical operations on the interface, and the server converting the designed print template into structured template description data. The present invention also generates a print template identifier corresponding to the print template design information. The print template design information can be stored on the server.

[0063] In one embodiment of the present invention, the server can implement rendering and output of printed content based on an existing PDF generation component. For example, an open source or commercial PDF processing library such as iText or PDFBox can be used to generate a corresponding PDF file.

[0064] Step S102: Convert the PDF file into a file stream format and return it to the Web front end, so that the Web front end can print preview the PDF file through the browser's native PDF preview function and print the PDF file through the browser's native print function.

[0065] In this invention, after a PDF file is generated, the server converts it into a standard file stream format (such as Blob data based on an HTTP response) and returns it to the web front-end. After receiving the file stream, the front-end dynamically creates an iframe element in the browser page and embeds the PDF file within it for display. Since browsers generally have built-in PDF rendering modules, the browser's native preview and printing capabilities can be directly invoked without installing any plug-ins or external dependent software. This solution simplifies the user operation process and improves system compatibility and security. It is particularly suitable for business system environments that require batch deployment and cross-platform use.

[0066] In one embodiment of the present invention, when the Web front-end receives the file stream of the PDF file, it dynamically generates an iframe tag in the browser page, and embeds the file stream into the iframe tag for loading, so as to call the browser's native PDF preview function to complete the print preview of the PDF file.

[0067] The present invention completes the parsing of the print template and the generation of the PDF file on the server side, and returns the generated PDF file to the Web front end in the form of a file stream. The front end displays and outputs the file based on the browser's native PDF preview and printing functions. The entire process does not require reliance on any client plug-ins, such as ActiveX controls, PDF extension components, or independent printing software. This fundamentally avoids the compatibility, security, and maintenance cost issues brought about by plug-in installation, and realizes true plug-in-free printing.

[0068] In one embodiment of the present invention, the plug-in-free document form printing processing method of the present invention further includes:

[0069] A preset visual printing template design interface is displayed to the user through the Web front end, and the printing template designed by the user on the visual printing template design interface is converted into structured printing template design information.

[0070] In one embodiment of the present invention, the visual printing template design interface can be presented in a graphical manner, usually built based on HTML5 and Canvas technology, and can be run directly in the browser without installing plug-ins. The interface is preset with draggable control components (such as tables, forms, pictures, etc.), and users can intuitively complete the template layout and style settings through mouse operations, which greatly improves the convenience and visual experience of template design. After the user completes the printing template in the design interface, the system will automatically convert the printing template content into structured printing template design information. The printing template design information usually adopts data formats such as JSON, including control type, layout information, style parameters, data binding fields, paging rules, signature fields and other information. The printing template identifier corresponding to the printing template design information will be sent to the server as the core parameter of the printing request to drive the unified generation of PDF files, ensuring the consistency of the front-end and back-end printing logic and the accuracy of the layout.

[0071] In one embodiment of the present invention, the functions implemented by the visual print template design interface include:

[0072] 1. Support users to layout multiple component elements by dragging and dropping through the graphical interface, including form components, table components, and image components;

[0073] 2. Support configuration of multiple table design parameters, including row height, column width, background color, border, alignment and font style;

[0074] 3. Support setting cells and binding cells with business fields or calculation formulas executed by the server;

[0075] 4. Support connecting the table component to an extended data set to meet personalized table data printing needs;

[0076] 5. Support setting the table row type in the table component. The table row type is used to control the paging presentation mode of different table rows during printing. The table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page;

[0077] 6. Supports configuring table components to display approval process trajectory data, and supports binding approval node fields and signature fields to corresponding cells. Among them, the signature field is bound to the floating row area to display the electronic signature image of the approval node operator when printing, so as to fully display the approval process and signature information.

[0078] Regarding function 1, this invention allows users to freely drag and drop required forms, tables, images, and other component elements into the template area through a visual print template design interface provided by the web front-end, completing the template structure without writing code. This approach lowers the technical threshold, improves template design efficiency, and is suitable for personalized document design needs in various business scenarios.

[0079] Regarding feature 2, in this invention, users can fine-tune the style of the table component through a visual interface, including setting parameters such as the size, color, border style, font weight, and position alignment of each row and column to meet professional typesetting requirements. This configuration option allows users to control the aesthetics and readability of printing.

[0080] Regarding feature 3, in this invention, during the template design process, users can configure table cells individually, supporting settings such as merging, font size, type, color, italics, margins, and background color. In this invention, users can bind cells to specific business data fields, such as customer name, order number, and amount. Furthermore, server-side parsable calculation formulas can be configured to enable dynamic data generation, such as automatic summation and formatted amounts, to meet data expression requirements in complex scenarios.

[0081] Regarding feature 4, this invention allows users to connect table components to extended data sets within the business system, such as detailed tables, sub-tables, or nested structures, enabling structured printing of batch data. This feature allows users to flexibly embed multi-row and multi-page data content within print templates, meeting the needs of personalized, high-density data printing. Typical applications include payment details and order item lists.

[0082] Regarding feature 5, in this invention, users can configure paging behavior for each table row type based on business needs. For example, the header can be set to print on every page, detailed data can be set to float, subtotals can be printed at the end of each page, and totals can be printed at the end of the page. The system supports differentiated rendering and paging control for these row types, achieving intelligent paging and precise typesetting, which is particularly suitable for complex document scenarios requiring paging statistics or large data printing.

[0083] Regarding feature 6, the present invention incorporates an extended query table control within the visual print template design interface to support structured printing of approval traces. This interface allows users to bind fields such as the node name, approval time, and approver in the approval flow to table rows and columns. Furthermore, users can drag the electronic signature field to a floating row cell. The server will then dynamically render the signature image when generating the PDF, ensuring the integrity and legal validity of the approval process. This feature is widely applicable to printing needs in business processes such as contract approval and expense reimbursement.

[0084] In one embodiment of the present invention, generating a corresponding PDF file according to the print request in step S101 specifically includes:

[0085] The table row type setting is parsed from the print template design information corresponding to the print template identifier, and then the paging presentation method of various table rows in the generated PDF file is controlled according to the setting of the table row type. The table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page.

[0086] In one embodiment of the present invention, the present invention supports setting the table row type in the table component, and the table row type is used to control the paging presentation method of different table rows during the printing process, so as to facilitate flexible adjustment of the table printing format to meet the needs of different scenarios.

[0087] In one embodiment of the present invention, specific application scenarios of each table row type can be seen in Table 1 below:

[0088] Table 1

[0089]

[0090] In one embodiment of the present invention, the specific application of single printing (table title) can be seen in Table 2 below:

[0091] Table 2

[0092]

[0093] In one embodiment of the present invention, the specific application of each page printing (header) can be seen in the following Table 3:

[0094] Table 3

[0095]

[0096] In one embodiment of the present invention, the specific application of the floating row (detailed data) can be seen in Table 4 below:

[0097] Table 4

[0098]

[0099] In one embodiment of the present invention, the specific application of the bottom line (subtotal) of each page can be seen in the following Table 5:

[0100] Table 5

[0101]

[0102] In one embodiment of the present invention, the specific application of last page printing (total) can be seen in Table 6 below:

[0103] Table 6

[0104]

[0105] In one embodiment of the present invention, the combined application of each table row type can be seen in Table 7 below:

[0106] Table 7

[0107]

[0108] Based on the proposed mechanism for setting multiple table row types, users can flexibly configure different types of data rows within a print template, such as single-shot printing, per-page printing, floating rows, last-row printing, and last-page printing, enabling refined control over the paging of table content. This mechanism enables the server to efficiently handle the paging and layout logic for large amounts of data when generating PDFs, significantly reducing memory usage and rendering pressure. This supports high-performance printing tasks exceeding 100,000 rows of data at a time, meeting the stability and efficiency requirements of enterprise-level systems in large-scale data output scenarios.

[0109] In one embodiment of the present invention, generating a corresponding PDF file according to the print request in step S101 specifically includes:

[0110] In the process of generating the PDF file, the text content in the cell is typeset based on a preset text adaptive typesetting algorithm.

[0111] like Figure 2 As shown, in one embodiment of the present invention, the text content in the cell is typeset based on a preset text adaptive typesetting algorithm, including step S201 and step S202.

[0112] Step S201, when automatic row height is not enabled, the text is preferentially folded and laid out according to the cell column width and the set fixed row height. If the text cannot be fully displayed after folding, the font size is automatically reduced by decreasing the font size until the text is fully displayed.

[0113] Step S201, when automatic row height is enabled, the text content is wrapped according to the column width, and the row height of the cell is dynamically calculated based on the number of rows after wrapping and the row spacing. The final height of each row takes the row height of the highest cell in the row as the benchmark row height.

[0114] In one embodiment of the present invention, to improve the layout accuracy and readability of printed output content, the server uses a text adaptive layout algorithm during PDF file generation to dynamically layout text content within cells. This algorithm adapts to different layout strategies depending on whether automatic row height settings are enabled.

[0115] When automatic row height is disabled, the text adaptation algorithm first performs a preliminary line break on the text content based on the cell's column width and fixed row height, ensuring that the text is displayed as closely as possible within the set row height. If the text still exceeds the cell boundaries after line break, the system automatically reduces the font size until the text fits completely within the cell. This approach ensures the integrity and visibility of the text within the fixed height constraint.

[0116] When automatic row height is enabled, an algorithm wraps text content based on the cell column width and dynamically calculates the required cell height based on the number of lines after the wrap and the set row spacing. The system compares the actual heights of all cells in the current row and uses the highest cell height as the final row height for the entire row. This ensures that all cells are aligned and avoids layout errors or visual irregularities.

[0117] This text adaptive typesetting algorithm effectively balances typesetting flexibility and content integrity. It is particularly suitable for printing scenarios where table fields have variable lengths and dynamically changing content, and can significantly improve the typesetting quality of output documents.

[0118] In one embodiment of the present invention, generating a corresponding PDF file according to the print request in step S101 specifically includes:

[0119] In the process of generating the PDF file, the calculation formula bound to the cell is parsed from the printing template design information corresponding to the printing template identifier, and the calculation formula is executed, and the formula calculation result is filled into the corresponding cell position to generate PDF content containing the formula calculation result.

[0120] In the present invention, during the process of generating a PDF file, the server parses the calculation formula bound to the specified cell position from the printing template design information. The formula may include field operations, format conversion, conditional judgment, string concatenation, etc., supports standard functions and custom expressions, and can meet the needs of various business data calculations and conversions. After completing the formula parsing, the server will execute the formula logic based on the business data corresponding to the current request to obtain the calculation result. The calculation process is uniformly handled on the server side, which can avoid front-end errors and ensure the stability of the printed results and data accuracy. The calculation results after execution will be dynamically filled into the corresponding template cells to form a visualized actual value.

[0121] In one embodiment of the present invention, generating a corresponding PDF file according to the print request in step S101 specifically includes:

[0122] In the process of generating the PDF file, the configuration content of the extended table component is parsed from the print template design information corresponding to the print template identifier, and the approval process track data is structured based on the configuration content, and the approval node information is rendered into the cell corresponding to the table component, wherein the configuration content includes the bound approval process track field and signature field. The signature field is bound to the floating row area of ​​the table and is used to display the electronic signature image of the operator of each approval node in the PDF file to fully present the approval process and signature information.

[0123] In one embodiment of the present invention, to meet the requirement of displaying the complete approval process when printing business documents, an extended table component is preset in the print template design information. This component supports binding fields related to the approval process track and electronic signature fields. When generating a PDF file, the server first parses the structure and field binding information of this component from the print template design information corresponding to the print template identifier. Then, based on the process track data associated with the corresponding document number in the business system, it performs structured processing according to the configuration and fills the information of each approval node (such as node name, approver, approval time, operation status, etc.) into the corresponding cell position in the table one by one.

[0124] The system supports binding signature fields to floating row areas within tables, ensuring that the signatory's electronic signature image for each approval node corresponds precisely to the node information and is accurately embedded in the printed page. The resulting PDF file fully displays the approval process in a structured table format, with all signature images automatically displayed under the corresponding approval node, ensuring legal validity and complete traceability when printed.

[0125] In one embodiment of the present invention, the above step S102 specifically converts the PDF file into a file stream format and returns it to the Web front end, and completes the print preview and print operations of the PDF file on the Web front end through the following steps:

[0126] (1) Receive the PDF file stream returned by the server and construct it into a Blob object that can be recognized by the browser for subsequent URL mapping;

[0127] (2) Call the URL.createObjectURL interface provided by the browser to generate a corresponding temporary access URL for the Blob object;

[0128] (3) Dynamically create an iframe tag in the current web page and set the temporary URL as the src attribute of the iframe tag;

[0129] (4) inserting the iframe tag into the DOM structure of the current page, so that the browser automatically loads and displays the content of the PDF file through its built-in PDF rendering engine;

[0130] (5) The user completes the printing operation of the PDF file through the printing interface provided by the browser itself, and the entire process does not require the installation of any plug-ins or third-party software.

[0131] In an optional embodiment of the present invention, the step S102 of converting the PDF file into a file stream format and returning it to the web front end, so that the web front end can print preview the PDF file through the native PDF preview function of the browser, and print the PDF file through the native print function of the browser, specifically includes:

[0132] The file stream and printing policy identifier of the PDF file are returned to the Web front-end, so that the Web front-end adopts the corresponding policy for print preview and printing according to the printing policy identifier, wherein the printing policy identifier includes: a first identifier for identifying the use of the browser's native PDF preview and printing functions and a second identifier for identifying the use of WebAssembly for PDF rendering and preview and the use of the browser's native printing function for printing; when the printing policy identifier is the first identifier, the Web front-end prints the PDF file through the browser's native PDF preview function and completes the printing of the PDF file through the browser's native printing function; when the printing policy identifier is the second identifier, the Web front-end loads a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the file stream of the PDF file, and render the decoded PDF content to a Canvas element or DOM container in the browser for preview, and completes printing through the browser's native printing function.

[0133] In one embodiment of the present invention, to adapt to different terminal operating environments and network conditions and improve the system's responsiveness and user experience in weak network environments or large-scale concurrent printing scenarios, after the server generates a PDF file, the present invention not only returns the file stream of the PDF file to the web front-end, but also simultaneously returns a printing policy identifier. This printing policy identifier is used to instruct the web front-end on how to preview and print the PDF.

[0134] The printing policy identifier may include the following two types: a first identifier: used to identify that the Web front-end adopts the browser's native PDF preview and printing functions; a second identifier: used to identify that the Web front-end enables a PDF rendering module based on WebAssembly technology to decode and preview PDF files, and print them out through the browser's native printing function.

[0135] In a specific embodiment, when the printing policy identifier is the first identifier, the Web front-end processes the received PDF file stream into a Blob object, and previews the PDF content through the PDF preview function embedded in the browser. The user can then directly click the print button built into the browser to complete printing.

[0136] When the printing policy is identified as the second identifier, the Web front-end loads a preset PDF rendering module built based on WebAssembly technology. This module can be built based on open source projects (such as the WASM version of pdf.js) and has the ability to parse, decode and render PDF content page by page in the browser. The rendering module receives the PDF file stream data (such as ArrayBuffer format) returned by the server, and after decoding, draws each page of PDF content in the Canvas element or HTML DOM container in the front-end page. The rendered content supports user interactive operations such as page jump, zoom, and drag. When printing, the user can directly print out the rendered view in the current page through the browser's web page printing function (for example, calling window.print()).

[0137] In a preferred embodiment, the PDF rendering module can also automatically adapt the paper size, margin settings and other layout information according to the rendered Canvas area to ensure that the final printing effect is consistent with the original PDF content, avoiding problems such as content cropping or proportional distortion.

[0138] Through this implementation, the system can select the optimal PDF preview and printing path according to different environmental conditions, which not only improves the overall processing performance, but also reduces server-side resource consumption. It has good scalability and practicality, and is especially suitable for complex application scenarios such as batch document output.

[0139] In one embodiment of the present invention, the plug-in-free document form printing processing method of the present invention further includes:

[0140] Acquire front-end operating environment indicator data collected by the Web front-end, wherein the front-end operating environment indicator data includes: network delay, downstream bandwidth, browser type, browser version, network type, memory size, and the number of print tasks queued by the current user;

[0141] The printing strategy is determined and the printing strategy identifier is generated based on the front-end operating environment indicator data and a preset printing strategy prediction model, wherein the printing strategy prediction model is obtained by training using a classification model based on training samples.

[0142] In one embodiment of the present invention, in order to dynamically select a printing strategy based on the operating environment, thereby improving the adaptability of the system under different terminal and network conditions, the plug-in-free document form printing processing method of the present invention further includes the following steps:

[0143] First, before initiating a print request, the web front-end executes the operating environment indicator collection module to monitor and collect key operating parameters of the current terminal, generating a set of operating environment indicator data. Specifically, this operating environment indicator data may include, but is not limited to, the following information: network latency, downlink bandwidth, network type, browser type and version, memory capacity, the number of queued print jobs for the current user, and the number of CPU cores.

[0144] After collecting these environmental indicators, the frontend sends this data in a structured format (such as JSON) to the server as input features for policy determination. Upon receiving this data, the server invokes a pre-defined printing policy prediction model to classify the current environment and generate a printing policy identifier.

[0145] In one embodiment of the present invention, the printing strategy prediction model can be constructed based on a supervised learning method, and the model can adopt a classification model such as a decision tree, random forest, logistic regression, support vector machine (SVM) or lightweight neural network.

[0146] In one embodiment of the present invention, the model training process includes the following steps:

[0147] 1. Data collection and sample construction: In the initial stage of actual system deployment, we collect operating environment indicators of multiple end users under different network environments, device configurations, and print task densities, as well as the strategies adopted by users to successfully complete printing, to form a labeled training sample set.

[0148] 2. Feature Engineering: Standardize, normalize, or one-hot encode the raw indicator data. For example, encode categorical data such as browser type to improve the model's discriminative ability.

[0149] 3. Model training: Based on the training samples, select an appropriate classification algorithm for training. For example, if the model requires interpretability, a CART decision tree can be used; if high accuracy is required, a random forest or neural network model can be used.

[0150] 4. Model validation and tuning: Use cross-validation or holdout methods to evaluate model accuracy, adjust unreasonable features or overfitting, and tune model parameters (such as tree depth and learning rate).

[0151] 5. Deployment and Online Updates: The trained model is deployed on the server, providing an interface for policy prediction services. During actual operation, the system continuously collects user feedback data for model retraining and performance updates.

[0152] By predicting printing strategies based on the operating environment, the system can select rendering methods on demand, reducing server-side pressure and improving end-user printing efficiency and experience. This is particularly suitable for use in weak network environments, mobile printing, or high-concurrency business systems. This policy prediction technology, with its intelligent judgment capabilities, is more effective than static configuration rules or fixed judgment conditions.

[0153] In an optional embodiment of the present invention, in the above-mentioned step S102, when the printing policy identifier is the second identifier, the Web front-end can load and run a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the compressed PDF data stream returned by the server, and render the decoded PDF content to the Canvas element or DOM container in the browser, and complete the printing through the browser's native printing function, wherein the rendering process supports page jump, zoom, drag and other operations.

[0154] In an optional embodiment of the present invention, in order to further improve the response efficiency of the system in large-scale concurrent printing or weak network environment, the plug-in-free document form printing processing method of the present invention can also introduce a WebAssembly-based client PDF rendering module to load, decode and display the original PDF content returned by the server on the browser side.

[0155] The specific implementation steps are as follows:

[0156] 1. The server generates a compressed PDF data stream: After receiving a print request from the web frontend, the server generates a standard PDF file. In this embodiment, the server can use tools such as iText and PDFBox to compress the generated PDF content, converting it into a lightweight binary data stream (such as a Uint8Array or ArrayBuffer format), and return it to the frontend as a response.

[0157] 2. Front-end loading of a WebAssembly PDF rendering module: The web front-end page pre-loads a PDF rendering module built on WebAssembly technology, such as the open source project [pdf.js + wasm compilation module], which is capable of decoding and rendering PDF files within the browser. This module integrates JavaScript with HTML5 Canvas to render PDF content directly into a Canvas element or DOM container on the page.

[0158] 3. Using WebAssembly for Local Rendering and Preview: After receiving the PDF data stream from the server, the client uses JavaScript to pass it to the WebAssembly module for parsing and decoding. The module renders the content page by page according to the paging structure, supporting basic operations such as page jumps, zooming, and dragging, achieving high-performance PDF preview without the need for plugins. Compared to iframe loading, WebAssembly rendering offers more flexible control capabilities, such as preloading specific pages and loading on demand.

[0159] 4. Browser-native printing integration: After rendering is complete, users can print the current rendered view using the browser's native print button. To ensure accurate output, the system automatically adjusts the rendered view to a standard size before printing and disables the non-printing area, ensuring the page layout remains consistent with the PDF file.

[0160] By moving some PDF rendering operations to the web frontend, this embodiment significantly reduces server-side CPU and memory load, particularly in scenarios with multiple users printing concurrently or loading large documents. Furthermore, front-end rendering enables simultaneous display while loading, reducing wait times and improving the user experience. This approach is also suitable for offline printing in unstable network environments, allowing the rendering module to be used in conjunction with cached PDF data.

[0161] The solution of the present invention is further described below with reference to a specific embodiment of printing a payroll business report.

[0162] In one embodiment of the present invention, for a typical payroll business bill printing scenario, the present invention adopts a plug-in-free document form printing processing method to realize a complete printing process including template visualization design, complex form typesetting, paging statistics, subtotal processing and approval process signature display.

[0163] Payroll reimbursement documents include three core information modules: basic reimbursement information (such as document number, submitter, and submission date), payment details (such as payee name and amount composition), and review records (such as approver, signature, and seal). To ensure the standardization and completeness of printouts, the system supports visually designing dedicated print templates. Users can freely arrange components such as tables, forms, and images in the web interface by dragging and dropping, creating personalized print styles.

[0164] Among them, the table component supports setting various table parameters such as row height, column width, background color, font style, border, alignment, etc., and supports cell merging and fine style configuration. Each cell can also be bound to a specific business field, or set a calculation formula executable by the server to achieve dynamic data filling and format conversion. The system further supports the configuration of extended data sets for displaying detailed table data, and allows users to divide printing logic by row type, including single printing, printing per page, floating rows, printing at the end of each page, and printing at the end of the page, to achieve paging control of complex structured data.

[0165] When displaying payment details, you can set the detailed data to display in floating rows, and configure a subtotal formula (such as PrintTablePageSum(...)) at the end of each page to automatically output the statistical results of the current page. A total row is also added to the last page to display the overall summary results. This mechanism effectively solves problems such as statistical interruptions and information omissions in paginated printing, significantly improving the readability and business adaptability of printed documents.

[0166] In the approval process display section, the system provides an expanded query table control that supports binding approval node data and signature fields. Users can drag and drop approval node fields (such as approver, approval time, and operation status) into the table, and bind the electronic signature field to the floating row area. When generating a PDF, the system automatically displays the approval process data in a structured manner and renders the operator's signature image in the corresponding position, providing a visual representation of the process's compliance and legal effectiveness.

[0167] After the user completes the template design, they can click the Print Preview button to trigger the printing process. The web front-end submits the identification information of the designed template to the server. The server generates the corresponding PDF file based on the print template design information and data resource identifier corresponding to the print template identifier, and returns it to the front-end in the form of a file stream. The front-end constructs a Blob object and generates a temporary URL, dynamically creates an iframe tag to embed the PDF file, and uses the browser's native PDF rendering capabilities to implement print preview. The end user can complete the printing operation through the browser's print function. The entire process does not require any plug-ins or additional extension components, and has good compatibility, security, and user experience.

[0168] As can be seen from the above embodiments, the plug-in-free document form printing processing method of the present invention achieves at least the following beneficial effects:

[0169] 1. Improved security: The present invention adopts a plug-in-free printing solution. The entire printing process is completed under the control of the browser's native functions and the server. This avoids the security vulnerabilities introduced by the installation of ActiveX controls and third-party plug-ins in traditional printing solutions, thereby effectively reducing system security risks and improving the overall system's credibility and operation and maintenance efficiency.

[0170] 2. Improve user experience: Through the visual print template design interface provided by the web front-end, users can quickly build the required print template by dragging and dropping. What you see is what you get. Without having to master complex typesetting languages ​​or configuration logic, users can complete the design of personalized print styles and achieve one-click printing, significantly improving the ease of use and interactive experience.

[0171] 3. Enhanced flexibility: This invention supports setting multiple table row types in the template (such as single printing, printing per page, floating rows, etc.), realizing fine control of paging logic, adapting to the needs of data paging display in different business scenarios, and meeting the differentiated needs of different users in format control.

[0172] 4. Improve compatibility: This invention builds a Web front-end interface based on HTML5 and Canvas technology. It does not need to rely on any specific browser plug-ins or operating system components. It can run stably in all mainstream browsers and cross-platform environments, effectively improving the compatibility and deployable range of the system.

[0173] 5. Flexible expansion and personalized customization: The printing control in the system supports modular design. Users can freely combine and configure functional components such as forms, tables, signatures, etc. according to actual business needs; it also supports binding with business fields, formulas or extended data sets to achieve highly customized data printing capabilities, with good scalability and maintainability.

[0174] 6. Suitable for complex and enterprise-level scenarios: This invention centrally processes printing logic on the server side to achieve unified typesetting rendering and PDF output, ensuring the stability and professionalism of the printing results; it is particularly suitable for complex application scenarios in enterprise-level systems that require processing diversified templates, multi-data source integration, large-scale data printing, etc.

[0175] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0176] Based on the same inventive concept, an embodiment of the present invention also provides a plug-in-free document form printing and processing device, which can be used to implement the plug-in-free document form printing and processing method described in the above embodiment, as described in the following embodiment. Since the principle of solving the problem of the plug-in-free document form printing and processing device is similar to that of the plug-in-free document form printing and processing method, the embodiment of the plug-in-free document form printing and processing device can refer to the embodiment of the plug-in-free document form printing and processing method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements the predetermined function. Although the device described in the following embodiment is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0177] It should be noted that the plug-in-free document form printing and processing device of the present invention is applied to the server end, that is, the plug-in-free document form printing and processing device of the present invention is set in the server end.

[0178] Figure 5 This is a structural block diagram of a plug-in-free document form printing and processing device according to an embodiment of the present invention. Figure 5 As shown, in one embodiment of the present invention, the plug-in-free document form printing and processing device of the present invention includes:

[0179] A PDF file generating unit 1 is configured to, upon receiving a print request sent by a Web front end, generate a corresponding PDF file according to the print request, wherein the print request includes a print template identifier and a data resource identifier. In the process of generating the PDF file, a table row type setting is parsed from print template design information corresponding to the print template identifier, and then, based on the table row type setting, a paging presentation mode of each type of table row in the generated PDF file is controlled, and text content in a cell is typeset based on a preset text adaptive typesetting algorithm. The table row types include: single printing, per-page printing, floating row, last-row printing, and last-page printing.

[0180] The file stream sending unit 2 is used to convert the PDF file into a file stream format and return it to the Web front end, so that the Web front end can print preview the PDF file through the browser's native PDF preview function and complete the printing of the PDF file through the browser's native print function.

[0181] In one embodiment of the present invention, the file stream sending unit 2 is specifically used to: return the file stream and printing policy identifier of the PDF file to the Web front-end, so that the Web front-end adopts the corresponding policy for print preview and printing according to the printing policy identifier, wherein the printing policy identifier includes: a first identifier for identifying the use of the browser's native PDF preview and printing functions and a second identifier for identifying the use of WebAssembly for PDF rendering and preview and the use of the browser's native printing function for printing; when the printing policy identifier is the first identifier, the Web front-end prints the PDF file through the browser's native PDF preview function and completes the printing of the PDF file through the browser's native printing function; when the printing policy identifier is the second identifier, the Web front-end loads a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the file stream of the PDF file, and render the decoded PDF content to a Canvas element or DOM container in the browser for preview, and completes printing through the browser's native printing function.

[0182] In one embodiment of the present invention, the plug-in-free document form printing and processing device further includes:

[0183] A front-end operating environment indicator data acquisition unit, configured to acquire the front-end operating environment indicator data collected by the Web front-end, wherein the front-end operating environment indicator data includes: network latency, downlink bandwidth, browser type, browser version, network type, memory size, and the number of print tasks currently queued by the user;

[0184] The printing strategy identifier generating unit is used to determine the printing strategy and generate the printing strategy identifier according to the front-end operating environment indicator data and a preset printing strategy prediction model, wherein the printing strategy prediction model is obtained by training using a classification model based on training samples.

[0185] In one embodiment of the present invention, the PDF file generating unit 1 includes:

[0186] The first processing module is used to, when automatic row height is not enabled, give priority to folding and typesetting the text according to the column width of the cell and the set fixed row height. If the text cannot be fully displayed after folding, the font size is automatically reduced by decreasing the font size until the text is fully displayed. When automatic row height is enabled, the text content is folded according to the column width, and the row height of the cell is dynamically calculated based on the number of rows after folding and the row spacing. The final height of each row takes the row height of the highest cell in the row as the base row height.

[0187] In one embodiment of the present invention, the PDF file generating unit 1 includes:

[0188] The second processing module is used to parse the calculation formula bound to the cell from the printing template design information corresponding to the printing template identifier during the process of generating the PDF file, execute the calculation formula, and fill the formula calculation result into the corresponding cell position to generate PDF content containing the formula calculation result.

[0189] In one embodiment of the present invention, the PDF file generating unit 1 includes:

[0190] The third processing module is used to parse the configuration content of the extended table component from the print template design information corresponding to the print template identifier in the process of generating the PDF file, and perform structured processing on the approval process track data based on the configuration content, and render the approval node information into the cell corresponding to the table component, wherein the configuration content includes the bound approval process track field and signature field, and the signature field is bound to the floating row area of ​​the table, and is used to display the electronic signature image of the operator of each approval node in the PDF file to fully present the approval process and signature information.

[0191] In one embodiment of the present invention, when the Web front-end receives the file stream of the PDF file, it dynamically generates an iframe tag in the browser page, and embeds the file stream into the iframe tag for loading, so as to call the browser's native PDF preview function to complete the print preview of the PDF file.

[0192] In one embodiment of the present invention, the plug-in-free document form printing and processing device of the present invention further includes:

[0193] The visual printing template design interface display unit is used to display a preset visual printing template design interface to the user through the Web front end, and then convert the printing template designed by the user on the visual printing template design interface into structured printing template design information, and generate a printing template identifier corresponding to the printing template design information.

[0194] In one embodiment of the present invention, the functions implemented by the visual print template design interface include:

[0195] Supports users to layout multiple component elements by dragging and dropping through a graphical interface, including form components, table components, and image components;

[0196] Supports configuration of multiple table design parameters, including row height, column width, background color, border, alignment, and font style;

[0197] Supports setting cells and binding cells to business fields or calculation formulas executed by the server;

[0198] Supporting the table component to be connected to an extended data set to meet personalized table data printing needs;

[0199] Supports setting the table row type in the table component. The table row type is used to control the paging presentation mode of different table rows during printing. The table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page;

[0200] Supports configuring table components to display approval process trajectory data, and supports binding approval node fields and signature fields to corresponding cells. Among them, the signature field is bound to the floating row area to display the electronic signature image of the approval node operator when printing, so as to fully display the approval process and signature information.

[0201] In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. Figure 6 As shown, the computer device includes a memory, a processor, a communication interface and a communication bus. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, the steps in the above embodiment method are implemented.

[0202] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0203] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in memory to perform various processor functions and work data processing, thereby implementing the methods in the above-described method embodiments.

[0204] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0205] The one or more units are stored in the memory, and when executed by the processor, perform the method in the above embodiment.

[0206] The specific details of the above-mentioned computer device can be understood by referring to the corresponding descriptions and effects in the above-mentioned embodiments, and will not be repeated here.

[0207] To achieve the above objectives, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, which, when executed in a computer processor, implements the steps of the above-mentioned plug-in-free document form printing processing method. Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the storage medium can also include a combination of the above-mentioned types of memory.

[0208] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is further provided, including a computer program / instruction, which implements the steps of the above-mentioned plug-in-free document form printing processing method when executed by a processor.

[0209] Obviously, those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0210] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A plug-in-free document form printing and processing method, characterized in that: The method is applied to the server, and includes: Upon receiving a print request sent by a Web front-end, a corresponding PDF file is generated according to the print request, wherein the print request includes: a print template identifier and a data resource identifier; wherein, in the process of generating the PDF file, a table row type setting is parsed from the print template design information corresponding to the print template identifier; and then, according to the table row type setting, a paging presentation mode of each type of table row in the generated PDF file is controlled, and text content in a cell is typeset based on a preset text adaptive typesetting algorithm; the table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page; Convert the PDF file into a file stream format and return it to the web front-end, so that the web front-end can print the PDF file through the native PDF preview function of the browser and print the PDF file through the native print function of the browser; The converting the PDF file into a file stream format and returning it to the web front end, so that the web front end can print preview the PDF file through the native PDF preview function of the browser, and print the PDF file through the native print function of the browser, includes: The file stream and printing policy identifier of the PDF file are returned to the Web front-end, so that the Web front-end adopts the corresponding policy for print preview and printing according to the printing policy identifier, wherein the printing policy identifier includes: a first identifier for identifying the use of the browser's native PDF preview and printing functions and a second identifier for identifying the use of WebAssembly for PDF rendering and preview and the use of the browser's native printing function for printing; when the printing policy identifier is the first identifier, the Web front-end prints the PDF file through the browser's native PDF preview function and completes the printing of the PDF file through the browser's native printing function; when the printing policy identifier is the second identifier, the Web front-end loads a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the file stream of the PDF file, and render the decoded PDF content to a Canvas element or DOM container in the browser for preview, and completes printing through the browser's native printing function.

2. The plug-in-free document form printing and processing method according to claim 1, characterized in that: Also includes: Acquire front-end operating environment indicator data collected by the Web front-end, wherein the front-end operating environment indicator data includes: network delay, downstream bandwidth, browser type, browser version, network type, memory size, and the number of print tasks queued by the current user; The printing strategy is determined and the printing strategy identifier is generated based on the front-end operating environment indicator data and a preset printing strategy prediction model, wherein the printing strategy prediction model is obtained by training using a classification model based on training samples.

3. The plug-in-free document form printing processing method according to claim 1, characterized in that: The text content in the cell is typeset based on a preset text adaptive typesetting algorithm, including: When automatic row height is not enabled, the text is first wrapped and laid out based on the cell column width and the set fixed row height. If the text cannot be fully displayed after wrapping, the font size is automatically reduced by decreasing the font size until the text is fully displayed. When automatic row height is enabled, the text content is wrapped according to the column width, and the row height of the cell is dynamically calculated based on the number of rows after wrapping and the row spacing. The final height of each row takes the row height of the highest cell in the row as the base row height.

4. The plug-in-free document form printing and processing method according to claim 1, characterized in that: Generating a corresponding PDF file according to the print request includes: In the process of generating the PDF file, the calculation formula bound to the cell is parsed from the printing template design information corresponding to the printing template identifier, and the calculation formula is executed, and the formula calculation result is filled into the corresponding cell position to generate PDF content containing the formula calculation result.

5. The plug-in-free document form printing processing method according to claim 1, characterized in that: Generating a corresponding PDF file according to the print request includes: In the process of generating the PDF file, the configuration content of the extended table component is parsed from the print template design information corresponding to the print template identifier, and the approval process track data is structured based on the configuration content, and the approval node information is rendered into the cell corresponding to the table component, wherein the configuration content includes the bound approval process track field and signature field. The signature field is bound to the floating row area of ​​the table and is used to display the electronic signature image of the operator of each approval node in the PDF file to fully present the approval process and signature information.

6. The plug-in-free document form printing and processing method according to claim 1, characterized in that: When the web front end receives the file stream of the PDF file, it dynamically generates an iframe tag in the browser page, and embeds the file stream into the iframe tag for loading, so as to call the browser's native PDF preview function to complete the print preview of the PDF file.

7. The plug-in-free document form printing and processing method according to claim 1, characterized in that: Also includes: A preset visual printing template design interface is displayed to the user through the Web front end, and the printing template designed by the user on the visual printing template design interface is converted into structured printing template design information, and a printing template identifier corresponding to the printing template design information is generated.

8. The plug-in-free document form printing processing method according to claim 7, characterized in that: The functions implemented by the visual printing template design interface include: Supports users to layout multiple component elements by dragging and dropping through a graphical interface, including form components, table components, and image components; Supports configuration of multiple table design parameters, including row height, column width, background color, border, alignment, and font style; Supports setting cells and binding cells to business fields or calculation formulas executed by the server; Supporting the table component to be connected to an extended data set to meet personalized table data printing needs; Supports setting the table row type in the table component. The table row type is used to control the paging presentation mode of different table rows during printing. The table row types include: single printing, printing per page, floating row, printing at the end of each page, and printing at the end of the page; Supports configuring table components to display approval process trajectory data, and supports binding approval node fields and signature fields to corresponding cells. Among them, the signature field is bound to the floating row area to display the electronic signature image of the approval node operator when printing, so as to fully display the approval process and signature information.

9. A plug-in-free document form printing and processing device, characterized in that: The device is applied to a server, and includes: A PDF file generation unit, configured to, upon receiving a print request sent by a Web front end, generate a corresponding PDF file according to the print request, wherein the print request includes a print template identifier and a data resource identifier; wherein, in the process of generating the PDF file, a table row type setting is parsed from the print template design information corresponding to the print template identifier; and then, based on the table row type setting, a paging presentation mode of each type of table row in the generated PDF file is controlled, and text content in a cell is typeset based on a preset text adaptive typesetting algorithm; the table row types include: single printing, per-page printing, floating row, last-row printing, and last-page printing; A file stream sending unit, configured to convert the PDF file into a file stream format and return it to the Web front end, so that the Web front end can print preview the PDF file through the browser's native PDF preview function and print the PDF file through the browser's native print function; The file stream sending unit is specifically used to: return the file stream and printing policy identifier of the PDF file to the Web front-end, so that the Web front-end adopts the corresponding policy for print preview and printing according to the printing policy identifier, wherein the printing policy identifier includes: a first identifier for identifying the use of the browser's native PDF preview and printing functions and a second identifier for identifying the use of WebAssembly for PDF rendering and preview and the use of the browser's native printing function for printing; when the printing policy identifier is the first identifier, the Web front-end prints the PDF file through the browser's native PDF preview function and completes the printing of the PDF file through the browser's native printing function; when the printing policy identifier is the second identifier, the Web front-end loads a PDF rendering module based on WebAssembly technology, and the PDF rendering module is used to parse the file stream of the PDF file, and render the decoded PDF content to a Canvas element or DOM container in the browser for preview, and completes printing through the browser's native printing function.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method and system for realizing Web end self-defined format printing on basis of B / S framework

    CN107463348A

  • Method and device for printing table data based on line printing style

    CN112230870A

  • File printing method and device, electronic equipment and computer readable medium

    CN114721609A