CN-116341496-B - Document typesetting method, device and equipment
Abstract
The application discloses a document typesetting method, a document typesetting device and document typesetting equipment. The method comprises the steps of obtaining editing information of a document edited through a mobile terminal, determining a hierarchical rearrangement range of the document according to the editing information, wherein the hierarchical rearrangement range comprises at least one rearrangement range of a picture element level, a table element level, a paragraph element level, a text box element level and a page element level, and typesetting the hierarchical rearrangement range in the document. By adopting the processing mode, document rearrangement is controlled in a smaller range, so that the time consumption for rearrangement can be effectively reduced, and the problems of influence on user experience such as jamming and the like can be avoided.
Inventors
- ZOU ZHIHENG
- LIU ZIYANG
- YAN HONGSONG
Assignees
- 优视科技(中国)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221117
Claims (12)
- 1. The document typesetting method is characterized by being applied to a mobile application or a mobile browser installed on a mobile terminal and comprising the following steps of: acquiring editing information of editing a document through a mobile terminal; Determining a hierarchical rearrangement range of the document according to the editing information, wherein the method comprises the steps of obtaining document elements corresponding to the editing information; determining that the hierarchical rearrangement range comprises the document element, wherein in the case that the format change of the document element corresponding to the editing information affects the format of the upper document element of the document element, the hierarchical rearrangement range comprises the upper document element of the document element; The typesetting of the hierarchical rearrangement range in the document comprises the steps of repositioning the text floating picture when the hierarchical rearrangement range is the text floating picture, determining typesetting position information of the text line according to the indentation information of the target paragraph if the text line and the text surrounding type document element are not overlapped with each other aiming at the text line in the target paragraph when the hierarchical rearrangement range comprises the target paragraph and the text surrounding type document element, wherein the typesetting position information of the text line comprises a plurality of paired horizontal starting point position information and horizontal ending point position information; Wherein, the determining the hierarchical rearrangement range of the document according to the editing information comprises the following steps: if the editing information is the text floating picture, determining that the hierarchical rearrangement range comprises the text floating picture; If the editing information is an embedded picture or a text surrounding picture, determining that the hierarchical rearrangement range comprises a page to which the embedded picture or the text surrounding picture belongs; The method comprises the steps of determining that a hierarchical rearrangement range comprises a paragraph to which the text belongs if the editing information is text, obtaining height change information of the paragraph, judging whether the text is located in a text box if the height change information is that the height of the paragraph changes, determining that the hierarchical rearrangement range comprises the text box if the text is located in the text box and the text box is a text floating picture, and determining that the hierarchical rearrangement range comprises a page to which the paragraph belongs if the text is not located in the text box.
- 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The hierarchical rearrangement range comprises a target paragraph, wherein the target paragraph comprises a text surrounding type document element, the text surrounding type document element is a document element with text surrounding, and the text surrounding type document element comprises a text surrounding type picture and/or a text surrounding type table; the typesetting the hierarchical rearrangement range in the document comprises the following steps: Acquiring the text surrounding type document element; determining typesetting position information of the text surrounding type document elements; For the text line in the target paragraph, if the text line and the text surrounding type document element are overlapped, determining typesetting position information of the text line according to typesetting position information and text surrounding type information of the text surrounding type document element; Typesetting the text surrounding type document elements according to the typesetting position information of the text surrounding type document elements, and typesetting the text lines according to the typesetting position information of the text lines.
- 3. The method as recited in claim 2, further comprising: acquiring vertical position information of the text line and vertical position range information of the text surrounding type document element; and if the vertical position range information comprises the vertical position information, determining that the text line and the text surrounding type document element overlap.
- 4. The method of claim 2, wherein the step of determining the position of the substrate comprises, The target paragraph includes a plurality of text surrounding document elements; The method further comprises the steps of: If at least two text surrounding type document elements are connected or partially overlapped and the text surrounding modes of the at least two text surrounding type document elements are the same, merging the at least two text surrounding type document elements; The determining the typesetting position information of the text line according to the typesetting position information of the text surrounding type document element and the text surrounding type information comprises the following steps: And determining typesetting position information of the text line according to the typesetting position information of the combined text surrounding type document element and surrounding text mode information.
- 5. The method of claim 2, wherein the step of determining the position of the substrate comprises, Overlapping between the text line and a plurality of text surrounding document elements; The determining the typesetting position information of the text line according to the typesetting position information of the text surrounding type document element and the text surrounding type information comprises the following steps: Acquiring a first text surrounding type document element which is overlapped with the text lines and is a surrounding type and is provided with right surrounding text, and a second text surrounding type document element which is overlapped with the text lines and is provided with surrounding type and is provided with left surrounding text; and taking the right side position of the first text surrounding type document element as the horizontal starting point position information of the text line, and taking the left side position of the second text surrounding type document element as the horizontal ending point position information of the text line.
- 6. The method of claim 2, wherein the step of determining the position of the substrate comprises, The area where the target paragraph is located comprises a text, a header, a footer and a table; And storing the information of the text surrounding type document elements in the target paragraphs in different areas to different text surrounding type document element sets respectively.
- 7. The method of claim 1, wherein the document element comprises one of a picture element, a form element, a paragraph element, a text box element.
- 8. The method of claim 1, wherein the step of determining the position of the substrate comprises, The word surrounding mode of the word floating type picture comprises that the picture is lined below the word or the picture is lined above the word.
- 9. The method of claim 1, wherein determining a hierarchical rearrangement range of the document from the editing information further comprises: And if other pages with formats influenced by the page rearrangement exist, determining that the hierarchical rearrangement range comprises the other pages.
- 10. The method of claim 9, wherein typesetting the hierarchical rearrangement range within the document comprises: typesetting the page through a document editing main thread; starting a sub-thread; and typesetting the other pages through the sub-threads.
- 11. A document typesetting method, comprising: Acquiring a text surrounding type document element in a paragraph to be typeset, wherein the text surrounding type document element is a document element with text surrounding, and the text surrounding type document element comprises a text surrounding type picture and/or a text surrounding type table; Determining typesetting position information of the text surrounding type document element, wherein the typesetting position information of the text surrounding type document element comprises target starting position, width information and height information of the text surrounding type document element according to the target starting position of a paragraph to be typeset and the position of a relative paragraph starting point of the text surrounding type document element; Aiming at the text lines in the paragraphs to be typeset, if the text lines are overlapped with the text surrounding type document elements, determining typesetting position information of the text lines line by line according to typesetting position information and text surrounding type information of the text surrounding type document elements; if the text lines and the text surrounding type document elements are not overlapped, determining typesetting position information of the text lines according to the indentation information of the paragraphs to be typeset; Typesetting the text surrounding type document elements according to the typesetting position information of the text surrounding type document elements, and typesetting the text lines according to the typesetting position information of the text lines.
- 12. An electronic device, comprising: a processor and a memory; A memory for storing a program for implementing the document typesetting method according to any one of claims 1 to 11, the apparatus being powered on and running the program of the method by the processor.
Description
Document typesetting method, device and equipment Technical Field The application relates to the technical field of mobile application, in particular to a document typesetting method and device and electronic equipment. Background With the continuous development of mobile terminal technology, editing office documents through a mobile terminal is widely used. The real-time editing of the office document emphasizes what you see is what you get, and the performance of the rearrangement of the office document edited by the mobile terminal is an important link affecting the user experience of the mobile terminal. One typical way to re-type an office document edited by a mobile terminal is to perform a re-type of the entire document for each edit. However, this scheme has at least a problem in that, in the case of a large document, it takes time to perform the rearrangement of the entire document after each editing, resulting in a problem of a jam or the like. Disclosure of Invention The application provides a document typesetting method, which aims to solve the problem of lower rearrangement performance of a mobile terminal edited document in the prior art. The application further provides a document typesetting device and electronic equipment. The application provides a document typesetting method, which comprises the following steps: acquiring editing information of editing a document through a mobile terminal; Determining a hierarchical rearrangement range of the document according to the editing information, wherein the hierarchical rearrangement range comprises at least one rearrangement range of a picture element level, a table element level, a paragraph element level, a text box element frame level and a page element level; Typesetting the hierarchical rearrangement range in the document. Optionally, the hierarchical rearrangement range comprises a target paragraph, wherein the target paragraph comprises a text surrounding type document element, the text surrounding type document element is a document element with text surrounding, and the text surrounding type document element comprises a text surrounding type picture and/or a text surrounding type table; the typesetting the hierarchical rearrangement range in the document comprises the following steps: Acquiring the text surrounding type document element; determining typesetting position information of the text surrounding type document elements; For the text line in the target paragraph, if the text line and the text surrounding type document element are overlapped, determining typesetting position information of the text line according to typesetting position information and text surrounding type information of the text surrounding type document element; Typesetting the text surrounding type document elements according to the typesetting position information of the text surrounding type document elements, and typesetting the text lines according to the typesetting position information of the text lines. Optionally, the method further comprises: acquiring vertical position information of the text line and vertical position range information of the text surrounding type document element; and if the vertical position range information comprises the vertical position information, determining that the text line and the text surrounding type document element overlap. Optionally, the target paragraph includes a plurality of text surrounding document elements; The method further comprises the steps of: If at least two text surrounding document elements are connected or partially overlapped and the text surrounding modes of the at least two text surrounding document elements are the same, merging the at least two text surrounding document elements; The determining the typesetting position information of the text line according to the typesetting position information of the text surrounding type document element and the text surrounding type information comprises the following steps: And determining typesetting position information of the text line according to the typesetting position information of the combined text surrounding type document element and surrounding text mode information. Optionally, the text line and the plurality of text surrounding document elements overlap; The determining the typesetting position information of the text line according to the typesetting position information of the text surrounding type document element and the text surrounding type information comprises the following steps: Acquiring a first text surrounding type document element which is overlapped with the text lines and is a surrounding type and is provided with right surrounding text, and a second text surrounding type document element which is overlapped with the text lines and is provided with surrounding type and is provided with left surrounding text; and taking the right side position of the first text surrounding type document element as the horizontal starting