Document processing method and device and computer program product
By automatically identifying the target object and its layout information from the first document and adding it to the target page of the second document, the complex problems of manual layout and entry in the prior art are solved, and efficient information entry and visual unity are achieved.
Patent Information
- Application Number
- CN202411666273.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
AI Technical Summary
When it is necessary to create documents suitable for different scenarios based on the same topic, the prior art requires manual layout and information entry, resulting in complex operations, low efficiency and difficulty in ensuring visual unity.
By responding to the trigger operation of the first document, the target object and its layout information are automatically determined from the first document and added to the target page matching it in the second document, automatically entering and visual unification of documents in different formats.
Automatic matching and entry are realized, the efficiency of information entry is improved, operations are simplified, and visual unity is ensured on the basis of ensuring the integrity of the second document.
Smart Images

Figure CN119598966A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of document processing, and in particular to a document processing method, device and computer program product. Background Art
[0002] As a carrier of information, electronic documents may contain content in various forms such as text, pictures, sounds, and videos. Electronic documents may include, but are not limited to, text documents, presentation documents, and spreadsheet documents. Presentation documents may include PowerPoint documents and PDFs, text documents may include Word documents, and spreadsheet documents may include Excel spreadsheets.
[0003] When users need to create documents suitable for different scenarios based on the same topic, they need to manually layout and enter information based on the needs of different scenarios to obtain documents suitable for different scenarios. For example, at the graduation stage, in addition to preparing a graduation thesis, a PPT file must also be prepared for the thesis defense. It takes a lot of time and energy to layout and enter information, the operation is complicated and inefficient, and it is difficult to guarantee the visual effect. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a document processing method, device and computer program product, which can not only simplify the operation and improve the efficiency of information input, but also ensure visual unity on the basis of ensuring the integrity of the second document.
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a document processing method, including:
[0006] In response to a trigger operation on a first document, determining a target object from the first document, and acquiring layout information of the target object in the first document;
[0007] Based on the layout information of the target object in the first document, adding the target object to a target page matching the target object in the second document to obtain a target document;
[0008] The first document and the second document are in different document formats.
[0009] According to a second aspect of an embodiment of the present disclosure, there is provided a document processing device, including:
[0010] A first determination module is configured to determine a target object from a first document in response to a trigger operation on the first document, and obtain layout information of the target object in the first document;
[0011] A generating module, configured to add the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document, to obtain a target document;
[0012] The first document and the second document are in different document formats.
[0013] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0014] processor;
[0015] Memory for storing computer programs or instructions;
[0016] The processor executes the computer program or instructions to implement the steps of any one of the methods in the first aspect above.
[0017] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the storage medium stores a computer program or instructions. When the computer program or instructions in the storage medium are executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0018] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of any one of the methods described in the first aspect.
[0019] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0020] In the disclosed embodiment, the target object and the layout information of the target object in the first document can be automatically identified from the first document, a target page matching the target object can be determined from the second document, and based on the layout information of the target object in the first document, the target object can be added to the target page to obtain the target document.
[0021] On the one hand, the target object in the first document can be added to the target page in the second document by automatic matching, so as to realize the automatic input of the content of documents of different formats without the need for additional operations, and improve the efficiency of information input. On the other hand, based on the layout information of the target object in the first document, the target object is added to the target page, and after the target object is added to the second document of different format, the visual effect of the second document can be improved.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0024] Figure 1 The following is a flow chart of a document processing method according to an exemplary embodiment. Figure 1 .
[0025] Figure 2 The diagram is a schematic diagram of a hierarchical structure of a document according to an exemplary embodiment.
[0026] Figure 3 is a schematic diagram showing first text content according to an exemplary embodiment.
[0027] Figure 4 is a schematic diagram showing second text content according to an exemplary embodiment.
[0028] Figure 5 The diagram is a schematic diagram showing the association relationship between a target object and a target page according to an exemplary embodiment.
[0029] Figure 6 is a schematic diagram showing a target page for inserting a target object according to an exemplary embodiment Figure 1 .
[0030] Figure 7 is a schematic diagram showing a target page for inserting a target object according to an exemplary embodiment Figure 2 .
[0031] Figure 8 is a schematic diagram showing a target page for inserting a target object according to an exemplary embodiment Figure 3 .
[0032] Fig. 9 is a schematic diagram showing a target page for inserting a target object according to an exemplary embodiment Figure 4 .
[0033] Fig.10 The following is a flow chart of a document processing method according to an exemplary embodiment. Figure 2 .
[0034] Fig.11 The figure is a block diagram of a document processing device according to an exemplary embodiment.
[0035] Fig.12 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0036] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0037] Figure 1 The following is a flow chart of a document processing method according to an exemplary embodiment. Figure 1 .like Figure 1 As shown, the method mainly includes the following steps:
[0038] In step 101, in response to a trigger operation on a first document, a target object is determined from the first document, and layout information of the target object in the first document is obtained;
[0039] In step 102, based on the layout information of the target object in the first document, the target object is added to a target page matching the target object in the second document to obtain a target document;
[0040] The first document and the second document have different document formats.
[0041] It should be noted that the document processing method proposed in the present disclosure can be applied to electronic devices or servers. Here, electronic devices may include: terminal devices, such as mobile terminals or fixed terminals. Among them, mobile terminals may include: mobile phones, tablet computers, laptop computers, etc. Fixed terminals may include: desktop computers, smart TVs, etc. As a type of computer, a server can provide computing or application services for other clients (such as computers, terminal devices such as smart phones, and even large devices such as train systems) in the network.
[0042] The document processing method in the embodiment of the present disclosure may be configured in a document processing device, and the document processing device may be set in a server, or may also be set in an electronic device, which is not limited in the embodiment of the present disclosure.
[0043] It should be noted that the execution subject of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) in a server or electronic device in terms of hardware, or may be, for example, a related background service in a server or electronic device in terms of software, without limitation.
[0044] In the embodiment of the present disclosure, the first document and the second document have different document formats. For example, the first document is a text document and the second document is a presentation document; or the first document is a presentation document and the second document is a text document, etc.; or the first document is a text document and the second document is a table document, etc.
[0045] It should be noted that a presentation document may include a document or software application for displaying information, data, and tutorials. A presentation document generally contains visual elements, and conveys these visual elements to users in the form of pages. Among them, visual elements may include: charts, pictures, videos, and texts. Exemplarily, the presentation documents provided by the present disclosure may include: PowerPoint presentations (PPT documents, also known as PPT documents), portable document formats (PDF) documents, interactive presentation documents (such as application files of web pages), Keynote presentations, etc.
[0046] Text documents are mainly text-based, used to record and transmit information, and mainly focus on the expression of text content. Exemplarily, the text documents provided by the present disclosure may include: documents in .doc, .docx, .txt and other formats, for example, may be Word documents.
[0047] The table document mainly organizes data in a table form and is used to process and analyze data. Exemplarily, the table document provided by the present disclosure may include: documents in .xls, .xlsx, .csv and other formats, for example, the table document may include: Excel spreadsheets and the like.
[0048] In the embodiment of the present disclosure, the triggering operation on the first document may be an operation of instructing to insert the target object in the first document into the target page in the second document.
[0049] In some embodiments, the trigger operation may be a selection operation initiated based on the first document, for example, by selecting the second document in which the target object is to be inserted in the first document.
[0050] Exemplarily, a first control may be displayed on a first document, and a trigger operation may be performed based on the first control. For example, in the case where an operation acting on the first control is detected, it is determined that a trigger operation is detected, and the second document may be selected based on the operation acting on the first control. In other embodiments, the trigger operation may also be a collection of a series of operations acting on the first document. Exemplarily, after a selection operation acting on the first document is detected, at least one second control may be displayed based on the selection operation. In the case where an operation acting on a first target control in the at least one second control is detected, it is determined that a trigger operation is detected, and the second document may be selected based on the first target control. Exemplarily, each second control may be respectively associated with a different document, wherein the first target control may be a control corresponding to the second document.
[0051] In other embodiments, the first document to be used may be selected in the second document by adding content or modifying content in the second document, and then the target object selected from the first document may be added to the target page of the second document.
[0052] Exemplarily, a third control may be displayed in the second document, and a trigger operation may be performed based on the third control. For example, in the case where an operation acting on the third control is detected, it is determined that a trigger operation is detected, and the first document may be selected based on the operation acting on the third control. In other embodiments, the trigger operation may also be a collection of a series of operations acting on the second document. Exemplarily, after a selection operation acting on the second document is detected, at least one fourth control may be displayed based on the selection operation, and in the case where an operation acting on a second target control in the at least one fourth control is detected, it is determined that a trigger operation is detected, and the first document may be selected based on the second target control. Exemplarily, each fourth control may be respectively associated with a different document, wherein the second target control may be a control corresponding to the first document.
[0053] In other embodiments, a preset interface may also be displayed on the current interface, and a trigger operation may be performed based on the preset interface.
[0054] Exemplarily, the trigger operation may be an operation of importing the first document and the second document through a preset interface. After detecting that the first document and the second document are imported through the preset interface, the target object may be determined from the first document, and the target object may be automatically inserted into the target page of the second document. In some embodiments, the preset interface may be an operation window displayed on the current interface, and at least one fifth control may be displayed in the operation window for importing the first document and the second document. Exemplarily, the preset interface may be displayed in a floating manner on the current interface.
[0055] In the embodiment of the present disclosure, when a trigger operation on a first document is detected, a target object may be determined from the first document, and layout information of the target object in the first document may be acquired.
[0056] It should be noted that the target object may be an object in the first document that needs to be inserted into the second document. Exemplarily, the target object may be an object in the first document that includes image content and / or table content. The image content may be content that includes at least some image elements, and the table content may be content that includes at least some table elements.
[0057] In some embodiments, the target object can be determined from the first document in a traversal manner. Exemplarily, all objects including picture content can be determined from the first document in a traversal manner; and / or all objects including table content can be determined from the first document in a traversal manner. Wherein, when the target object only includes a picture, the target object is a picture, and when the target object only includes a table, the target object is a table. Here, the target object can also be determined in a retrieval manner.
[0058] In some embodiments, after the target object is determined, the target object may be identified and stored in a preset cache space, and layout information of the target object in the first document may be obtained.
[0059] It should be noted that the layout information of the target object in the first document may include at least one of the following: the position information of the target object in the first document, the attribute information of the target object, the style information of the target object, etc. Among them, target objects with different attributes may obtain different layout information. Taking the target object as an object including picture content, the layout information of the target object may include at least one of the following: the layout position of the picture in the first document, the height information of the picture, the width information of the picture, etc. Taking the target object as an object including a table, the layout information of the target object may include at least one of the following: the layout position of the table in the first document, the size information of the table, the content information of the table, etc.
[0060] Taking the case where the first document is a text document and the second document is a PPT document as an example, an office application programming interface (Application Programming Interface, API) can be used to traverse the target object in the first document.
[0061] Exemplarily, the API of the office application is used to traverse the pictures and the composite objects containing the pictures in the first document. After traversing the target object including the picture content, the picture name can be determined, and the picture name and the target object can be stored as a temporary file in a preset cache space. The layout information of the picture in the first document can also be obtained, wherein the layout information can include at least one of the following: the position of the picture in the full text (gcpStart), the height information of the picture, and the width information of the picture.
[0062] As another example, the table content in the first document is traversed using the API of the office application. After the target object including the table content is traversed, the table name can be determined, and the table name and the target object can be stored as a temporary file in a preset cache space, or the table content can be converted into image content, and the table name and the converted image content can be stored as the target object in the preset cache space. The layout information of the table in the first document can also be obtained, wherein the layout information can include at least one of the following: the position of the table in the full text (gcpStart), the height information of the table, and the width information of the table.
[0063] In the disclosed embodiment, by obtaining and saving the layout information of the target object in the first document, when the target object needs to be inserted, the layout information of the target object in the first document can be directly obtained from the preset cache space to more accurately insert the target object into the target page in the second document (PPT).
[0064] It should be noted that the target page in the second document that matches the target object may be a page determined based on the attribute information of the target object, wherein the attribute information may be used to indicate the characteristics of the target object.
[0065] Exemplarily, if the target object is an object including picture content, the target page can be determined from the second document based on the caption information of the picture. Exemplarily, if the target object is an object including table content, the target page can be determined from the second document based on the table name of the table.
[0066] After the target page is determined, the target object may be added to the target page of the second document based on the layout information of the target object in the first document to obtain the target document.
[0067] It should be noted that the first document and the target document have different document formats, and the document style, attribute information and layout style of the first document are also different from those of the target document. The content included in the first document and the content included in the target document are also different.
[0068] In some embodiments, before adding the target object to the target page of the second document, it can be determined whether to adjust the target object based on the layout information of the target page and / or the layout information of the target object in the first document. If it is determined that the target object needs to be adjusted, the target object can be processed and the processed target object can be added to the target page.
[0069] Exemplarily, when the size of the target object does not match the size of the target page, the size of the target object can be adjusted and the adjusted target object can be added to the target page. For example, when the target object is a picture, the picture can be processed to obtain multiple continuous images, and the multiple images can be inserted into the target page to better match the layout of the target page.
[0070] As another example, after the target object is determined, the background style of the target page may be adjusted based on the content of the target object, and the target object may be added to the adjusted target page.
[0071] In another exemplary embodiment, the layout information of the target object in the first document includes: the position information of the target object in the first document. The present disclosure can insert the target object into the corresponding position of the target page based on the position information of the target object in the first document. In the case of multiple target objects, the arrangement of each target object in the first document and the arrangement of each target object in the second document can be the same or different, as long as the target object and the target page can be matched.
[0072] In the embodiment of the present disclosure, after the target object is determined, the target object can be adjusted based on the layout information of the target object in the first document and / or the layout information of the target page, and the adjusted target object can be inserted into the target page of the second document.
[0073] Here, the adjustment of the target object may be an adjustment of the content of the target object and / or an adjustment of the arrangement of the target object. The target object is an object in the first document that needs to be inserted into the second document.
[0074] In the disclosed embodiment, the target object and the layout information of the target object in the first document can be automatically identified from the first document, a target page matching the target object can be determined from the second document, and based on the layout information of the target object in the first document, the target object can be added to the target page to obtain the target document.
[0075] First, the target object in the first document can be added to the target page in the second document by automatic matching, so as to realize the automatic input of the content of documents of different formats and improve the efficiency of information input. Second, based on the layout information of the target object in the first document, the target object is added to the target page. After the target object is added to the second document of different format, the visual unity can be ensured on the basis of ensuring the integrity of the second document.
[0076] In some embodiments, in response to a triggering operation on a first document, determining a target object from the first document includes:
[0077] In response to a trigger operation, determining a target object from a body portion of a first document;
[0078] Based on the layout information of the target object in the first document, the target object is added to a target page matching the target object in the second document to obtain a target document, including:
[0079] Based on the layout information of the target object in the first document, the target object is added to a target page located in the body part of the second document to obtain a target document.
[0080] It should be noted that the first document includes: a text document; the second document includes: a presentation document; and the target object includes: image content and / or table content.
[0081] After the trigger operation is detected, the present disclosure can determine the target object from the body part of the first document, wherein the body part can be a part of the first document including the core information and detailed content of the first document.
[0082] Taking the first document as a text document as an example, the body of the first document may include the text area in the first document excluding auxiliary contents such as the title, header, footer, directory, appendix, etc. The body may have a clear structure, including the introduction, main body and conclusion, so as to facilitate reading of the first document. The body has a predetermined format, including font, font size, line spacing, paragraph indentation, etc., to improve readability. The body contains the main content of the first document, such as analysis, discussion, data, arguments, evidence, etc. The body may include multi-level headings: organizing the document content through multi-level headings can make the document structure clearer. The body may also include visual elements such as charts, illustrations, pictures, etc. to assist in explaining the text content. The body may also include quotations and notes to explain specific content.
[0083] Taking the first document as a text document and a paper as an example, the recognition module of paper typesetting can be used to collect the content of the text part. Taking the target object as an object including picture content, the object including picture content can be identified from the text part of the first document, and the target object can be saved in the format of a picture.
[0084] Taking the example that the target object is an object including table content, the object including table content can be identified from the main body of the first document, and the target object can be saved in the format of a picture. For example, the target object including table content can be converted into the format of a picture, which can ensure the integrity of the table content and avoid deformation of the table size and font due to incompatible document formats.
[0085] Taking the first document as a paper as an example, the main body of the paper may be a part that does not include the cover, etc. Exemplarily, the main body of the paper does not include: cover, abstract, introduction, references, etc. In some embodiments, the coding expression of the main body can be expressed as: mainDocRange = [the starting position of the main body in the full text, the ending position of the main body in the full text].
[0086] It should be noted that the first document may include: cover, table of contents, abstract, introduction, main text, conclusion, summary, acknowledgments, references, appendix. If the above categories are defined as sub-documents of the paper, then the key sub-documents of the main text may include: first-level title, second-level title, third-level title, fourth-level title, main text content, captions, pictures, and placeholders for tables. The target object may be an object including picture content and / or an object including table content in the main text (mainDocRange).
[0087] After the main text part (mainDocRange) is identified using the recognition module of the paper typesetting, the content of the main text part can be identified according to the recognition module of the paper typesetting. Exemplarily, the sub-documents of the main text part can be identified. Among them, the sub-documents of the main text part can include: titles of various levels, content, captions, pictures, tables, the position of pictures on the current page, and the position information of pictures in the full text, etc. Among them, the titles of various levels of the main text part can include: first-level titles, second-level titles, third-level titles, etc.
[0088] In other embodiments, before determining the body of the first document, the first document may be preprocessed. For example, the body of the first document may be cleaned, and the numbers, punctuation marks, and symbols in the body of the first document may be deleted. For example, if the first document is a paper, the titles and the contents of the body of the paper may be cleaned, and the numbers, punctuation marks, and symbols in the body of the paper may be deleted.
[0089] Figure 2FIG. 1 is a schematic diagram of a hierarchical structure of a document according to an exemplary embodiment. Figure 2 As shown, the body of the document may include: a first-level title 201 , a second-level title 202 , a third-level title 203 , a fourth-level title 204 , content 205 , captions 206 , pictures 207 , and tables 208 .
[0090] In other embodiments, after determining the document content to be matched, that is, the target object, the placeholder of the target object in the first document may be obtained. For example, the picture placeholder and / or table placeholder to be matched may be extracted.
[0091] For example, if the second document is a presentation document, the presentation document may include multiple different types of pages. For example, the different types of pages may include: cover page, body page, directory page, end page, decoration page, data page, image page, etc. The body of the second document is the body page of the second document, and the target page matching the target object may be one or more of the body pages of the second document.
[0092] In other embodiments, the first document may be a presentation document, and the second document may be a text document, as long as the document formats of the first document and the second document are different, which will not be listed here one by one.
[0093] In some embodiments, adding the target object to a target page in the second document that matches the target object to obtain the target document includes: if the target object includes table content, converting the table content in the target object into image content to obtain the converted target object; and inserting the converted target object into the target page to obtain the target document. Converting the target object including table content into an image format can ensure the integrity of the table content and avoid deformation of the table size and font due to incompatible document formats.
[0094] In the disclosed embodiment, in response to a trigger operation, a target object is determined from the body of the first document; based on the layout information of the target object in the first document, the target object is added to a target page located in the body of the second document to obtain a target document. The target object in the body of the first document can be inserted into the target page in the body of the second document, and the target object in the first document can be added to the target page in the second document by automatic matching, so as to realize automatic input of the content of documents of different formats without requiring additional operations, and improve the efficiency of information input, and the processing of the content of the body can reduce the noise generated by other non-core content, and improve the accuracy of the target document.
[0095] In some embodiments, the method further comprises:
[0096] Based on the target object and the associated information of the target object in the first document, obtaining first text content;
[0097] Analyze the first text content and the second text content of the second document to obtain an analysis result;
[0098] A target page is determined from among the pages of the second document based on the analysis result.
[0099] Here, after determining the target object, the first text content can be obtained based on the associated information of the target object in the first document, and the first document to be processed can be determined based on the first text content. The first document to be processed can be a collection of first text contents. In some embodiments, first index information can be configured for each first text content, and each first text content can be identified based on each first index information to obtain the first document to be processed.
[0100] In some other embodiments, the second document to be processed may also be determined based on the second text content of the second document. The second document to be processed may be a collection of second text contents. In some embodiments, second index information may be configured for each second text content, and each second text content may be identified based on each second index information to obtain the second document to be processed. Analyzing the first text content and the second text content may include: analyzing the first document to be processed and the second document to be processed.
[0101] In some embodiments, each second text content may correspond to each page in the second document, and each second text content may correspond to a page in the second document. Exemplarily, each second text content corresponds to a text page in the second document.
[0102] It should be noted that after determining the target object, the associated information of the target object in the first document can be determined, wherein the associated information of the target object in the first document can include: context information of the target object in the first document, which can be text information related to the target object in the first document. For example, if the target object is an object including image content, the associated information of the target object can be text information of the paragraph where the image content is located and / or text information of paragraphs adjacent to the image content.
[0103] In some embodiments, semantic understanding of the first document can be performed based on a pre-trained semantic analysis model to determine context information of the target object in the first document, and the first text content can be obtained based on the context information of the target object in the first document. The semantic analysis model is, for example, a pre-trained language (Generative Pre-trained Transformer, GPT) model based on the Transformer architecture.
[0104] After obtaining the first text content, semantic analysis can be performed on the first text content and the second text content of the second document based on the semantic analysis model to obtain an analysis result. It should be noted that the first text content corresponding to a target object can be one or more; the second text content corresponding to a page in the second document can be one or more.
[0105] The analysis result obtained by analyzing the first text content and the second text content can indicate the correlation between the first text content and the second text content. The greater the correlation between the first text content and the second text content, the higher the matching degree between the target object corresponding to the first text content and the page corresponding to the second text content.
[0106] In the disclosed embodiment, the first text content can be obtained based on the target object and the associated information of the target object in the first document, and the target page can be determined from each page of the second document based on the analysis result obtained by analyzing the first text content and the second text content of the second document. By jointly determining the first text content through the target object and the associated information of the target object, the amount of information in the first text content can be increased, making the determined analysis result more comprehensive, and improving the accuracy of the obtained analysis result, thereby improving the matching degree between the target object and the target page.
[0107] In some embodiments, analyzing the first text content and the second text content of the second document to obtain analysis results includes:
[0108] Analyze the first text content and the second text content to obtain the similarity between the first text content and the second text content;
[0109] Determining a target page from the pages of the second document based on the analysis result includes:
[0110] The page where the second text content having a similarity with the first text content greater than a preset threshold is located is determined as the target page.
[0111] In some embodiments, the first text content and the second text content can be semantically analyzed based on a pre-trained semantic analysis model to obtain the similarity between the first text content and the second text content. The semantic analysis model may include: a pre-trained language (Generative Pre-trained Transformer, GPT) model based on a Transformer architecture. Exemplarily, the first text content and the second text content can be input into a GPT model, and the similarity between the first text content and the second text content can be output.
[0112] After obtaining the similarity between the first text content and the second text content, it can be determined whether the similarity between the first text content and the second text content is greater than a preset threshold. When the similarity between the first text content and the second text content is less than or equal to the first threshold, it is determined that the page where the second text content is located is not the target page. When the semantic similarity between the first text content and the second text content is greater than the first threshold, it is determined that the page where the second text content is located is the target page.
[0113] The similarity between the first text content and the second text content may be the semantic similarity between the first text content and the second text content, that is, the first text content may be semantically understood, and the second text content may be semantically understood, and then the semantic similarity between the first text content and the second text content may be obtained based on the result of the semantic understanding.
[0114] In the embodiment of the present disclosure, by performing semantic analysis on the first text content and the second text content, the similarity between the first text content and the second text content is determined, and the page where the second text content whose similarity to the first text content is greater than a preset threshold is located is determined as the target page, which can make the determined target page more matched with the target object, thereby improving the accuracy of the determined target document.
[0115] In some embodiments, obtaining the first text content based on the target object and the associated information of the target object in the first document includes:
[0116] Based on the association information of the target object in the first document, determining the associated object of the target object from the first document;
[0117] The text content in the associated object is determined as the first text content.
[0118] Taking the example that the associated information is the context information of the target object in the first document, the associated objects of the target object can be determined from the first document based on the context information of the target object in the first document, where the associated objects may include: the target paragraph where the target object is located and / or paragraphs adjacent to the target paragraph.
[0119] In some embodiments, determining the associated object of the target object from the first document based on the associated information of the target object in the first document includes:
[0120] If the number of target objects is less than or equal to a first preset number, determining a first number of associated objects from the first document based on the associated information;
[0121] When the number of target objects is greater than a first preset number, a second number of associated objects is determined from the first document based on the associated information.
[0122] The first number is greater than the second number.
[0123] In the disclosed embodiment, after the target objects are determined, the number of the determined target objects can be counted, and the number of associated objects can be determined based on the number of target objects. The number of associated objects corresponding to different determined target objects can also be different. For example, the number of target objects is negatively correlated with the number of associated objects, that is, the fewer the number of target objects, the more the number of associated objects, and the more the number of target objects, the fewer the number of associated objects.
[0124] In the embodiment of the present disclosure, when the number of target objects is less than or equal to the first preset number, a first number of associated objects is determined from the first document based on the association relationship, and when the number of target objects is greater than the first preset number, a second number of associated objects is determined from the first document based on the association relationship, wherein the first number is greater than the second number. The first preset number can be determined as needed, and illustratively, the first preset number can be 30.
[0125] Exemplarily, if the target objects are pictures and tables in the first document, the number of target objects is the total number of pictures and tables. If the total number of pictures and tables is greater than 30, the non-blank paragraphs above and below the target objects, and the paragraphs containing pictures and tables with captions, are determined as associated objects.
[0126] If the total number of images and tables is less than or equal to 30, the third-level titles of the images and tables, all the text content of the third-level titles, captions, placeholders for images and tables, the second-level titles corresponding to the third-level titles, and the paragraphs containing the first-level titles will be determined as associated objects.
[0127] After determining the associated object, the text content in the associated object can be determined as the first text content, and each first text content can be sorted according to the document order. For example, the first text content is identified by the first index information (P), the caption is displayed in the original text, the table placeholder is identified by [^T1], and the image placeholder is identified by [^S1].
[0128] In the disclosed embodiment, by associating the number of target objects with the number of associated objects, the number of associated objects to be determined can be dynamically determined based on the number of target objects. When the number of target objects is relatively large, the number of associated objects to be determined is relatively small, which can reduce the amount of data to be analyzed and improve data processing efficiency; when the number of target objects is relatively small, the number of associated objects to be determined is relatively large, which can improve the accuracy of the first text content.
[0129] After the associated object is determined, the text content in the associated object may be determined as the first text content.
[0130] Exemplarily, after determining the target paragraph where the target object is located and / or the paragraphs adjacent to the target paragraph, the text content in the target paragraph where the target object is located and / or the paragraphs adjacent to the target paragraph may be determined as the first text content.
[0131] In some embodiments, each first text content may be stored in the form of a paragraph. For example, one paragraph corresponds to one first text content. Exemplarily, a target paragraph corresponds to one text content, a first paragraph adjacent to the target paragraph corresponds to one first text content, and a second paragraph adjacent to the target paragraph corresponds to one first text content.
[0132] By making each first text content correspond to a paragraph, it is possible to provide convenience for analyzing the text content.
[0133] In the disclosed embodiment, the associated object of the target object can be determined from the first document based on the associated information of the target object in the first document. Since the associated object includes the target paragraph where the target object is located and / or the segment adjacent to the target paragraph, the text content in the associated object is determined as the first text content. By fully understanding the associated information and obtaining the first text content, the accuracy of the analysis can be improved, thereby improving the matching degree between the target object and the target page, and improving the accuracy of the obtained target document.
[0134] In some embodiments, the first text content has first index information, and the second text content has second index information; when the target page is determined, the method further includes:
[0135] Establishing an association relationship between the target object and the target page based on the first index information and the second index information;
[0136] Adding the target object to a target page matching the target object in the second document to obtain a target document includes:
[0137] Based on the association relationship, the target object is added to a target page matching the target object in the second document to obtain a target document.
[0138] It should be noted that the index information is used to indicate the position of the text content in the document. For example, the first index information is used to indicate the position of the first text content in the first document, and the second index information is used to indicate the position of the second text content in the second document.
[0139] like Figure 3 , showing the first text content identified by the first index information P3; Figure 4 As shown, the second text content is identified by the second index information DG21. Figure 3In the example, P3 corresponds to the target object, and P1 and P2 correspond to the associated objects of the target object. Figure 4 In the figure, the pages corresponding to DG19, DG20 and DG22 are respectively adjacent to or spaced apart from the page corresponding to DG21.
[0140] When a second text content (DG21) having a similarity with the first text content (P3) greater than a preset threshold is determined, an association relationship between the first index information of the target object ([^T2]) corresponding to the first text content (P3) and the second text content (DG21) can be established, such as Figure 5 The first row is shown.
[0141] The association relationship in this disclosure can be expressed as Figure 5 . Among them, "src" represents the placeholder of the target object, for example, the placeholder of a picture or table; "id" represents the caption of the target object; "name" represents the name of the target object, for example, the name of a picture or table; "paraId" represents the first index information of the first text content corresponding to the target object, and "level" represents the second index information of the second text content.
[0142] In the disclosed embodiment, by configuring first index information for the first text content, configuring second index information for the second text content, and establishing an association relationship between the target object and the target page based on the first index information and the second index information, and then based on the association relationship, adding the target object to the target page that matches the target object in the second document to obtain the target document, the matching efficiency of the target object and the target page can be improved.
[0143] In some embodiments, adding the target object to the target page based on layout information of the target object in the first document includes:
[0144] Based on the layout information of the target object in the first document and / or the layout information of the target page, the target object is adjusted to obtain an adjusted target object, and the adjusted target object is inserted into the target page; and / or,
[0145] Based on the layout information of the target object in the first document and / or the layout information of the target page, the layout style of the target page is adjusted to obtain an adjusted target page, and the target object is inserted into the adjusted target page.
[0146] It should be noted that the layout information of the target object in the first document may include at least one of the following: position information of the target object in the first document, size information of the target object, style information of the target object, etc. For example, if the target object is an object including picture content, the layout information of the target object may include at least one of the following: layout position of the picture in the first document, height information of the picture, width information of the picture, etc.
[0147] The layout information of the target page may include at least one of the following: a layout style of the target page, a layout size of the target page, a background style of the target page, a template of the target page, and the like.
[0148] The adjustment of the target object includes at least one of the following: adjusting the size of the target object; adjusting the content of the target object; adjusting the layout style of the target object; adjusting the format of the target object, etc.
[0149] The adjustment of the target page includes at least one of the following: adjusting the layout style of the target page; adjusting the display content of the target page; adjusting the background style of the target page, etc.
[0150] Exemplarily, when it is determined that the size of the target object does not match the size of the target page based on the layout information of the target object in the first document and / or the layout information of the target page, the size of the target object can be adjusted to obtain an adjusted target object, and the adjusted target object can be inserted into the target page. For example, when the initial size of the target object is larger than the display size of the target page, the target object can be reduced, and the reduced target object can be inserted into the target page.
[0151] As another example, when it is determined that the target object is to be inserted into the target position of the target page based on the layout information of the target object in the first document and / or the layout information of the target page, the content at the target position in the target page can be moved to a non-target position to obtain an adjusted target page, and the target object can be inserted into the target position of the target page.
[0152] In the disclosed embodiment, by adjusting the layout style of the target object and / or the target page, the matching degree between the target object and the target page can be improved, so that the determined target document better meets the user's needs.
[0153] In some embodiments, based on the layout information of the target object in the first document, adding the target object to a target page matching the target object in the second document to obtain the target document includes:
[0154] When the number of target objects corresponding to the same target page is less than or equal to a second preset number, inserting each target object into the same target page based on layout information of the target object in the first document to obtain a target document;
[0155] When the number of target objects corresponding to the same target page is greater than a second preset number, inserting the target objects into groups into the target page and an associated page of the target page based on layout information of the target objects in the first document;
[0156] The associated pages include: pages created based on the target page and / or pages in the second document that are associated with the target page.
[0157] In some embodiments, each target object may be reduced or enlarged, and the reduced or enlarged target object may be inserted into the target page.
[0158] In some embodiments, based on the layout information of the target object in the first document, adding the target object to a target page in the second document that matches the target object to obtain the target document includes: based on the layout information of the target object in the first document, adding the target object and the annotation information of the target object to a target page in the second document that matches the target object to obtain the target document. The annotation information of the target object includes: a caption of the target object.
[0159] It should be noted that each target page may correspond to one or more target objects. Figure 5 As shown, the target objects [^T5], [^S2] and [^S3] all correspond to the target page where the second text content DG31 is located, that is, the same target page corresponds to three target objects.
[0160] In some embodiments, the second preset number can be determined according to the layout information of the target page, for example, according to the limit layout number of the target page, where the limit layout number is used to indicate the maximum number of target objects that can be laid out in the target page. In other embodiments, the second preset number can also be customized, for example, it can be two, and the user can automatically adjust it as needed.
[0161] In the embodiment of the present disclosure, when the number of target objects corresponding to the same target page is less than or equal to the second preset number, each target object can be inserted into the same target page based on the layout information of the target object in the first document. Exemplarily, when there is only one target object, the target object can be inserted into the middle position of the target page based on the position information of the target object in the first document.
[0162] In the case where there are two target objects, the two target objects are overall arranged in the middle of the target page, and the target position of each target object in the target page is determined according to the position information of each target object in the first document. Exemplarily, if the first target object is located before the second target object in the first document, when the two target objects are arranged in a left-right layout, the first target object is located to the left of the second target object on the target page; when the two target objects are arranged in a top-bottom layout, the first target object is located above the second target object.
[0163] like Figure 6 and Figure 7 As shown, when there are two target objects, the types of the two target objects are the same, such as Figure 6 As shown, the target object may include a first table image 601 and a second table image 602; the types of the two target objects may also be different, such as Figure 7 As shown, the target object may include a picture 701 and a picture 702 of a table.
[0164] When the number of target objects corresponding to the same target page is greater than a second preset number, the target objects can be grouped and inserted into the target page and the associated pages of the target page based on the layout information of the target objects in the first document; wherein the associated pages include: pages created based on the target page and / or pages in the second document that have an associated relationship with the target page.
[0165] Here, the associated page may be a page created based on the target page, in which case the associated page has the same layout as the target page. The associated page may also be a page associated with the target page, for example, the associated page may be a page adjacent to the target page.
[0166] In the disclosed embodiment, the target objects can be inserted into the second document in different ways based on the number of target objects corresponding to the same target page. When the number of target objects corresponding to the same target page is relatively small, the target objects can be inserted into the same target page in a unified layout manner, thereby achieving visual unification. When the number of target objects corresponding to the same target page is relatively large, the target objects can be grouped and inserted into the target page and the associated pages of the target page, thereby ensuring the clarity and classification of the display of each target object on the basis of achieving visual unification.
[0167] In some embodiments, when the number of target objects corresponding to the same target page is greater than a second preset number, grouping and inserting the target objects into the target page and the associated page of the target page based on the layout information of the target objects in the first document includes:
[0168] When the number of target objects corresponding to the same target page is greater than a second preset number, grouping the target objects based on the types of the target objects and the preset reference number;
[0169] Based on the layout information of the target objects in the first document, each group of target objects is inserted into the target page and the associated page respectively.
[0170] In some embodiments, the preset reference number can be determined according to the layout information of the target page, for example, according to the limit layout number of the target page, where the limit layout number is used to indicate the maximum number of target objects that can be laid out in the target page. In other embodiments, the preset reference number can also be customized, for example, it can be three, and the user can automatically adjust it as needed.
[0171] In the embodiment of the present disclosure, when the number of target objects corresponding to the same target page is greater than the second preset number, the target objects may be grouped based on the type of the target objects and the preset reference number. For example, target objects of the same type may be grouped into one group, and the number of target objects in each group is equal to the preset reference number. Exemplarily, target objects including picture content may be grouped into one group, and target objects including table content may be grouped into one group.
[0172] When each group of target objects is obtained, each group of target objects may be respectively inserted into the target page and the associated page based on the layout information of the target objects in the first document.
[0173] like Figure 8 and Fig. 9 As shown, when the target object includes table content and picture content, three target objects including table content can be inserted into the target page 801, and three target objects including picture content can be inserted into the associated page 901 of the target page 801, wherein the associated page 901 is the next page of the target page 801.
[0174] In some embodiments, after the target objects are grouped, the layout information of each target object in the second document may be determined based on the layout information of each target object in the first document. For example, the arrangement order of each target object in the second document may be determined based on the position information of each target object in the first document.
[0175] When the target object is inserted into the target page and / or the associated page, the annotation information (caption) of the target object is inserted into the target page and / or the associated page.
[0176] In the disclosed embodiment, when the number of target objects is relatively large, the target objects can be grouped based on the type of the target objects and a preset reference number, and each group of target objects can be inserted into the target page and the associated page respectively based on the layout information of the target objects in the first document. The same type of target objects can be inserted into the same page, so that the format of each page in the target document is more visually unified.
[0177] In some embodiments, adding the target object to a target page in the second document that matches the target object to obtain the target document includes:
[0178] In response to adding the target object to the target page, non-target objects except the target text box in the target page are deleted to obtain the target document.
[0179] Here, the target text box may be the first text box in the target page.
[0180] In the embodiment of the present disclosure, after adding the target object to the target page, non-target objects except the target text box in the target page can be deleted to obtain the target document, which can highlight the target object and reduce the interference of non-target objects on the display of the target object. Since the target text box is likely to be the title of the target page, the readability of the target document can be improved by retaining the target text box.
[0181] In other embodiments, the target text box can be determined from the target page based on the first text content corresponding to the target object and the second text content corresponding to the target page. For example, the text box containing the text with the highest similarity to the first text content corresponding to the target object can be determined as the target text box.
[0182] Fig.10 The following is a flow chart of a document processing method according to an exemplary embodiment. Figure 2 .like Fig.10 As shown, the method mainly includes the following steps:
[0183] In step 1001, a body portion of a first document is determined;
[0184] In step 1002, a target object is determined from a body portion of a first document;
[0185] In step 1003, the layout information of the target object in the first document is obtained;
[0186] In step 1004 , it is determined whether the number of target objects is greater than a first preset number. If the number of target objects is greater than the first preset number, step 1005 is executed; otherwise, step 1006 is executed.
[0187] In step 1005, a second number of associated objects is determined from the first document;
[0188] In step 1006, a first number of associated objects is determined from the first document;
[0189] In step 1007, the text content in the associated object is determined as the first text content;
[0190] In step 1008, the first text content and the second text content in the second document are analyzed to obtain analysis results, a target page is determined from pages of the second document based on the analysis results, and an association relationship between the target object and the target page is established based on the first index information of the first text content and the second index information of the second text content;
[0191] In step 1009, based on the association relationship and the current scenario, the target object is added to a target page in the second document that matches the target object;
[0192] In step 1010, when the number of target objects corresponding to the same target page is less than or equal to the second preset number, each target object is inserted into the same target page based on the layout information of the target object in the first document.
[0193] In step 1011, when the number of target objects corresponding to the same target page is greater than a second preset number, the target objects are grouped and inserted into the target page and the associated page of the target page based on the layout information of the target objects in the first document;
[0194] In step 1012, the target document is obtained.
[0195] Fig.11 FIG. 1 is a block diagram of a document processing device according to an exemplary embodiment. Fig.11 As shown, the device 1100 mainly includes:
[0196] A first determining module 1101 is configured to determine a target object from a first document in response to a triggering operation on the first document, and obtain layout information of the target object in the first document;
[0197] A generating module 1102 is configured to add the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document, so as to obtain a target document;
[0198] The first document and the second document are in different document formats.
[0199] In some embodiments, the apparatus 1100 further includes:
[0200] A second determination module is configured to obtain first text content based on the target object and association information of the target object in the first document;
[0201] An analysis module, configured to analyze the first text content and the second text content of the second document to obtain an analysis result;
[0202] The third determination module is configured to determine the target page from the pages of the second document based on the analysis result.
[0203] In some embodiments, the analysis module is configured to:
[0204] Analyzing the first text content and the second text content to obtain a similarity between the first text content and the second text content;
[0205] The third determining module is configured to:
[0206] The page where the second text content having a similarity with the first text content greater than a preset threshold is located is determined as the target page.
[0207] In some embodiments, the first text content has first index information, and the second text content has second index information; when the target page is determined, the device 1100 further includes:
[0208] A construction module, configured to establish an association relationship between the target object and the target page based on the first index information and the second index information;
[0209] The generating module 1102 is configured to:
[0210] Based on the association relationship, the target object is added to a target page in the second document that matches the target object to obtain the target document.
[0211] In some embodiments, the second determining module is configured to:
[0212] Determining an associated object of the target object from the first document based on associated information of the target object in the first document;
[0213] The text content in the associated object is determined as the first text content.
[0214] In some embodiments, the second determining module is configured to:
[0215] In a case where the number of the target objects is less than or equal to a first preset number, determining a first number of the associated objects from the first document based on the associated information;
[0216] In a case where the number of the target objects is greater than the first preset number, a second number of the associated objects is determined from the first document based on the associated information.
[0217] In some embodiments, the generating module 1102 is configured to:
[0218] Based on the layout information of the target object in the first document and / or the layout information of the target page, the target object is adjusted to obtain an adjusted target object, and the adjusted target object is inserted into the target page; and / or,
[0219] Based on the layout information of the target object in the first document and / or the layout information of the target page, the layout style of the target page is adjusted to obtain an adjusted target page, and the target object is inserted into the adjusted target page.
[0220] In some embodiments, the generating module 1102 is configured to:
[0221] When the number of the target objects corresponding to the same target page is less than or equal to a second preset number, inserting each of the target objects into the same target page based on layout information of the target objects in the first document to obtain the target document;
[0222] When the number of the target objects corresponding to the same target page is greater than the second preset number, based on the layout information of the target objects in the first document, inserting the target objects into groups into the target page and the associated pages of the target page;
[0223] The associated pages include: pages created based on the target page and / or pages in the second document that are associated with the target page.
[0224] In some embodiments, the generating module 1102 is configured to:
[0225] When the number of the target objects corresponding to the same target page is greater than the second preset number, grouping the target objects based on the types of the target objects and the preset reference number;
[0226] Based on the layout information of the target objects in the first document, each group of the target objects is inserted into the target page and the associated page respectively.
[0227] In some embodiments, the first determining module 1101 is configured to:
[0228] In response to the trigger operation, determining the target object from the body portion of the first document;
[0229] The step of adding the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document to obtain the target document comprises:
[0230] Based on the layout information of the target object in the first document, the target object is added to a target page located in the body part of the second document to obtain the target document.
[0231] In some embodiments, the generating module 1102 is configured to:
[0232] In response to adding the target object to the target page, non-target objects except the target text box in the target page are deleted to obtain the target document.
[0233] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0234] Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, which may be a computer or a terminal in one or more of the above embodiments. Fig.12 FIG. 1 is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment. Fig.12 As shown, the electronic device 1200 adopts general computer hardware and includes a processor 1201 , a memory 1202 , a bus 1203 , an input device 1204 , and an output device 1205 .
[0235] In some possible implementations, the memory 1202 may include computer storage media in the form of volatile and / or non-volatile memory, such as read-only memory and / or random access memory. The memory 1202 may store an operating system, application programs, other program modules, executable code, program data, user data, etc.
[0236] The input device 1204 can be used to input commands and information to the electronic device, such as a keyboard or a pointing device, such as a mouse, trackball, touchpad, microphone, joystick, game pad, satellite TV antenna, scanner or similar device. The input device 1204 can be connected to the processor 1201 via the bus 1203.
[0237] The output device 1205 can be used to output information to the electronic device 1200 . In addition to the monitor, the output device 1205 can also be other peripheral output devices, such as a speaker and / or a printing device. The output device 1205 can also be connected to the processor 1201 via the bus 1203 .
[0238] The electronic device 1200 may be connected to a network, such as a local area network (LAN), via an antenna 1206. In a networked environment, executable instructions may be stored in a remote storage device, rather than being limited to local storage.
[0239] When the processor 1201 in the electronic device 1200 executes the executable code or application stored in the memory 1202, the electronic device 1200 can implement the file processing method in the above embodiment. The specific execution process refers to the above embodiment and will not be repeated here.
[0240] The memory 1202 may store information for implementing Fig.11 The executable instructions of the functions of the first determination module 1101 and the generation module 1102. Fig.11 The functions / implementation processes of the first determination module 1101 and the generation module 1102 can be realized by Fig.12 The processor 1201 in the embodiment calls the executable instructions stored in the memory 1202 to implement the above-mentioned implementation process and functions.
[0241] Based on the same inventive concept, the embodiment of the present disclosure further provides a storage medium in which instructions are stored. When the instructions are executed on a computer, the document processing method in one or more of the above embodiments is executed.
[0242] Based on the same inventive concept, the embodiments of the present disclosure further provide a computer program or a computer program product. When the computer program product is executed on a computer, the computer implements the document processing method in one or more of the above embodiments.
[0243] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0244] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A document processing method, characterized in that: include: In response to a trigger operation on a first document, determining a target object from the first document, and acquiring layout information of the target object in the first document; Based on the layout information of the target object in the first document, adding the target object to a target page matching the target object in the second document to obtain a target document; The first document and the second document are in different document formats.
2. The method according to claim 1, characterized in that The method further comprises: Obtaining first text content based on the target object and association information of the target object in the first document; Analyze the first text content and the second text content of the second document to obtain an analysis result; The target page is determined from pages of the second document based on the analysis result.
3. The method according to claim 2, characterized in that The analyzing the first text content and the second text content of the second document to obtain an analysis result includes: Analyzing the first text content and the second text content to obtain a similarity between the first text content and the second text content; The determining the target page from pages of the second document based on the analysis result includes: The page where the second text content having a similarity with the first text content greater than a preset threshold is located is determined as the target page.
4. The method according to claim 2, characterized in that: The first text content has first index information, and the second text content has second index information; When the target page is determined, the method further includes: Based on the first index information and the second index information, establishing an association relationship between the target object and the target page; The step of adding the target object to a target page in the second document that matches the target object to obtain a target document includes: Based on the association relationship, the target object is added to a target page in the second document that matches the target object to obtain the target document.
5. The method according to claim 2, characterized in that: The obtaining of first text content based on the target object and the associated information of the target object in the first document includes: Determining an associated object of the target object from the first document based on associated information of the target object in the first document; The text content in the associated object is determined as the first text content.
6. The method according to claim 5, characterized in that The determining, from the first document, an associated object of the target object based on the associated information of the target object in the first document includes: In a case where the number of the target objects is less than or equal to a first preset number, determining a first number of the associated objects from the first document based on the associated information; In a case where the number of the target objects is greater than the first preset number, a second number of the associated objects is determined from the first document based on the associated information.
7. The method according to claim 1, characterized in that The adding the target object to the target page based on the layout information of the target object in the first document includes: Based on the layout information of the target object in the first document and / or the layout information of the target page, the target object is adjusted to obtain an adjusted target object, and the adjusted target object is inserted into the target page; and / or, Based on the layout information of the target object in the first document and / or the layout information of the target page, the layout style of the target page is adjusted to obtain an adjusted target page, and the target object is inserted into the adjusted target page.
8. The method according to claim 1, characterized in that The step of adding the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document to obtain a target document includes: When the number of the target objects corresponding to the same target page is less than or equal to a second preset number, inserting each of the target objects into the same target page based on layout information of the target objects in the first document to obtain the target document; When the number of the target objects corresponding to the same target page is greater than the second preset number, based on the layout information of the target objects in the first document, inserting the target objects into groups into the target page and the associated pages of the target page; The associated pages include: pages created based on the target page and / or pages in the second document that are associated with the target page.
9. The method according to claim 8, characterized in that When the number of the target objects corresponding to the same target page is greater than the second preset number, inserting the target objects into groups into the target page and the associated pages of the target page based on the layout information of the target objects in the first document includes: When the number of the target objects corresponding to the same target page is greater than the second preset number, grouping the target objects based on the types of the target objects and the preset reference number; Based on the layout information of the target objects in the first document, each group of the target objects is inserted into the target page and the associated page respectively.
10. The method according to any one of claims 1 to 9, characterized in that: The step of determining a target object from the first document in response to a triggering operation on the first document comprises: In response to the trigger operation, determining the target object from the body portion of the first document; The step of adding the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document to obtain a target document includes: Based on the layout information of the target object in the first document, the target object is added to a target page located in the body part of the second document to obtain the target document.
11. The method according to any one of claims 1 to 9, characterized in that: The step of adding the target object to a target page in the second document that matches the target object to obtain a target document includes: In response to adding the target object to the target page, non-target objects except the target text box in the target page are deleted to obtain the target document.
12. A document processing device, characterized in that: include: a determination module, configured to determine a target object from a first document in response to a trigger operation on the first document, and obtain layout information of the target object in the first document; A generating module, configured to add the target object to a target page matching the target object in the second document based on the layout information of the target object in the first document, to obtain a target document; The first document and the second document are in different document formats.
13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Document processing method and apparatus, and computer program product
WO2026108873A1