Method for dynamically changing pages of ofd document table

By automatically calculating cell height and using a row splitting algorithm, the problems of static layout and page breakage in OFD table generation are solved, enabling accurate page layout and efficient processing of dynamic tables.

CN121683706APending Publication Date: 2026-03-17YUNNAN PROVINCIAL BIG DATA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing OFD table generation technology suffers from static layouts that cannot adapt to dynamic content, page breaks that cause content truncation or formatting errors, and low adjustment efficiency.

Method used

By automatically calculating cell content height based on font metrics and using a row splitting algorithm to avoid content truncation, OFD files conforming to the GB/T 33190-2016 standard are directly output, achieving accurate cross-page layout of table content.

Benefits of technology

It enables dynamic adjustment of table row height, solves the problems of content truncation and formatting errors in cross-page tables, improves processing efficiency and quality, and reduces the workload and error rate of manual adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121683706A_ABST
    Figure CN121683706A_ABST
Patent Text Reader

Abstract

The invention relates to a method for dynamically changing pages of an ofd document table, and belongs to the technical field of electronic document processing. The method comprises the following steps: S1, performing paging processing on single table data to form multi-page table data; s2, paging the multi-page table data according to the table template to generate a doc document; and S3, converting the doc document into an ofd layout file. According to the method, the cell content height is automatically calculated based on font measurement, content truncation is avoided through a line splitting algorithm, Word conversion is bypassed, and an OFD file meeting the GB / T 33190-2016 standard is directly output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for dynamic page turning of tables in OFD documents, belonging to the field of electronic document processing technology. Background Technology

[0002] Existing OFD form generation technology has the following drawbacks: 1. Static layout: Traditional methods require presetting table row heights and cannot adapt to dynamic content; 2. Page breaks: When table rows span multiple pages, content may be truncated or formatting may be incorrect. 3. Inefficient: Manually adjusting cross-page tables requires repeated trial and error, which is time-consuming and prone to errors.

[0003] There is an urgent need for a method to generate OFD documents with dynamically wrappable tables, so as to achieve accurate cross-page layout of table content. Summary of the Invention

[0004] To address the shortcomings of existing technologies in supporting dynamic tables in OFD electronic certificate files, this invention provides a method for dynamic page breaks in OFD document tables. This invention automatically calculates cell content height based on font measurements, avoids content truncation through row splitting algorithms, bypasses Word conversion, and directly outputs OFD files conforming to the GB / T 33190-2016 standard.

[0005] The technical solution of this invention is: a method for dynamic page turning in an OFD document table, the method comprising: S1. Paginate single table data into multiple pages of table data; S2. Generate a doc document from multi-page table data based on the table template; S3. Convert the doc document into an ofd format file.

[0006] Further, S1 includes: S1.1 Initialization Configuration: Configure the number of characters per column and row, the number of pixels per page, the pixel height of each line of text, the additional pixel height of each line, and a flag for whether to split the first two columns; these configurations are set by reading the global configuration file and support both normal and special configuration modes; S1.2 Character width calculation: The calWordWidth method is used to calculate the display width of a character based on its Unicode value. The calStringWidth method is used to calculate the display width of the entire string, which is achieved by accumulating the width of each character. S13, Row Count Calculation: The getColXXRows family of methods is used to calculate the number of rows that the string needs to occupy in the specified column based on the character width of each column and the total width of the string; S1.4, Row Height Calculation: The row height is calculated using the rowHeightInPixel and rowHeightInPixelCol0 methods based on the number of rows and the pixel height of each line of text, with an additional scaling factor applied to the row height of the first column; Use the pixelToRow and pixelToRow0 methods to deduce the corresponding row number based on the given pixel height; S1.5, Cell Processing: Use the getCellText method to process rich text formatted strings and convert them to plain text; Use the getRowCount method to calculate the number of lines of text in the cell based on the column index and the string content; S1.6, Table Data Conversion: Use the processToCell method to convert tabular data in String[][] format into a List. <List <cell>The format specifies that each Cell object contains text content, number of text lines, and text height information. S1.7 Height Adjustment and Merged Cell Handling: The processHeight method first calculates the text height and actual height of each cell, taking into account the case of merged cells; Then, the logic for merging cells is handled to ensure that the merged cells have the same height, and the height of adjacent cells is adjusted to avoid layout errors. S1.8, Pagination Processing: The tableAndRest method is used to divide the table data into multiple tables that can be fully displayed on a single page, based on the pixel height limit of each page. During the splitting process, if it is found that the content of a certain row exceeds the limit of one page, the first two columns will be split according to the configuration, and the layout of the remaining content will be adjusted accordingly. S1.9 Obtain the final multi-page table data: The `getDisplayTables` method is used as the class entry point. It receives table data in String[][] format, processes it step by step by calling the methods mentioned above, and finally returns a List. <List<List <cell>>> A data structure in the format of >>, where each internal List <List <cell>> Represents a complete page table.

