Multi-column layout method, document display processing method, and terminal device

CN115186645BActive Publication Date: 2026-10-23UC MOBILE CHINA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210761765.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2026-10-23
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

[0002]文档排版是指在文档的页面中对文档元素进行排版,文档排版中最难的是多栏目排版,现有的多栏目排版采用段落排版,即以段落为最小单元进行多栏目排版,该种排版方式在每次排版中都需要进行大量的重复计算,以进行换栏位置的调整,否则排版结果就无法达到设计预期,因此,有必要提供一种进行多栏目排版的新的技术方案,以在降低多栏目排版的复杂性的同时,获得符合设计预期的排版结果

Benefits of technology

[0012]根据本公开的第四方面,提供了根据又一些实施例的计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序在被处理器执行时实现根据本公开的第一方面所述的多栏目排版方法或者执行根据本公开的第二方面所述的文档的显示处理方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115186645B_ABST
    Figure CN115186645B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a multi-column layout method, a document display processing method and a terminal device. The multi-column layout method comprises: obtaining columnation basic information of a columnation object in a document; performing multi-column layout on the columnation object according to the columnation basic information, and presenting the layout result on a page of the document; wherein the layout result reflects the number of rows in each column and the row content of each row in each column, the row content of a row in the column is obtained by one-time row layout, and one-time row layout comprises: determining a target column corresponding to the current row layout according to the current layout state of the columnation object; and performing one-time row layout on the un-laid part of the columnation object in the target column, and completing the current row layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a multi-column layout method, a document display processing method, a terminal device, and a computer-readable storage medium. Background Technology

[0002] Document layout refers to the arrangement of document elements on a document page. The most difficult aspect of document layout is multi-column layout. Existing multi-column layout uses paragraph layout, that is, multi-column layout is carried out with paragraphs as the smallest unit. This layout method requires a lot of repetitive calculations in each layout to adjust the position of column transitions. Otherwise, the layout result will not meet the design expectations. Therefore, it is necessary to provide a new technical solution for multi-column layout to reduce the complexity of multi-column layout while obtaining layout results that meet the design expectations. Summary of the Invention

[0003] One objective of this disclosure is to provide a new technical solution for multi-column layout.

[0004] According to a first aspect of this disclosure, a multi-column layout method is provided, the method comprising: Retrieve basic column information for column objects in a document; Based on the basic column information, the column objects are formatted into multiple columns, and the formatting results are presented on the document page; wherein, the formatting results reflect the number of rows in each column and the content of each row in each column, and the content of a row in each column is obtained by a single row formatting, wherein a single row formatting includes: Based on the current layout status of the column object, determine the target column corresponding to this row layout; Arrange the unformatted portion of the column object into a row in the target column to complete this row layout.

[0005] Optionally, determining the target column corresponding to the current row layout based on the current layout state of the column object includes: If the current layout status indicates that layout has not yet started, the target column is determined to be column 1; If the current layout status indicates that the layout is incomplete and the column number i of the i-th column corresponding to the last row layout is less than the number of columns, the un-layout portion is pre-layouted in other columns after the i-th column, and the target column is determined based on the pre-layout results.

[0006] Optionally, the step of pre-layouting the un-layout portion in other columns following the i-th column includes: Based on the number of rows already formatted in the i-th column, the unformatted portion is pre-formatted in the other columns.

[0007] Optionally, determining the target column corresponding to this row layout based on the pre-layout results includes: If the end position of the pre-formatted layout in the column object meets the column switching condition, the target column is determined to be the next column of the i-th column; If the column switching condition is not met at the end position, the target column is determined to be the i-th column.

[0008] Optionally, the column object includes at least one element type among text elements, image elements, and table elements; The step of formatting the unformatted portion of the column object into a single line in the target column includes: Identify the element type of the target element in the current row layout for the unformatted portion; Based on the element type, the target element is arranged in the target column until a row of layout is completed in the target column.