[0007] Furthermore, S1 also includes: When calculating the height of a cell row to determine the content of a page, the following factors need to be considered: 1. Different columns have different cell heights; 2. If a column has merged cells, the actual height and the calculated height may differ. The appropriate calculated height should be selected as the height of the cell row. The data structure of each cell is Cell { text / / text content; textRowCount / / Number of text lines; mergeCount / / The number of rows to be merged; it is 1 for a single row and 0 for a row being merged. textHeight / / Cell text height; cellHeight / / The height of the processed cell; it is 0 if the cells are merged. } The specific steps are as follows: 1) Convert the two-dimensional table data String[][] to List <List <cell>> rows, sets the text for each cell. 2) Create a variable List <List<List <cell>>> pageList; 3) Loop through the rows and the data; 3.1 Handle the actual height; 3.2 Call tableAndRest to retrieve one page of form data and other data; Based on the cellHeight accumulated to the configured height of each page, retrieve the data for each page. If it is necessary to split a certain cell row, split it according to the textRowCount. 3.3 Add the obtained form page to the processed pages list; 3.4 Loop through the remaining data as rows back to step 2); The specific implementation steps of section 3.1 are as follows: 1) Calculate the text line count (textRowCount), which is the number of characters per line divided by the number of characters that a line in this configuration column can hold; 2) Calculate the text height (textHeight): the configured text height per line * the number of text lines (textRowCount) + the configured cell height. 3) The merging of multiple lines in a column is identified by the similarity of the text; If you need to merge a column by looping through the column from top to bottom, calculate mergeCount; 4) Take the maximum value of the textHeight of the non-merged columns as the cellHeight of the non-merged columns; 5) Adjust the height of the merged column; 5.1 If mergeCount is 0, the height of the merged column is 0 (cellHeight). 5.2 If mergeCount is not 0; 5.2.1 Calculate the cell text height as height_a; 5.2.2 The total cellHeight of all non-merged columns is height_b; 5.2.3 If height_b >= height_a, the height of the merged column is height_b; 5.2.4 If height_b < height_a, the height of the merged column is height_a; And add the height_a - height_b height to the cellHeight of the last row of the non-merged column.

[0008] Further, S2 includes: S2.1, Create the initial document object: Create an XWPFDocument object from the input stream, representing a Word document; S2.2, Get Table Template: Get the first table in the document as the table template; S2.3, Prepare table data: Retrieve the original table data; Create a CapTableDataProcess object to process the raw tabular data; Convert the original tabular data into a three-dimensional list structure suitable for display; S2.4. Create a multi-page table: Starting with the second table, add page breaks to each table; Create a new table and copy the style and structure of the table template; Copy the table content and attributes; S2.5, Configure filling parameters: Get the cell inner margin configuration based on the isSpecial parameter; S2.6, Fill in the table data: Iterate through all tables in the document; create a new row for each table and populate it with data; add borders to all tables; S2.7 Merging Cells: Iterate through all tables and use the PoiDocTool.tableMerge method to merge cells with the same content; S2.8 Output Document: Write the processed document to the output stream.

[0009] The present invention also provides an OFD document table dynamic page-turning system, the system comprising: a module for executing the aforementioned OFD document table dynamic page-turning method.

[0010] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for dynamic page turning of an OFD document table.

[0011] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for dynamic page turning of an OFD document table.

[0012] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for dynamic page turning of an OFD document table.

[0013] The beneficial effects of this invention are: 1. Dynamic Row Height Calculation: By automatically calculating the cell content height based on font metrics, this invention achieves dynamic adjustment of table row height. This significantly improves the flexibility and adaptability of table layout, enabling the table to automatically adjust row height according to actual content, avoiding the layout inaccuracies caused by pre-setting row height in traditional methods. Specifically, the width of Chinese characters is uniformly set to 1, and the width of Western characters is set to 0.5. The display width of characters and strings is accurately calculated using the calWordWidth and calStringWidth methods, ensuring the accuracy of row height calculation. 2. Intelligent cross-page processing effect: The solution of this invention effectively solves the problems of content truncation and format disorder when table rows cross pages through a row splitting algorithm; when the table content exceeds the display range of a single page, the system can automatically identify and decide whether to split the first two columns according to the configuration, while adjusting the layout of the remaining content to ensure the continuity and readability of the cross-page table; this effect greatly improves the processing efficiency and quality of cross-page tables, and reduces the workload and error rate of manual adjustment; 3. System Integration and Scalability: The solution of this invention has good system integration and scalability. Through a modular design approach, the system independently implements and integrates various functional modules (such as character width calculation, line count calculation, line height calculation, etc.) to form a complete technical solution. At the same time, the system also supports setting initialization parameters by reading the global configuration file, further enhancing the system's flexibility and configurability. This design allows the technical solution to be easily integrated into existing electronic document processing systems and expanded and optimized according to actual needs. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the process in this invention; Figure 2 This is a screenshot of the interface data certified in an embodiment of the present invention; Figure 3 This is a schematic diagram of a table template in an embodiment of the present invention; Figure 4 The image shows the first two pages of the final processed file in this embodiment of the invention. Detailed Implementation