[0009] Optionally, the step of arranging the target element in the target column according to the element type includes: Based on the element type, the corresponding layout model is invoked to arrange the target element in the target column; wherein, different element types correspond to different layout models.

[0010] According to a second aspect of this disclosure, a document display processing method is also provided, the method comprising: Based on the request to open a document through a first application, the document is parsed; wherein the document is a document created through a second application, and the first application is different from the second application; If the document is found to contain column objects, the multi-column layout method according to any one of claims 1 to 6 is used to perform multi-column layout on the page of the document for the column objects; Once the page layout of the document is completed, the document is displayed; wherein, the page layout includes the multi-column layout.

[0011] According to a third aspect of this disclosure, a terminal device according to other embodiments is provided, the terminal device including a memory and a processor, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the multi-column layout method according to a first aspect of this disclosure or to execute the document display processing method according to a second aspect of this disclosure.

[0012] According to a fourth aspect of this disclosure, a computer-readable storage medium according to further embodiments is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-column layout method according to a first aspect of this disclosure or performs the document display processing method according to a second aspect of this disclosure.

[0013] The multi-column layout method provided in this disclosure uses line layout instead of paragraph layout. Each time a line layout is performed within a column, the target column for that layout is first determined, and a line of content is then laid out in that target column. Since the target column for each line layout is determined based on the basic column information and the undivided portions of the column objects, the column and content of the laid-out line do not need to be adjusted in subsequent layouts after the current layout is completed. This not only eliminates repeated adjustments, reduces layout complexity, and improves layout efficiency, but also achieves a layout effect that meets design expectations compared to paragraph layout.

[0014] The features and advantages of the embodiments of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of this specification and, together with their description, serve to explain the principles of these embodiments.

[0016] Figure 1 The illustration shows an application scenario of a multi-column layout method according to some embodiments; Figure 2 A schematic diagram of the hardware structure of a terminal device according to some embodiments is shown; Figure 3 A flowchart illustrating a multi-column layout method according to some embodiments is shown; Figure 4 A schematic diagram of the typesetting process according to some embodiments is shown; Figure 5 A flowchart illustrating a document display processing method according to some embodiments is shown; Figure 6 A schematic diagram of an architecture for document display processing according to some embodiments is shown; Figure 7 A schematic diagram of the structure of a terminal device according to some other embodiments is shown. Detailed Implementation

[0017] Various exemplary embodiments of this specification will now be described in detail with reference to the accompanying drawings.

[0018] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the embodiments of this specification or their application or use.

[0019] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0020] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with the authorization granted by the owner of the relevant equipment.

[0021] This disclosure relates to a multi-column layout method, which is a part of page layout and also the most difficult part. Page layout provides basic functions for applications such as document reading and document editing. This disclosure refers to such applications as the first application, which can be a browser application or other types of applications, without limitation.

[0022] Multi-column layout refers to arranging columns on a document page according to a set number of columns (two or more). A column can include one paragraph or multiple paragraphs. Columns primarily involve text elements, but can also include table elements, image elements, etc. Therefore, a column can include at least one of the following elements: text elements, table elements, and image elements. Figure 1 The part shown in the dashed box is the two-column layout.

[0023] Page layout methods, including multi-column layouts, can be applied to document display scenarios. For example... Figure 1 As shown, when a user opens a first document created by a second application through a first application running on terminal device 1000, the first document needs to be parsed during the opening process, and the page layout of the first document needs to be performed according to the parsing results. In this way, the first application can display the content of the document normally through terminal device 1000. That is, the first application needs to perform page layout of the document so that its display effect on the document is basically the same as the display effect of opening the document through the second application. Otherwise, the page will be disordered when opening the document through the first application.

[0024] Page layout methods, including multi-column layouts, can also be applied to document editing scenarios. In a document editing scenario, a user can edit a document within a first application. The first application then processes the selected portion according to the user's input layout requirements. For example, if a user selects a section of text on a document page for multi-column layout and enters the basic column information, the first application can invoke the multi-column layout logic to perform multi-column layout on the text according to the column information.