[0015] Example 1: This example uses the generation of a qualification certificate for a construction engineering quality testing agency as an example. The interface data for this certificate is as follows: Figure 2 As shown, the table summary is as follows: [ ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Cement", "Setting Time, Soundness, Mortar Strength, Chloride Ion Content", "Water Retention Rate, Magnesium Oxide Content, Alkali Content", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Reinforcing Steel (including welding and mechanical connections)", "Yield Strength, Tensile Strength, Elongation After Fracture, Total Elongation at Maximum Force, Reverse Bending, Weight Deviation, Residual Deformation", "Bending Performance", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Aggregates", "Particle size distribution, mud content, mud lump content, methylene blue value and stone powder content (manufactured sand), crushing index (manufactured sand), chloride ion content, particle size distribution, mud content, mud lump content, crushing value index, needle-like and flaky particle content", "Apparent density, water absorption, soundness, alkali reactivity, light matter content, organic matter content, shell content, soundness, alkali reactivity, apparent density, bulk density, porosity", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Bricks, Blocks, Tiles, Wall Panels", "Compressive Strength, Flexural Strength", "Dry Density, Water Absorption, Impermeability, Bending Performance (or Load Capacity), Resistance to Rapid Temperature Changes, Impact Resistance, Bending Failure Load, Hanging Force, Frost Resistance", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Concrete and Mixing Water", "Compressive Strength, Impermeability Grade, Slump, Chloride Ion Content, Mixing Water (Chloride Ion Content)", "Limited Expansion Rate, Freeze-Thaw Resistance, Apparent Density, Air Content, Setting Time, Flexural Strength, Splitting Tensile Strength, Static Compressive Modulus of Elasticity, Alkali Content, Mix Design, Mixing Water (pH Value, Sulfate Ion Content, Insoluble Matter Content, Soluble Matter Content)", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Concrete Admixtures", "Water Reduction Rate, pH Value, Density (or Fineness), Compressive Strength Ratio, Setting Time (Difference), Air Content, Solid Content (or Moisture Content), Restricted Expansion Rate, Bleeding Rate Ratio, Chloride Ion Content", "Relative Durability Indicators, Air Content Change Over 1 Hour (Slump, Air Content), Sodium Sulfate Content, Shrinkage Ratio, Alkali Content", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Concrete Admixtures", "Fineness, Loss on Ignition, Water Requirement Ratio, Specific Surface Area, Activity Index, Flowability Ratio, Chloride Ion Content", "Moisture Content, Sulfur Trioxide Content, Radioactivity", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Mortar", "Compressive Strength, Consistency, Water Retention Rate, Tensile Bond Strength (Plastering, Masonry)", "Segregation, Mix Design, Setting Time, Impermeability",""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Soil", "Maximum Dry Density, Optimal Moisture Content, Compaction Coefficient", " / ", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Waterproof Materials and Waterproof Sealing Materials", "Soluble Content, Tensile Strength, Elongation (or Elongation at Maximum Force), Low-Temperature Flexibility, Low-Temperature Flexibility after Heat Aging, Impermeability, Heat Resistance, Tensile Strength at Break, Elongation at Break, Tear Strength, Solid Content, Tensile Strength, Heat Resistance, Low-Temperature Flexibility, Impermeability, Elongation at Break", "Coating Impermeability, Tensile Strength after 168h Immersion in Water, Elongation at Break after 168h Immersion in Water, Water Resistance, Compressive Strength, Flexural Strength, Bond Strength, Impermeability, Heat Resistance, Low-Temperature Flexibility, Tensile Bond Strength, Workability, Surface Drying Time, Extrudability, Elastic Recovery Rate, Bond Strength at a Fixed Elongation after Immersion in Water, Mass per Unit Area, Solid Content, 7d Bond Strength, 7d Impermeability, Tensile Modulus, Bond Strength at a Fixed Elongation", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Ceramic Tiles and Stone", "Water Absorption and Bending Strength", "Frost Resistance (Freeze-Thaw Resistance)", ""], ["1", "No. 4, X Road, X District, X City, X Province", "1", "Building Materials and Components", "Plastic and Metal Pipes"," / ", "Hydrostatic Strength, Drop Weight Impact Test, Appearance Quality, Cross-sectional Dimensions, Longitudinal Shrinkage Rate, Crosslinking Degree, Melting Temperature, Simply Supported Beam Impact Test, Tensile Yield Stress, Density, Burst Pressure, Pipe Ring Peel Force, Melt Flow Rate, Vicat Softening Temperature, Heat Deflection Temperature, Tensile Modulus of Elasticity, Tensile Strength, Oven Test", ""] ] This embodiment provides a method for dynamic pagination of tables in OFD documents, the flowchart of which is shown below. Figure 1 As shown, the specific steps of the method are as follows: S1. Process single-page table data into multi-page table data; this step involves converting two-dimensional table data in String[][] format into a List. <List<List <cell>>> A data structure in the format of >>, where each internal List <List <cell>> represents a table that can be fully displayed on a single page.

[0016] S1.1 Initialization Configuration: Configure the number of characters that each column and row can hold (taking into account the width difference between Chinese and Western characters), the number of pixels per page, the pixel height of each line of text, the additional pixel height of the line, and a flag for whether to split the first two columns; these configurations are set by reading the global configuration file and support both normal and special configuration modes; S1.2 Character width calculation: The calWordWidth method is used to calculate the display width of a character based on its Unicode value. The width of Chinese characters is 1, and the width of Western characters is 0.5. The calStringWidth method is used to calculate the display width of the entire string, which is achieved by accumulating the width of each character. S13, Row Count Calculation: Use the getColXXRows family of methods (such as getCol00Rows) to calculate the number of rows that the string needs to occupy in the specified column based on the character width of each column and the total width of the string; S1.4, Row Height Calculation: The row height is calculated using the rowHeightInPixel and rowHeightInPixelCol0 methods based on the number of rows and the pixel height of each line of text, with an additional scaling factor (1.25x) applied to the row height of the first column. Use the pixelToRow and pixelToRow0 methods to deduce the corresponding row number based on the given pixel height; S1.5, Cell Processing: Use the getCellText method to process rich text formatted strings and convert them to plain text; Use the getRowCount method to calculate the number of lines of text in the cell based on the column index and the string content; S1.6, Table Data Conversion: Use the processToCell method to convert tabular data in String[][] format into a List. <List <cell>The format specifies that each Cell object contains text content, number of text lines, and text height information. S1.7 Height Adjustment and Merged Cell Handling: The processHeight method first calculates the text height and actual height of each cell, taking into account the case of merged cells; Then, the logic for merging cells is handled to ensure that the merged cells have the same height, and the height of adjacent cells is adjusted to avoid layout errors. S1.8, Pagination Processing: The tableAndRest method is used to divide the table data into multiple tables that can be fully displayed on a single page, based on the pixel height limit of each page. During the splitting process, if it is found that the content of a certain row exceeds the limit of one page, the first two columns will be split according to the configuration, and the layout of the remaining content will be adjusted accordingly. S1.9 Obtain the final multi-page table data: The `getDisplayTables` method is used as the class entry point. It receives table data in String[][] format, processes it step by step by calling the methods mentioned above, and finally returns a List. <List<List <cell>>> A data structure in the format of >>, where each internal List <List <cell>> Represents a complete page table.

[0017] Furthermore, S1 also includes: When calculating the height of a cell row to determine the content of a page, the following factors need to be considered: 1. Different columns have different cell heights; 2. If a column has merged cells, the actual height and the calculated height may differ. The appropriate calculated height should be selected as the height of the cell row. The data structure of each cell is Cell { text / / text content; textRowCount / / Number of text lines; mergeCount / / The number of rows to be merged; it is 1 for a single row and 0 for a row being merged. textHeight / / Cell text height; cellHeight / / The height of the processed cell; it is 0 if the cells are merged. } The specific steps are as follows: 1) Convert the two-dimensional table data String[][] to List <List <cell>> rows, sets the text for each cell. 2) Create a variable List <List<List <cell>>> pageList; 3) Loop according to rows and data; 3.1 Process real height; 3.2 Call tableAndRest to get a page table and other data; According to the cellHeight of Cell, accumulate to the configured height of each page, get the data of each page, if need to split a cell row, according to the textRowCount to split; 3.3 Add the obtained page table to the processed page pageList; 3.4 Loop the remaining data as rows to step 2); The specific implementation steps of 3.1 are: 1) Calculate the textRowCount, the number of characters per line / the number of characters that can be accommodated in a row of this column configured; 2) Calculate the textHeight, the configured height of each line of text * the textRowCount + the height of the cell provided by the configuration; 3) The multi-line merging of a column is identified by the same text; If you need to merge a column from top to bottom, calculate the mergeCount; 4) Take the maximum value of textHeight of non-merged columns as the cellHeight of non-merged columns; 5) Process the height of the merged column; 5.1 If mergeCount is 0, the height of the merged column cellHeight is 0; 5.2 If mergeCount is not 0; 5.2.1 Calculate the cell text height textHeight as height_a; 5.2.2 Calculate the total cellHeight of non-merged columns as height_b; 5.2.3 If height_b >= height_a, the height of the merged column is height_b; 5.2.4 If height_b < height_a, the height of the merged column is height_a; And add the height of height_a - height_b to the cellHeight of the last row of non-merged columns.

[0018] S2. Generate a doc document from multi-page table data based on the table template; S2.1, Create the initial document object: Create an XWPFDocument object from the input stream, representing a Word document; S2.2, Obtain Table Template: Obtain the first table in the document as the table template; the obtained table template is as follows: Figure 3 As shown; S2.3, Prepare table data: Retrieve the raw table data (a two-dimensional string array); Create a CapTableDataProcess object to process the raw tabular data; Convert the original tabular data into a three-dimensional list structure (tables) suitable for display; S2.4. Create a multi-page table: Starting with the second table, add page breaks to each table; Create a new table and copy the style and structure of the table template; Copy the table content and attributes; S2.5, Configure filling parameters: Get the cell inner margin configuration based on the isSpecial parameter; S2.6, Fill in the table data: Iterate through all tables in the document; create a new row for each table and populate it with data; add blue borders to all tables; S2.7 Merging Cells: Iterate through all tables and use the PoiDocTool.tableMerge method to merge cells with the same content; S2.8 Output Document: Write the processed document to the output stream.

[0019] S3. Convert the doc document to an OFD format file. This step is relatively simple and directly uses existing technology to achieve file format conversion, generally using WPS or a file conversion service like Shuke. The first two pages of the final processed file in this embodiment are as follows: Figure 4 As shown, from the final generated Figure 4 As can be seen, based on the configured page content height and text height, inputting table data can create a dynamic table in the OFD document; this dynamic table includes the following features: 1. The table uses adaptive pagination, and each page of the table has its own header; 2. Vertically aligned cells with the same content will be merged and displayed. 3. Vertically arranged cells with the same content will not be merged and displayed on different pages.