[0025] For multi-column layouts, the current mainstream layout logic is paragraph layout, which uses paragraphs as the smallest unit for multi-column layout. This layout method requires a lot of repetitive calculations in each layout to adjust the column positions; otherwise, the layout result will not meet the user's expectations. To reduce the complexity of multi-column layouts while achieving good layout results, this disclosure proposes a multi-column layout method based on line layout. That is, each time a line of content is laid out in a column, the target column corresponding to this line layout is calculated in each line layout. Through this process, it can be ensured that the column and content of the laid-out line do not need to be adjusted in subsequent layouts. This not only saves the repeated trial and error adjustments in layout, reducing layout complexity and improving layout efficiency, but also, because line layout has a smaller granularity than paragraph layout, it can achieve a layout effect that meets the design expectations while reducing complexity.

[0026] The multi-column layout method of this disclosure can be implemented by a user's terminal device, such as a mobile phone or a tablet computer. Currently, the demand for office work via mobile phones and other terminal devices is rapidly increasing. However, these devices do not support the installation of office software such as Word. Therefore, when opening or even editing a Word document using the first application installed on the terminal device, page layout logic, including multi-column layout, needs to be invoked. Thus, multi-column layout, the most challenging part of page layout, is a problem that urgently needs to be solved.

[0027] Figure 2 A schematic diagram of the hardware structure of an alternative terminal device 1000 for implementing the methods of embodiments of the present disclosure is shown. The terminal device 1000 is equipped with a first application that supports embodiments of the present disclosure, such as a browser application, a cloud storage application, etc.

[0028] like Figure 2 As shown, the terminal device 1000 may include a processor 1101, a memory 1102, an interface device 1103, a communication device 1104, an output device 1105, an input device 1106, etc. Figure 2 The hardware configuration shown is illustrative only and is not intended to limit this disclosure, its application, or its use.

[0029] The processor 1101 executes computer programs, which can be written using instruction sets of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 1102 includes, for example, ROM (Read-Only Memory), RAM (Random Access Memory), and non-volatile memory such as a hard disk. The interface device 1103 includes, for example, a USB interface and a headphone jack. The communication device 1104 is capable of wired or wireless communication. The communication device 1104 may include at least one short-range communication module, such as any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink, WiFi (IEEE 802.11), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, and LiFi. The communication device 1104 may also include a long-range communication module, such as any module for WLAN, GPRS, or 2G / 3G / 4G / 5G long-range communication. The output device 1105 may include, for example, any type of display screen and speaker. The input device 1106 may include, for example, a touchscreen, buttons, and a microphone.

[0030] In this embodiment, the memory 1102 of the terminal device 1000 is used to store a computer program, which is used to control the processor 1101 to operate, so as to control the terminal device 1000 to run a first application, and then execute the multi-column layout method and document display processing method according to the embodiments of this disclosure.

[0031] Figure 3 This is a flowchart illustrating a multi-column layout method according to some embodiments. The method can be derived from, for example... Figure 2 The terminal device 1000 shown can also be implemented by devices with other hardware structures; this is not limited here. For example... Figure 3 As shown, the multi-column layout method of this embodiment may include the following steps S310 and S320.

[0032] Step S310: Obtain the basic column information of the column objects in the document.

[0033] In this embodiment, the column object refers to the object in the document that needs to be formatted into columns. The column object can be a paragraph in the document or it can include multiple paragraphs; there is no limitation here.

[0034] A column may involve only one of the following elements: text, table, and image; or it may involve a combination of at least two of these elements.

[0035] In a document display scenario where the document is opened through a first application, the terminal device 1000 can obtain the column objects and their basic column information by parsing the document. In this scenario, since the document was created through a second application (e.g., a Word document), the first application can obtain various elements of the document through parsing, including content elements such as text, tables, and images, as well as formatting elements such as column breaks, section breaks, page breaks, and paragraph marks. However, it cannot parse the layout of these content elements. Therefore, it is necessary to perform page layout based on the parsing results to ensure that the document page displayed through the first application is essentially consistent with the document page displayed through the second application, preventing layout errors.

[0036] In a document editing scenario where the document is edited through the first application, the terminal device 1000 can obtain the column object and the basic column information of the column object from the user input information.

[0037] The basic information for this column layout includes the number of columns, a list of column widths, and a list of column spacing. The number of columns reflects the total number of columns; for example, N (an integer greater than or equal to 2) means the objects need to be divided into N columns for layout. The column width list contains the width of each column, which determines the number of elements that can be formatted in a row for that column. For example, with text elements, the number of characters that can be formatted in a row for a given column can be determined based on the column width and the font size of the text objects in the column. The column spacing list contains the distance between adjacent columns, which affects the final display effect.

[0038] In this embodiment, the width of different columns can be the same, or at least some columns can have different widths. Similarly, the distance between different columns can be the same or different. The method of this disclosure is applicable to any form of column division.

[0039] A document may contain one column object or multiple column objects. This document uses a single column object as an example to illustrate the multi-column layout method of this disclosure. The terminal device 1000 can determine the end position of the column object by any format among the parsed column break, page break, section break, and end identifier of sections with the same layout structure; wherein, a section may include a paragraph or multiple paragraphs with the same layout structure.

[0040] Step S320: Based on the basic column information, perform multi-column layout on the column objects and present the layout results on the document page.

[0041] The layout reflects the number of rows in each column and the content of each row within each column. The row content refers to the content elements formatted on a single row of a column. For example... Figure 4 As shown in (E), after multi-column layout, the content of the first line of the first column is "Invention patent refers to a product or method".

[0042] This embodiment is based on row layout, which means that one row is laid out in each column. In this embodiment, when the number of columns is N, the content of at least one row in the first (N-1) columns is obtained by one row layout. The Nth column (i.e., the last column) can be laid out using row layout, or after the layout of the first (N-1) columns is completed, the unlaid-out parts of the column objects can be laid out in the Nth column as a whole. There is no limitation here.

[0043] In this embodiment, the layout of at least the first (N-1) columns is achieved by multiple row layouts in series. Before performing a row layout, the terminal device 1000 does not know the target column corresponding to this row layout. That is, the terminal device 1000 does not know which column the row layout is in. Therefore, the terminal device 1000 needs to determine the target column corresponding to this row layout according to the method of this embodiment.

[0044] like Figure 3 As shown, in this embodiment, a single row layout may include the following steps S3201 and S3202: Step S3201: Determine the target column corresponding to this row layout based on the current layout status of the column object.

[0045] The current layout status includes layout information and unlayout information. Layout information includes layout columns and layout rows, while unlayout information includes columns that have not yet started layout and the unlayout portions of column objects.

[0046] In this embodiment, since row layout involves laying out each column one row at a time, after one row layout is completed, some column objects may still not be laid out and are in a waiting state. For example... Figure 4 As shown, Figure 4 (A) shows the column object, after completion Figure 4 After the initial row layout shown in (B), some column objects, "or new technical solutions proposed for their improvement. A utility model patent refers to a new technical solution suitable for practical use proposed for the shape, structure, or combination thereof of a product," have not yet been layoutd and need to continue row layout to complete the multi-column layout of all column objects.

[0047] In this embodiment, during a row layout, it is necessary to determine the target column corresponding to this row layout based on the current layout status.

[0048] If the current layout status indicates that layout has not yet begun (i.e., all columns are currently un-layouted), then the target column for this row layout is column 1. Therefore, the row layout will begin in the first row of column 1. The result of this row layout is as follows: Figure 4 As shown in (B).

[0049] If the current layout status indicates that some columns have not yet started layout, you can pre-layout the unlayout parts of the column objects in the already laid-out rows of the already laid-out columns to determine whether the current row layout needs to be changed to a new column, and then determine the target column corresponding to the current row layout.