[0020] This invention achieves the following core objectives: Dynamic row height calculation: Automatically calculates cell content height based on font measurement; Intelligent cross-page processing: Avoids content truncation through line splitting algorithms; OFD file generation: Bypass Word conversion and directly output OFD files conforming to the GB / T 33190-2016 standard.

[0021] The present invention also provides an OFD document table dynamic page-turning system, the system comprising: a module for executing the aforementioned OFD document table dynamic page-turning method.

[0022] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for dynamic page turning of an OFD document table.

[0023] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for dynamic page turning of an OFD document table.

[0024] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for dynamic page turning of an OFD document table.

[0025] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.< / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell> < / cell>

Claims

1. A method for dynamic page turning in OFD documents, characterized in that: The method comprises: S1, single table data is processed into multiple pages of table data; S2, multiple pages of table data are generated into doc documents according to a table template; S3, the doc document is converted into an ofd layout file.

2. The method for dynamic page turning of ofd document table according to claim 1, characterized in that: The S1 comprises: S1.1, initialization configuration: Configure the number of characters that each column and each row can accommodate, the number of pixels per page, the height of the text pixels per row, the height of the row additional pixels, and the flag of whether to split the first two columns; these configurations are set by reading a global configuration file, supporting normal and special two configuration modes; S1.2, character width calculation: The display width of a character is calculated according to the Unicode value of the character using the calWordWidth method; The display width of the entire string is calculated by accumulating the width of each character using the calStringWidth method; S13, row number calculation: The number of rows occupied by the string in the specified column is calculated according to the character width of each column and the total width of the string using the getColXXRows series of methods; S1.4, row height calculation: The row height is calculated according to the number of rows and the height of the text pixels per row using the rowHeightInPixel and rowHeightInPixelCol0 methods, wherein the row height of the first column has an additional magnification factor; The corresponding row number is deduced according to the given pixel height using the pixelToRow and pixelToRow0 methods; S1.5, cell processing: The getCellText method is used to process the string in rich text format and convert it into plain text; The getRowCount method is used to calculate the number of text rows of the cell according to the column index and the string content; S1.6, table data conversion: Converts table data in String[][] format to List<List using the processToCell method <cell>>format, wherein each Cell object contains text content, text row number, and text height information;< / cell> S1.7, height adjustment and merged cell processing: The processHeight method is used to first calculate the text height and the real height of each cell, wherein the case of merged cells is also considered; Then, the logic of the merged cells is processed to ensure that the height of the merged cells is consistent, and the height of the adjacent cells is adjusted to avoid layout disorder; S1.8, page processing: The tableAndRest method is used to divide the table data into multiple tables that can be completely displayed on one page according to the pixel height limit of each page; During the division process, if it is found that the content of a row exceeds the limit of one page, it is decided according to the configuration whether to split the first two columns, and the layout of the remaining content is adjusted accordingly; S1.9, obtaining the final multiple-page table data: Use getDisplayTables method as the entry point of the class, receive table data in the format of String [][], divide the input parameters into one page table and other data by calling tableAndRest, continue to call tableAndRest on other data until there is no other data, so that the form data can be paginated, and finally return List<List<List <cell>>> format of the data structure, where each inner List<List <cell>>represents a complete page table.< / cell> < / cell> 3. The method for dynamic page turning of ofd document table according to claim 1, characterized in that: The S1 further comprises: When calculating where the content of one page is, the height of the unit row is calculated; the data structure of each cell is Cell { text / / text content; textRowCount / / text row number; mergeCount / / number of rows to be merged, 1 for itself and 0 for being merged; textHeight / / cell text height; cellHeight / / processed cell height, 0 if merged } The specific steps are as follows: 1) Convert two-dimensional table data String[][] to List<List <cell>> rows, set the text of each cell Cell< / cell> 2) Create variable List<List<List <cell>>> pageList;< / cell> 3) According to rows and data, loop; 3.1 Process the real height; 3.2 Call tableAndRest to get one page form and other data; According to the cellHeight of Cell, accumulate to the configured height of each page, get the data of each page, if necessary, split a single row according to the textRowCount; 3.3 Add the obtained one page form to the processed pageList; 3.4 Loop the remaining data as rows to step 2); The specific implementation steps of 3.1 are as follows: 1) Calculate the textRowCount, the number of characters per line / the number of characters that can be accommodated in one line of the configured column; 2) Calculate the textHeight, the configured height of each line of text * the textRowCount + the configured cell height; 3) The multi-line merging of a column is identified by the same text; If you need to merge a column from top to bottom, calculate the mergeCount; 4) Take the maximum value of textHeight of non-merged columns as the cellHeight of non-merged columns; 5) Process the height of the merged column; 5.1 If mergeCount is 0, the height of the merged column cellHeight is 0; 5.2 If mergeCount is not 0; 5.2.1 Calculate the cell text height textHeight as height_a; 5.2.2 Calculate the total cellHeight of non-merged columns as height_b; 5.2.3 If height_b >= height_a, the height of the merged column is height_b; 5.2.4 If height_b < height_a, the height of the merged column is height_a; And add the height of height_a - height_b to the cellHeight of the last row of non-merged columns.