[0050] In this embodiment, the target column corresponding to the current row layout is determined based on the current layout status during a row layout, which makes the current row layout deterministic and eliminates the need for repeated adjustments.

[0051] In some embodiments, determining the target column corresponding to the current row layout based on the current layout status of the column object in step S3201 may include the following steps: when the current layout status indicates that the multi-column layout of the column object is not completed, and the column number i of the i-th column corresponding to the previous row layout is less than the number of columns N, pre-layouting is performed on the un-layout part of the column object in other columns after the i-th column; and the target column is determined based on the pre-layout result.

[0052] If the pre-layout results show that multi-column layout of the column object cannot be completed, layout can continue in the i-th column to place more content elements in the i-th column. In this case, the target column is the i-th column. If the pre-layout results show that multi-column layout of the column object can be completed, it indicates that column switching layout has begun. In this case, the target column is the (i+1)-th column. Whether multi-column layout of the column object is completed can be determined by column breakpoints, page breakpoints, section breakpoints, and section end markers.

[0053] If the Nth column is also laid out in rows, and the column number i of the ith column corresponding to the previous row layout is equal to the number of columns N, then the target column for this row layout can be determined to be the ith column.

[0054] Pre-layout can be performed according to set layout rules. For example, the layout rule is to distribute elements evenly across columns, with the left column having as many elements as possible and the right column having fewer elements. For this type of layout rule, in some embodiments, the aforementioned pre-layout of the un-layout portion of the column object in other columns after the i-th column can include: pre-layouting the un-layout portion in other columns based on the number of already-layout rows in the i-th column.

[0055] In these embodiments, pre-layout can be performed according to the number of already laid-out rows in the i-th column, wherein the number of rows pre-layouted in other columns cannot exceed the number of already laid-out rows in the i-th column.

[0056] In some embodiments, determining the target column corresponding to the current row layout based on the pre-layout result may include: if the end position of the pre-layout in the column object meets the column switching condition, determining the target column as the next column of the i-th column; if the end position does not meet the column switching condition, determining the target column as the i-th column.

[0057] The column transition condition can be set according to the format mark indicating the end of the column object. For example, the column transition condition includes: if the end position has any of the format marks such as column break, page break, section break, or section end identifier, it means that the column object has ended, and the multi-column layout of the column object has been completed.

[0058] The following is based on Figure 4 Taking an example, this embodiment illustrates the process of multi-column layout for a column object. Figure 4 As shown, Figure 4 (A) displays a section of text as a column. The end of the column is marked with a formatting tag indicating the end of the column.

[0059] Taking a column count of 2 as an example, during the first row layout, since the current layout status indicates that layout has not yet started, the target column for the first row layout is column 1. At this point, Figure 4 The column item shown in (A) is arranged on the first line of the first column. Figure 4 (B) shows the result of the first line layout.

[0060] See also Figure 4 When performing the second line layout, such as Figure 4 As shown in (C1) and (C2), since the column corresponding to the previous row layout, that is, the first row layout, is column 1, it is necessary to pre-layout according to the number of rows already laid out in column 1 when performing the second row layout. At this time, the number of rows already laid out in column 1 is one row, and one row needs to be pre-laid out in column 2. After the pre-layout, as shown in Figure (C1), the terminal device 1000 determines that the column division has not ended according to the pre-layout result, that is, the column switching condition is not met. Therefore, it determines that the target column corresponding to the second row layout is still column 1. The terminal device 1000 performs the second row layout in column 1, and the layout result is shown in Figure (C2). At this time, two rows of content have been laid out in column 1.

[0061] See also Figure 4When performing the third line layout, such as Figure 4 As shown in (D1) and (D2), since the column corresponding to the previous row layout, i.e. the second row layout, is column 1, when performing the third row layout, it is necessary to pre-layout based on the number of rows already laid out in column 1. At this time, the number of rows already laid out in column 1 is two, and a maximum of two rows can be pre-laid out in column 2 (if the layout ends after pre-laying one row, then it is pre-laying one row). After the pre-layout, as shown in Figure (D1), the terminal device 1000 determines that the column division has not ended based on the pre-layout result, i.e., the column switching condition is not met. Therefore, it determines that the target column corresponding to the third row layout is still column 1. The terminal device 1000 performs the third row layout in column 1, and the layout result is shown in Figure (D2). At this time, three rows of content have been laid out in column 1.

[0062] See also Figure 4 When performing the fourth row layout, since the column corresponding to the previous row layout, i.e. the third row layout, is column 1, it is necessary to perform a pre-layout based on the number of rows already laid out in column 1. At this time, column 1 has three rows already laid out, and a maximum of three rows can be pre-laid out in column 2. After the pre-layout, as shown in Figure (E), the terminal device 1000 determines that the column division has ended based on the pre-layout result, that is, the column switching condition is met. This means that the layout of column 1 has been completed. Since the number of columns in this example is only 2, column 2 is the last column. At this time, the pre-layout result of the fourth row layout can be directly used as the final layout result.

[0063] If the number of columns is 3, then when the previous row layout corresponds to column 1, the current row layout needs to pre-layout in columns 2 and 3. If column 1 has already been laid out one row, then lay out one row in each of columns 2 and 3, and determine the target column for this row layout based on the pre-layout results. If column 1 has already been laid out two rows, then pre-layout two rows in column 2 for the unlaid-out portion of the column object, and then continue pre-layout two rows in column 3, determining the target column for this row layout based on the pre-layout results. This process continues until the column transition condition is met. At this point, the layout of column 1 is complete, and row layout in column 2 begins. When laying out rows in column 2, it is similar to laying out rows in column 1. After laying out each row, pre-layout is performed in column 3 to determine the column transition position for column 2, until the layout of column 3 is complete. That is, the multi-column layout of the column object is completed.

[0064] Step S3202: Arrange the unformatted portion of the column object into a row in the target column to complete this row formatting.

[0065] After completing this row layout, you will get the row content of the row where this layout is located.

[0066] When the unformatted portion is the entirety of the column object, the column object is formatted starting from the initial element, with one row placed at the first position of the first column. Since the content elements for each row layout are limited, a new unformatted portion will be generated after each row layout is completed. That is, the unformatted portion will be updated after each row layout is completed, and the next row layout will be based on the updated unformatted portion.

[0067] When the unformatted portion is a partially columnated object, step S3202 can continue to format the unformatted portion into a row in the target column to obtain the row content of the row where the current row is formatted.

[0068] As described in steps S310 and S320, and steps S3201 and S3202 above, in the multi-column layout method of this embodiment, row layout is used instead of paragraph layout. Since row layout determines the target column corresponding to this row layout based on the current layout state of the column object each time, after the row layout is completed, the column and content of the layout row do not need to be adjusted in subsequent layouts. This not only saves the repeated adjustments of layout, reduces layout complexity, and improves layout efficiency, but also achieves the layout effect that meets the design expectations while reducing complexity. As a result, the display effect of opening the document through the first application can be basically consistent with the display effect of opening the document through the second application.

[0069] The above describes the implementation steps of row layout. When performing row layout in the target column, since text elements, table elements, and image elements have different characteristics, different layout rules can be set for different element types to achieve a more ideal layout effect. Therefore, in some embodiments, the step S3202 above, which involves laying out a row of the unlayout portion of the column object in the target column, may include: identifying the element type of the target element corresponding to the current row layout in the unlayout portion; and laying out the target element in the target column according to the element type, until a row of layout is completed in the target column.

[0070] In these embodiments, when performing row layout, one element can be layouted at a time. When layouting an element, the element type is identified, and it is placed in the current row according to the layout model (which reflects the layout rules) that matches the element type, until the layout of the current row is completed.

[0071] In these embodiments, when performing line layout, the elements to be layout can be identified sequentially until the limitations of the current line layout are met, such as when the text element reaches the upper limit of the current line layout, and then these elements are layouted in the current line, which is not limited here.