4. The method for dynamic page turning of ofd document table according to claim 1, characterized in that: The S2 includes: S2.1, create an initial document object: Create an XWPFDocument object from the input stream, representing a Word document; S2.2, get the table template: get the first table in the document as the table template; S2.3, prepare table data: Get the original table data; Create a CapTableDataProcess object to process the original table data; Convert the original table data into a three-dimensional list structure suitable for display; S2.4, create a multi-page table: Start from the second table, add a page break to each table; Create a new table and copy the styles and structure of the table template; Copy the table content and attributes; S2.5, configure the filling parameters: According to the isSpecial parameter, obtain the cell inner margin configuration; S2.6, fill the table data: Traverse all tables in the document; create a new line for each table and fill the data; add a border to all tables; S2.7, merge cells: Traverse all tables, and use the PoiDocTool.tableMerge method to merge cells with the same content; S2.8, output the document: write the processed document to the output stream.

5. A system for dynamic pagination of ofd document tables, characterized by The system comprises a module for executing the method of claim 1 to 4.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the method of claim 1 to 4. 7.A non-transitory computer-readable storage medium having stored thereon a computer program. The computer program is executed by the processor to realize the method of claim 1 to 4.

8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the method of claim 1 to 4. The computer program is executed by the processor to realize the method of claim 1 to 4.