[0072] In some embodiments, arranging target elements in target columns according to element type may include: calling the corresponding layout model to arrange the target elements in the target columns according to element type; wherein different element types correspond to different layout models. In these embodiments, different layout models, i.e., layout rules, can be set for different element types based on their characteristics to obtain a more understandable layout effect.

[0073] Based on the multi-column layout method of this disclosure, this disclosure also provides a document display processing method. Figure 5 A flowchart of the display processing method is shown. This display processing method can also be implemented by, for example... Figure 1 and 2 The terminal device 1000 shown is implemented. For example... Figure 5 As shown, the display processing method may include steps S510 to S530: Step S510: Parse the document according to the request to open the document through the first application.

[0074] This document was created using a second application, which is different from the first application.

[0075] See Figure 1 For example, if the first application opens the first document, the first application will parse the document before opening it, and then perform page layout on the document based on the parsed information.

[0076] Step S520: If the document contains column objects, then the column objects are arranged into multiple columns on the document page.

[0077] In step S520, based on the multi-column layout method of this embodiment, the column objects are arranged in a multi-column manner. For specific layout steps, please refer to [link / reference]. Figure 3 and Figure 4 This will not be elaborated upon here.

[0078] Step S530: Display the document after completing the page layout.

[0079] The page layout in step S530 includes the multi-column layout performed in step S520.

[0080] In this embodiment, paragraph formatting can still be used for the entire document, but for column objects, multi-column formatting is achieved based on line formatting.

[0081] like Figure 1 As shown, after parsing and formatting the document, the terminal device 1000 can display the document in response to the request to open it.

[0082] See Figure 6 The display processing architecture shown in the diagram involves the first application installed on the terminal device 1000 performing document parsing, data object processing, layout and rendering sequentially after receiving a request to open a document, in order to display the document.

[0083] In some embodiments, the first application can provide general parsing, XML parsing, and Office 2004 parsing for document parsing. General parsing can include parsing mathematical formulas, Excel formulas, and images in at least one of the following formats: TIFF, EMF, and WMF. XML parsing can include parsing ZipPackage (compressed file), Dom4j (documentobjectmodel for Java), XReader (ebs file reader), and SAX (Simple API for XML). Office 2004 parsing can include POI (Poor Obfuscation Implementation) parsing and binary stream parsing. Upon receiving a request to open a document, the first application will first perform document parsing, which can be based on the architecture's parsing capabilities to obtain document information.

[0084] The document information obtained from document parsing is processed in the data object layer to form data objects, such as column objects. The tools provided by the data object layer include WPDocument (WordPerfect document), PGSlide (pageSlide, page navigation), Workbook, and animations.

[0085] After obtaining each data object, it is necessary to format and layout them, including text formatting, table formatting, and page formatting. During formatting, the appropriate formatting method can be selected based on the parsed data object type. The multi-column formatting in this embodiment involves text formatting and may also involve table formatting. For text formatting, this architecture provides Java classes such as STRoot, ParagraphView, LineView, Leafview, and ObjectView. For table formatting, it provides Java classes such as SheetView, RowView, CellView, CellHeader, CellBorder, and CellText. For page formatting, it provides Java classes such as SlideShowView, PageView, background, images, custom graphics, and Table. This architecture can also provide other classes at the formatting and layout layer, such as Chart, positionView, and animation. In the layout process, the data control layer provides Java classes such as Control, Listener, Handler, Action, and Event. The upper-level layout layer obtains the necessary data through this layer. Furthermore, the upper-level layout layer provides tools like Layoutkit, SliderShowkit, Viewkit, and ViewControl for the primary application to use for layout. After the layout is complete, page rendering can begin. The rendering layer provides tools such as Canvas, LaTeX mathematical formulas, and MPAndroidChart (an open-source icon library) for rendering and drawing, thus enabling document display.

[0086] According to steps S510-S530, the document display processing method according to the embodiments of this disclosure enables users to open documents created by a second application through a first application via a terminal device, mainly a mobile terminal such as a mobile phone, for reading or even editing. This provides convenience for users to conduct office work via mobile terminals such as mobile phones. The embodiments of this disclosure also provide a terminal device. Figure 7 A schematic diagram of the hardware structure of the terminal device 700 is shown. (For example...) Figure 7As shown, the terminal device 700 may include a memory 720 and a processor 710. The memory 720 stores computer programs, and the processor 710, under the control of the computer programs, executes the multi-column layout method and document display processing method according to any embodiment of this disclosure. The terminal device may be a mobile terminal such as a mobile phone, tablet computer, or wearable device.

[0087] The terminal device 700 may also include other devices, such as a display device for displaying documents, an input device for inputting information, etc., without limitation.

[0088] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and apparatus embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0089] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0090] Embodiments of this specification may be devices, methods, and / or computer program products. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the embodiments of this specification.

[0091] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0092] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0093] Computer program instructions used to perform the operations of the embodiments described herein may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the embodiments described herein.

[0094] Various aspects of embodiments of this specification are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this specification. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0095] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0096] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0097] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this specification. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0098] Various embodiments of this specification have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A multi-column layout method, characterized in that, include: Retrieve basic column information for column objects in a document; Based on the basic column information, the column objects are formatted into multiple columns, and the formatting results are presented on the document page; wherein, the formatting results reflect the number of rows in each column and the content of each row in each column, and the content of a row in each column is obtained by one row formatting. The single-line layout includes: If the current layout status of the column object indicates that layout has not yet started, the target column for this row layout is determined to be column 1; If the current layout status indicates that the layout is not completed and the column number i of the i-th column corresponding to the last row layout is less than the number of columns, the un-layout part of the column object is pre-layouted in other columns after the i-th column, and the target column is determined based on the pre-layout result. Arrange the unformatted portion into a single line in the target column to complete this line formatting.

2. The method according to claim 1, characterized in that, The pre-layout of the un-formatted portion of the column object in the other columns following the i-th column includes: Based on the number of rows already formatted in the i-th column, the unformatted portion is pre-formatted in the other columns.

3. The method according to claim 1 or 2, characterized in that, The process of determining the target column for this row layout based on the pre-layout results includes: If the end position of the pre-formatted layout in the column object meets the column switching condition, the target column is determined to be the next column of the i-th column; If the column switching condition is not met at the end position, the target column is determined to be the i-th column.

4. The method according to claim 1 or 2, characterized in that, The column object includes at least one element type among text elements, image elements, and table elements; The step of formatting the unformatted portion of the column object into a single line in the target column includes: Identify the element type of the target element in the current row layout for the unformatted portion; Based on the element type, the target element is arranged in the target column until a row of layout is completed in the target column.

5. The method according to claim 4, characterized in that, The step of arranging the target element in the target column according to the element type includes: Based on the element type, the corresponding layout model is invoked to arrange the target element in the target column; wherein, different element types correspond to different layout models.

6. A document display processing method, characterized in that, include: Based on the request to open a document through a first application, the document is parsed; wherein the document is a document created through a second application, and the first application is different from the second application; If the document is found to contain column objects, the multi-column layout method according to any one of claims 1 to 5 is used to perform multi-column layout on the page of the document for the column objects; Once the page layout of the document is completed, the document is displayed; wherein, the page layout includes the multi-column layout.

7. The method according to claim 6, characterized in that, The first application is a browser application.

8. A terminal device, characterized in that, It includes a memory and a processor, the memory being used to store a computer program, and the processor being used, under the control of the computer program, to execute the multi-column layout method according to any one of claims 1 to 5, or to execute the document display processing method according to claim 6 or 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the multi-column layout method according to any one of claims 1 to 5, or performs the document display processing method according to claim 6 or 7.

Citation Information

Patent Citations

  • Method and system for typesetting of footmark contained documents

    CN103186518A

  • General DOC, DOCX and INDD document typesetting engine and method

    CN113011129A