Document synthesis method and electronic equipment
By running applications on electronic devices and synthesizing documents with one-click pop-up windows and controls, the problem of difficult centralized management and merging of favorite content in traditional solutions is solved, and a flexible document editing experience and simplified operation process is achieved.
Patent Information
- Application Number
- CN202410042655.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-07-18
AI Technical Summary
The collection content of different applications in traditional electronic devices is difficult to centrally manage and merge into documents, resulting in users requiring tedious manual operations and inflexible editing experience, especially when inserting file attachments, the user experience is poor.
Provide a method to synthesize documents. By running the application on an electronic device and displaying the interface, users can select a variety of materials, use pop-up windows and controls to synthesize target documents in one click, supporting the generation of multiple document formats, including word, pdf, etc., automatically parsing the file content and merging it into the document.
The function of combining multiple materials into target documents in one-click is realized, which simplifies user operations, improves the flexibility and user experience of editing documents, and can parse the file content instead of just displaying it as attachments, reducing the cumbersome copy and paste steps.
Smart Images

Figure CN120335692A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electronic devices, and in particular, to a method for synthesizing a document and an electronic device. Background Art
[0002] In traditional electronic devices, collections can only be scattered in different applications, which is inconvenient to search. Moreover, the collection methods for various elements such as text, pictures, videos, audios, web pages, and files are different. In order to facilitate users to manage and use these elements scattered in various applications in different forms, R & D personnel have tried to design a new application in which users can put all the content they want to collect across applications for centralized management.
[0003] On the basis of this solution, new requirements have emerged, that is, the subsequent usage requirements of these collected contents. If a user wants to merge a lot of collected materials into a document, especially materials of different types, the traditional solution can only be achieved by manually creating a document and then manually copying and pasting. That is to say, the user can only manually create a document, then open each application one by one, find the materials collected in each application, and then manually add text and pictures to the created document in the form of copying and pasting one by one. Moreover, when inserting a file into the created document, the inserted file only exists in the form of an attachment, and the user can only use the corresponding other application of this file to open this file by double-clicking the corresponding icon of the inserted file in the document. In addition, even for multiple collections in the same application, for example, when multiple web pages are collected in the browser application, the user still needs to open each collected web page in the browser application one by one during the above-mentioned manual document editing operation, then find the required content, and then select, copy, and paste it into the created document. It can be seen that this collection method has very limited improvement in the convenience of editing documents.
[0004] In short, in the traditional solution, when generating a document using the collected content, it requires cumbersome and complex manual operations, consuming a lot of energy and time, and the generated document is not flexible enough during subsequent editing, especially in the case of inserting file attachments, resulting in a poor user experience. Summary of the Invention
[0005] This application provides a method for synthesizing a document and an electronic device, which realizes the function of synthesizing multiple and / or multiple materials into a target document with one click. That is, after selecting the materials, only by clicking on the controls of the target document, all the selected materials can be synthesized into the target document.
[0006] In a first aspect, a method for synthesizing a document is provided. The method includes: running a first application on an electronic device and displaying a first interface, where the first interface includes multiple materials, and the multiple materials include at least one of text, picture, video, audio, word file, ppt file, pdf file, excel file, txt file, offline html file, video excerpt, and global annotation; in response to a user's selection operation on at least one of the multiple materials, displaying a first pop-up window in the first interface, and displaying a first material set in the first pop-up window, where the first material set includes all selected materials and all selected materials are sorted in the order of selection; in response to a user's click operation on a first control in the first pop-up window, displaying a second pop-up window, where the second pop-up window includes at least one document generation control, and each document generation control corresponds to a document generation function; in response to a user's click operation on the word document generation control in the second pop-up window, merging all materials in the first material set into a target word document, and the word document generation control is used to indicate the generation of a word document.
[0007] In the technical solution of this application, the function of synthesizing multiple and / or a plurality of materials into a target document is realized. That is, after the materials are selected, only by clicking on the control of the target document, all selected materials can be synthesized into the target document. Thus, it solves the cumbersome process in the traditional solution where users can only manually search for materials from different applications and manually copy and paste or insert them in the form of inserted objects when editing a document, and the inserted files no longer only appear in the form of small icons of inserted attachments, but can parse the content of the files and add them to the document, which is convenient for users to perform subsequent editing. This solution is more flexible than the traditional solution and improves the user experience.
[0008] In combination with the first aspect, in some implementation manners of the first aspect, the second pop-up window further includes a pdf document generation control, and the pdf document generation control is used to indicate the generation of a pdf document. The above method further includes: in response to a user's click operation on the pdf document generation control, merging all materials in the first material set into a target pdf document. In this implementation manner, an example of the interaction process for synthesizing a pdf document is given. That is to say, the solution of the embodiment of this application can be used not only to synthesize word documents, but also to synthesize pdf documents.
[0009] In combination with the first aspect, in certain implementations of the first aspect, when all the materials in the first material set are merged into a target PDF document in response to a user's click operation on the PDF document generation control, it may include: merging all the materials in the first material set into a first Word document; converting the first Word document into the target PDF document. Since the editable function of PDF is much weaker than that of Word documents, in order to enable more types of materials to generate PDF documents, a method of first synthesizing into a Word document and then converting it into a PDF document is provided.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the second pop-up window further includes a TXT document generation control or a long picture document generation control. The TXT document generation control is used to indicate the generation of a TXT document, and the long picture document generation control is used to indicate the generation of a long picture. The above method further includes: when the first material set only includes multiple text materials, in response to a user's click operation on the TXT document generation control, merging all the text materials in the first material set into a TXT document in the selected order; or, when the first material set only includes multiple picture materials and / or global annotation materials, in response to a user's click operation on the long picture document generation control, converting all the picture materials and / or the pictures converted from all the global annotation materials in the first material set into a long picture document in the selected order. In this implementation, the execution process of how to synthesize when the target document is a TXT document or a long picture document is given. Since the types of materials supported by these two types of documents are single, only insertion in order is required during merging.
[0011] In an example, the number of pages of the long picture document is less than or equal to a preset page number threshold.
[0012] In another implementation, the second pop-up window further includes a long picture document generation control. The above method further includes: creating a fourth Word document, merging all the materials in the first material set into the fourth Word document to obtain a fifth Word document, and converting the fifth Word document into a long picture document. In this implementation, the editing ability of the Word document is still utilized. First, a Word document is generated and then converted into a long picture document. The relevant process can refer to the execution process when the target document is a PDF document and will not be elaborated here.
[0013] In combination with the first aspect, in some implementations of the first aspect, after displaying the second pop-up window in response to the user's click operation on the second control in the first pop-up window, the above method further includes: when the first material set includes at least one of video, audio, word file, ppt file, pdf file, excel file, and video excerpt, displaying a word document generation control in the second pop-up window; or, when the first material set only includes at least one of text, picture, offline html file, and global annotation, displaying a word document generation control and a pdf document generation control in the second pop-up window; or, when the first material set only includes text materials, displaying a word document generation control, a pdf document generation control, and a txt document generation control in the second pop-up window; or, when the first material set only includes at least one of picture and global annotation, displaying a word document generation control, a pdf document generation control, and a long picture document generation control in the second pop-up window. In this implementation, the at least one document generation control can be displayed as different combinations based on the type of the selected material, which is convenient for the user to select.
[0014] In another implementation, the at least one document generation control can be a control that includes all synthesizable document types, and only some of the document generation controls are set to an inoperable state based on the type of the selected material. This can also be convenient for the user to select.
[0015] In combination with the first aspect, in some implementations of the first aspect, when all the materials in the first material set are combined into a target Word document in response to a user's click operation on the Word document generation control in the second pop-up window, it may include: creating an empty second Word document; performing at least one of the following operations according to the materials in the first material set: when the first material set includes at least one text material, creating a corresponding text insertion paragraph for each text material in the second Word document, and inserting the content of each text material in the at least one text material into the corresponding text insertion paragraph of the text material in the second Word document while retaining the original line breaks, spaces, and relative position information; when the first material set includes at least one picture material, creating a corresponding picture insertion paragraph for each picture material in the second Word document, reading the at least one picture material into the second Word document by means of a stream, and inserting each picture into the corresponding picture insertion paragraph of the picture; when the first material set includes at least one video material, creating a video insertion paragraph for each video material in the second Word document, for each video material, inserting the first frame image of the video material as a thumbnail into the corresponding video insertion paragraph of the video material, reading the video stream of the video material into the second Word document, and inserting the read video stream into the corresponding video insertion paragraph of the video material; when the first material set includes at least one audio material, creating an audio insertion paragraph for each audio material in the second Word document, for each audio material, inserting the title information of the audio material into the corresponding audio insertion paragraph of the audio material, reading the audio stream of the audio material into the second Word document, and inserting the read audio stream into the corresponding audio insertion paragraph of the audio material; when the first material set includes at least one Excel file, for each Excel file, creating a table with the same number of worksheets as in the Excel file in the second Word document, traversing the Excel file, and merging the content of each worksheet in the Excel file into the table corresponding to the worksheet in the second Word document while retaining the format; when the first material set includes at least one Word file, merging the content of each Word file into the second Word document while retaining the format in the relative order in which the Word file is selected; when the first material set includes at least one TXT file, merging the content of each TXT file into the second Word document in the relative order in which the TXT file is selected; when the first material set includes at least one PPT file, for each PPT file, converting each page of the PPT file into a picture, and inserting the converted pictures into the second Word document while retaining the original page order;When the first material set includes at least one PDF file, for each PDF file, each page of the PDF file is converted into a picture, and the converted pictures are inserted into the second word document with the original page order retained; when the first material set includes at least one offline HTML file, after each offline HTML file is converted into a Word file, the offline HTML file is merged into the second word document according to the Word file merging steps; when the first material set includes at least one video excerpt material, for each video excerpt material, the text of the video excerpt material is merged into the second word document according to the text material merging steps according to the order in the video excerpt material, the screenshot of the video excerpt material is merged into the second word document according to the picture material merging steps according to the order in the video excerpt material, and the video of the video excerpt material is merged into the second word document according to the video material merging steps according to the order in the video excerpt material; when the first material set includes at least one global annotation, each global annotation is converted into a picture, and the converted pictures are inserted into the second word document with the original page order retained;
[0016] After all materials in the first material set are merged into the second word document, a target word document is obtained.
[0017] In this implementation, different processing methods are provided for different materials, and the insertion method and order are explained, so that various types of materials can be merged into the word document according to reasonable rules.
[0018] In one example, when the first material set includes at least one picture material, the steps of creating a corresponding picture insertion paragraph for each picture material in the second word document, reading at least one picture material into the second word document in a stream manner, and inserting each picture into the picture insertion paragraph corresponding to the picture may include: in the second word document, displaying the first picture on the left, displaying the second picture in the center, and scaling the size of the third picture in proportion to display in one page, the first picture is a picture whose size is less than or equal to a first threshold, the second picture is a picture whose size is greater than the first threshold and less than or equal to a second threshold, the size of the third picture is greater than the second threshold, and the second threshold is determined according to the maximum display area of one page of the second word document. This example gives the layout rules after the picture material is inserted, avoiding only formal merging, so that the merged word document is also reasonable in layout. In this example, small pictures, such as small icons, are mainly displayed on the left, large pictures are displayed in the center, and oversized pictures (exceeding the displayable range of one page) are displayed after being reduced.
[0019] It should also be understood that the size here refers to the width and height. For example, the first picture is a picture with a size less than or equal to the first threshold, which means that both the width and height of the first picture are less than or equal to the first threshold; the second picture is a picture with a size greater than the first threshold and less than or equal to the second threshold, which means that at least one of the width and height of the second picture is greater than the first threshold, and both the width and height of the second picture are less than or equal to the second threshold; the size of the third picture being greater than the second threshold means that the width of the third picture is greater than the second threshold and / or the height is greater than the second threshold. Scaling the size of the third picture proportionally to fit on one page means that through proportional scaling, the size of the third picture is less than or equal to the second threshold, that is, both the width and height of the third picture are less than or equal to the second threshold, so as to ensure that it can be completely displayed on one page.
[0020] In another example, the above method further includes: in the second word document, the inserted word files, excel files, ppt files, pdf files, and offline html files are all arranged in chapter form, each chapter corresponding to a file, and the title of each chapter is the file name corresponding to that chapter. In this example, the typesetting rules for the inserted material of the file type are given, making the typesetting of the merged word document reasonable. It should also be understood that ppt files and pdf files will be converted into pictures before being inserted, so the typesetting rules for each page of content can refer to the typesetting rules of pictures, and each file corresponds to a chapter, and the chapter name can be the file name.
[0021] It should also be understood that for text, since the word document already has its own typesetting rules, there is no need to set custom typesetting rules like the above pictures and files. For videos and the videos in video excerpts, since the thumbnail of the first frame image of the video is displayed, it can be processed according to the typesetting rules of pictures. For the text in video excerpts, the typesetting rules of text can be referred to, for the screenshots in video excerpts, the typesetting rules of pictures can be referred to, and for global annotations, since they will be converted into pictures, the typesetting rules of pictures can be referred to.
[0022] In another example, the above method further includes: after all the materials in the first material set are merged into the second word document, the blank pages in the second word document are deleted to obtain the target word document. This example deletes the redundant blank pages and improves the readability of the document.
[0023] In one example, the above method further includes: real-time monitoring of the size of the second Word document; when it is monitored that the size of the second Word document is greater than or equal to a preset Word document size threshold, stopping the merging of the materials in the first material set into the second Word document, so as to obtain the target Word document. In this example, the size of the document is restricted, avoiding the situation that the document is too large and exceeds the processing or storage capacity of the electronic device, resulting in lag.
[0024] In combination with the first aspect, in some implementations of the first aspect, when combining all the materials in the first material set into the first Word document, it may include: creating an empty third Word document; performing at least one of the following operations according to the materials in the first material set: when there is at least one text material in the first material set, creating a corresponding text insertion paragraph in the third Word document for each text material, and inserting the content of each text material in the at least one text material into the corresponding text insertion paragraph of the text material in the third Word document while preserving the original line breaks, spaces, and relative position information; when there is at least one picture material in the first material set, creating a corresponding picture insertion paragraph in the third Word document for each picture material, reading at least one picture material into the third Word document by means of a stream, and inserting each picture into the corresponding picture insertion paragraph of the picture; when there is at least one video material in the first material set, creating a video insertion paragraph for each video material in the third Word document, and for each video material, inserting the first frame image of the video material as a thumbnail into the video insertion paragraph corresponding to the video material; when there is at least one audio material in the first material set, creating an audio insertion paragraph for each audio material in the third Word document, and for each audio material, inserting the title information of the audio material into the audio insertion paragraph corresponding to the audio material; when there is at least one Excel file in the first material set, for each Excel file, creating a table in the third Word document with the same number of worksheets as in the Excel file, traversing the Excel file, and merging the content of each worksheet in the Excel file into the table corresponding to the worksheet in the third Word document while preserving the format; when there is at least one Word file in the first material set, merging the content of each Word file into the third Word document while preserving the format according to the selected relative order of the Word document; when there is at least one TXT file in the first material set, merging the content of each TXT file into the third Word document according to the selected relative order of the TXT file; when there is at least one PPT file in the first material set, for each PPT file, converting each page of the PPT file into a picture, and inserting the converted pictures into the third Word document while preserving the original page order; when there is at least one PDF file in the first material set, for each PDF file, converting each page of the PDF file into a picture, and inserting the converted pictures into the third Word document while preserving the original page order; when there is at least one offline HTML file in the first material set, after converting each offline HTML file into a Word file, merging the offline HTML file into the third Word document according to the merging steps of the Word file;When there is at least one video excerpt material in the first material set, for each video excerpt material, the text of the video excerpt material is merged into the third Word document in the order of the text materials according to the merging steps of the text materials, the screenshot of the video excerpt material is merged into the third Word document in the order of the screenshot in the video excerpt material according to the merging steps of the picture materials, and the thumbnail of the first frame image of the video of the video excerpt material is merged into the third Word document in the order of the video excerpt material; when there is at least one global comment in the first material set, each global comment is converted into a picture, and the converted picture is inserted into the third Word document while retaining the original page order; after all the materials in the first material set are merged into the third Word document, the first Word document is obtained.
[0025] It can be seen that the process of merging into the first Word document in this example is similar to the process of merging into the target Word document in the above text, except for the processing methods of the three types of materials: video, audio, and video excerpts. However, it should be understood that other processing processes can also be set according to the material type to obtain the above first Word document. For example, when it is pre-set that the PDF document only supports text and pictures, the operations performed according to the materials in the first material set can only include: when there is at least one text material in the first material set, a corresponding text insertion paragraph is created in the third Word document for each text material, and the content of each text material in the at least one text material is inserted into the corresponding text insertion paragraph in the third Word document while retaining the original line breaks, spaces, and relative position information; when there is at least one picture material in the first material set, a corresponding picture insertion paragraph is created in the third Word document for each picture material, and the at least one picture material is read into the third Word document through a stream, and each picture is inserted into the corresponding picture insertion paragraph of the picture. The execution processes of other types of materials can no longer be set, and other examples will not be listed one by one.
[0026] Combined with the first aspect, in some implementation manners of the first aspect, the above method further includes: after generating the target Word document, a floating capsule snackbar is displayed, and the snackbar includes a sharing control; in response to a click operation of the user on the sharing control, a third pop-up window is displayed, and the third pop-up window includes at least one application icon; in response to a click operation of the user on any target icon in the at least one application icon, the second application corresponding to the target icon is started, and the target Word document is opened in the second application. In this implementation manner, an example of the interaction process of sharing the target document to other applications is given. This enables the user to open and use the obtained target document in other applications (applications other than the first application).
[0027] In a second aspect, an apparatus for synthesizing a document is provided. The apparatus includes units composed of software and / or hardware for executing any one of the methods in the first aspect.
[0028] In a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the methods in the first aspect can be implemented.
[0029] In a fourth aspect, a chip is provided, including a processor for reading and executing a computer program stored in a memory. When the computer program is executed by the processor, any one of the methods in the first aspect can be implemented.
[0030] Optionally, the chip further includes a memory, and the memory is electrically connected to the processor.
[0031] Optionally, the chip may further include a communication interface.
[0032] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, any one of the methods in the first aspect can be implemented.
[0033] In a sixth aspect, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, any one of the methods in the first aspect can be implemented. Description of the Drawings
[0034] Figure 1 is a schematic diagram of a method for editing a document in a traditional solution.
[0035] Figure 2 is a schematic diagram of an interaction process for collecting materials across applications in an embodiment of the present application.
[0036] Figure 3 and Figure 4 is a schematic diagram of an interaction process for a method of synthesizing and sharing a document in an embodiment of the present application.
[0037] Figure 5 is a schematic flowchart of a method for synthesizing a document in an embodiment of the present application.
[0038] Figure 6 is a schematic flowchart of a method for synthesizing a word document in an embodiment of the present application.
[0039] Figure 7 is a schematic flowchart of a method for synthesizing a pdf document in an embodiment of the present application.
[0040] Figure 8 It is a schematic diagram of a device for synthesizing documents according to an embodiment of the present application.
[0041] Figure 9 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Specific embodiments
[0042] The solutions of the embodiments of the present application will be introduced below with reference to the accompanying drawings.
[0043] Figure 1 It is a schematic diagram of a method for editing a document in a traditional solution. As Figure 1 shown, assume that the user edits a document in Application C, that is, edits the document in Application C shown in Interface 103. The user needs to separately search for materials from other applications, and then after selecting the content, copy and paste it into the editing interface of Application C, as shown in Interface 103. Figure 1 Taking finding Content #1 from Application A and multiple pictures from Application B as an example. In Figure 1 the scenario shown, the user needs to perform all the following operations to display the content shown in Interface 103: The user needs to first create a blank document in Application C, then create a paragraph. After that, the user needs to open Application A, find the search interface, enter the search term #1, and display the content shown in Interface 101. Then, select Content #1 (including text and Picture #1 and Picture #2) in Interface 101. After that, copy the selected Content #1, and then open the editing interface of Application C again and paste Content #1 into it. After that, open Application B to display Interface 102, and then sequentially select one or more pictures in Interface 102. Then, copy the selected pictures, and then open Application C again, create a new paragraph, and then paste these pictures into the editing interface of Application C, that is, the document being edited. It can be seen that this process is very cumbersome, requiring the user to frequently open different applications, select different content, and then gather this content into the document being edited. In addition, assume that the user inserts files such as word files and ppt files into the document shown in Interface 103. It can only be inserted in the form of inserting an attachment, and it is displayed as a file icon in the document of Interface 103. When the user needs to view the content of the inserted file, the user still has to double-click the file icon to open it. And when the user wants to copy the content of other files into the document shown in Interface 103, the user can only open this file one by one using the editing application corresponding to each file, and then select, copy, and paste the content of this file into the document shown in Interface 103. For file content that cannot be selected, such as some pdf files that are edited using software such as ctex and latex and the content of the pdf file cannot be selected and copied, at this time, the content of this pdf file cannot be copied into the document shown in Interface 103.
[0044] Assume that the content in interface 101 has been favorited by the user. Still, the user needs to open Application A, then find the favorites folder in Application A, find the website (link) in the favorites folder, open it to display the search interface shown in interface 101, and then enter the search term #1 in the search bar and click the search control to see the content shown in interface 101. Although there is a website favorite, the simplification of the steps is very limited.
[0045] Therefore, it can be seen that when editing different materials into the same document in the traditional solution, it requires very cumbersome manual operations and continuously switches applications and performs element searching, selection, and copying.
[0046] To address the above problems, the present application provides a new method for synthesizing a document, which can synthesize all the materials selected by the user into a target document with one click.
[0047] Figure 2 It is a schematic diagram of an interaction process for collecting materials across applications in an embodiment of the present application. As Figure 2 shown, interface 201 is an interface of Application A. After the user enters the search term #1 and performs a search in this interface and then selects content #1, and then long-presses and drags it to the right, the electronic device responds to this drag operation and displays interface 202, that is, the interface of the favorites space application, and adds the favorited text + picture combination material to the interface of the favorites space.
[0048] Interface 203 is an interface of Application B. After several pictures are selected in this interface and then long-pressed and dragged to the right, the electronic device responds to this drag operation and displays interface 204, that is, the interface of the favorites space application, and adds the three favorited picture materials to the interface of the favorites space.
[0049] It can be seen that Figure 2 the favorites space in Figure 2 can be understood as a globally favorited application, which can achieve cross-application favoriting. That is, any form of material in any application can be added to the favorites space by being selected and dragged. In addition to
[0050] The solution of the embodiment of this application is based on a global collection application such as a collection space (an example of the first application), and realizes the function of synthesizing various and individual materials collected in this application into a document of the target type with one click.
[0051] Figure 3 And Figure 4 are schematic diagrams of the interaction process of a method for synthesizing and sharing documents in an embodiment of this application. Figure 3 And Figure 4 Take the synthesis of a document based on the Figure 2 shown collection result as an example. As Figure 3 shown, the display interface of the collection space (an example of the first application) in the interface 204 (an example of the first interface, the right long bar display area in the interface 204) includes multiple materials. The user can select the material by clicking on the thumbnail of the material. Suppose the user clicks and selects a material, as shown in the interface 205. The selected material in the interface 205 will include a selection identifier and a selection order, and the collection space interface also displays a sharing space "Share / Export" (an example of the first control). When the user clicks on this sharing control, in response to this click operation, the electronic device displays the interface 206, and a pop-up window, that is, pop-up window #1 (an example of the first pop-up window), is displayed in the interface 206. The basic information of the selected materials (an example of the first material set) is included in this pop-up window, and it also includes multiple controls: "Share", "Export File", and "Save as Note". The "Export File" control is an example of the second control. Suppose the user clicks on this control, in response to the user's click operation, the electronic device displays the interface 207, and a new pop-up window, that is, pop-up window #2 (an example of the second pop-up window), is displayed in the interface 207. Two controls, "Export as DOC" and "Export as PDF" (examples of document generation controls), are included in this pop-up window. That is to say, the second pop-up window is used to indicate to the user what type of document the selected materials will be merged into. Suppose the user clicks on the "Export as DOC" control in the interface 207, the selected materials can be merged into a word document (that is, DOC or DOCX). After the document is merged, it is shown as Figure 4The floating capsule (here, a snackbar) in the interface 208 shown. A snackbar is a display window that can fade out after a preset time, and in addition to displaying a prompt message, it can also include operable controls. In the interface 208 here, the snackbar includes the prompt message "Exported" indicating that the document has been merged and a share control "Share to Other Apps" indicating that the synthesized document can be shared to other apps (apps outside the collection space). Suppose the user clicks the "Share to Other Apps" control. In response to this click operation, interface 209 appears on the electronic device. A new pop-up window, that is, pop-up window #3 (an example of the third pop-up window), appears in interface 209. Icons of apps to which the merged document can be shared are included in this pop-up window. For example, it can be shared to a chat app, a Bluetooth transfer app, an email app, or other suitable third-party apps, etc. Suppose the user clicks the icon of an app in pop-up window #3, the app can be launched, and the merged document can be opened in the app. Suppose there are many app icons included in pop-up window #3, the user can also switch the displayed icons in pop-up window #3 by swiping.
[0052] In Figures 2 - 4 , the interfaces 201 - 204 show examples of the process of collecting various materials in different apps, the interfaces 204 - 208 show examples of the process of selecting materials from the collected materials and synthesizing a document, and the interfaces 208 - 209 show examples of the process of sharing the synthesized document to other apps.
[0053] Figures 2 - 4 The electronic device shown can be various electronic devices such as a mobile phone, a tablet computer, a touch-screen laptop computer, etc., as long as it can support the global collection (cross-app collection) function, touch operation, and the function of synthesizing a document.
[0054] Figure 5 is a schematic flowchart of a method for synthesizing a document according to an embodiment of the present application. The following will introduce Figure 5 each step shown.
[0055] S501. Run a first app on the electronic device and display a first interface.
[0056] The first interface includes multiple materials, and the multiple materials include at least one of text, picture, video, audio, word file, ppt file, pdf file, excel file, txt file, offline html file, video excerpt, and global annotation.
[0057] The first application can be, for example, the favorite space shown in interface 204, and the first interface can be, for example, the display interface of the favorite space shown in interface 204. However, it should be understood that the first application can also be other applications that support global favoriting.
[0058] In one implementation, the above-mentioned multiple materials come from multiple applications.
[0059] In one implementation, before step S501, the above method further includes:
[0060] Run a third application on the electronic device and add at least one material in the third application to the first application;
[0061] Run a fourth application on the electronic device and add at least one material in the fourth application to the first application. Among the multiple materials in the first interface, there are at least one material from the third application and at least one material from the fourth application.
[0062] In this implementation, taking the example that among the multiple materials in the first interface of the first application, there are materials added from the third application and the fourth application. The solution of the embodiment of the present application is based on the global favoriting function, and how to make use of the favorited materials. Since in such a scenario, no one has considered how to utilize them, the solution of the embodiment of the present application is born. These materials are used to solve the problem that the operation is cumbersome when editing the favorited materials into a document in the traditional solution.
[0063] In an example, the above-mentioned running a third application on the electronic device and adding at least one material in the third application to the first application includes:
[0064] Display the second interface of the third application;
[0065] In response to a first operation of the user on the second interface, add at least one selected material in the second interface to the first application.
[0066] In this example, the first operation can be a three-finger swipe-down operation on the second interface or a drag operation on the selected content in the second interface.
[0067] S502. In response to a selection operation of the user on at least one of the multiple materials, display a selection identifier and a first control for the selected material in the first interface.
[0068] The first control is used to indicate generating a document.
[0069] The first control can be, for example, the sharing control "Share / Export" shown in interface 205. The selection identifier can be, for example, the selection identifier with a selection order shown in interface 205.
[0070] S503. In response to the user's click operation on the first control, display a first pop-up window in the first interface, and display a first material set in the first pop-up window.
[0071] The first material set includes all selected materials, and all selected materials are sorted in the order of being selected.
[0072] The pop-up window #1 shown in interface 206 can be regarded as an example of the first pop-up window. The 4 groups / individual materials shown in pop-up window #1 are examples of the selected materials, and the digital identifiers carried by each material in pop-up window #1 mark the selection order.
[0073] S504. In response to the user's click operation on the second control in the first pop-up window, display a second pop-up window, and the second pop-up window includes at least one document generation control.
[0074] Each document generation control corresponds to the generation function of a kind of document, and the second control is used to indicate the generation of a document.
[0075] The second control can be, for example, "Export File" in interface 206. The second pop-up window can be pop-up window #2 shown in interface 207. "Export as DOC" and "Export as PDF" in interface 207 are examples of at least one document generation control.
[0076] In one implementation, after displaying the second pop-up window in response to the user's click operation on the second control in the first pop-up window, the above method further includes: when the first material set includes at least one of video, audio, word file, ppt file, pdf file, excel file, and video excerpt, display a word document generation control in the second pop-up window; or, when the first material set only includes at least one of text, picture, offline html file, and global annotation, display a word document generation control and a pdf document generation control in the second pop-up window; or, when the first material set only includes text materials, display a word document generation control, a pdf document generation control, and a txt document generation control in the second pop-up window; or, when the first material set only includes at least one of picture and global annotation, display a word document generation control, a pdf document generation control, and a long picture document generation control in the second pop-up window. In this implementation, these at least one document generation controls can be displayed as different combinations based on the types of the selected materials, which is convenient for the user to select.
[0077] In another implementation, these at least one document generation controls can be controls including all synthesizable document types, but some of the document generation controls are set to an inoperable state based on the types of the selected materials. This can also be convenient for the user to select.
[0078] In one implementation, the merging scheme for different types of materials can be as shown in Table 1.
[0079] Table 1
[0080]
[0081] As can be seen from Table 1, DOC / DOCX documents can support the merging of text, pictures, videos, audio, word, ppt, pdf, excel, html, video excerpts, and global comments. That is to say, the materials of the above-supported types can all be merged into DOC / DOCX documents; PDF documents can support the merging of text, pictures, html, and global comments. That is to say, the materials of the above-supported types can all be merged into PDF documents; TXT documents can only support the merging of text materials; long picture documents only support the merging of pictures and global comments. However, it should be understood that Table 1 is only an example of different merging schemes that can be set for different types. In actual applications, the merging schemes for different types of materials can be flexibly allocated based on the actual processing capabilities of the electronic device.
[0082] S505. In response to the user's click operation on the word document generation control in the second pop-up window, merge all the materials in the first material set into a target word document.
[0083] The word document generation control is used to indicate the generation of a word document.
[0084] In one implementation, step S505 may include: creating an empty second word document; and performing at least one of the following operations according to the materials in the first material set:
[0085] When the first material set includes at least one text material, create a corresponding text insertion paragraph for each text material in the second word document, and insert the content of each text material in the at least one text material into the corresponding text insertion paragraph of the text material in the second word document while retaining the original line breaks, spaces, and relative position information;
[0086] When the first material set includes at least one picture material, create a corresponding picture insertion paragraph for each picture material in the second word document, read the at least one picture material into the second word document by means of a stream, and insert each picture into the corresponding picture insertion paragraph of the picture;
[0087] When there is at least one video material in the first material set, create a video insertion paragraph for each video material in the second word document. For each video material, insert the first frame image of the video material as a thumbnail into the video insertion paragraph corresponding to the video material, read the video stream of the video material into the second word document, and insert the read video stream into the video insertion paragraph corresponding to the video material;
[0088] When there is at least one audio material in the first material set, create an audio insertion paragraph for each audio material in the second word document. For each audio material, insert the title information of the audio material into the audio insertion paragraph corresponding to the audio material, read the audio stream of the audio material into the second word document, and insert the read audio stream into the audio insertion paragraph corresponding to the audio material;
[0089] When there is at least one excel file in the first material set, for each excel file, create a table in the second word document with the same number of worksheets as in the excel file. Traverse the excel file and merge the content of each worksheet in the excel file into the table corresponding to the worksheet in the second word document while preserving the format;
[0090] When there is at least one word file in the first material set, merge the content of each word file into the second word document while preserving the format in the relative order in which the word files are selected;
[0091] When there is at least one txt file in the first material set, merge the content of each txt file into the second word document in the relative order in which the txt files are selected;
[0092] When there is at least one ppt file in the first material set, for each ppt file, convert each page of the ppt file into a picture, and insert the converted pictures into the second word document while preserving the original page order;
[0093] When there is at least one pdf file in the first material set, for each pdf file, convert each page of the pdf file into a picture, and insert the converted pictures into the second word document while preserving the original page order;
[0094] When there is at least one offline html file in the first material set, after converting each offline html file into a word file, merge the offline html file into the second word document according to the merging steps of word files;
[0095] When the first material set includes at least one video excerpt material, for each video excerpt material, the text of the video excerpt material is merged into the second word document according to the merging steps of the text material in the order in which the text is in the video excerpt material, the screenshot of the video excerpt material is merged into the second word document according to the merging steps of the picture material in the order in which the screenshot is in the video excerpt material, and the video of the video excerpt material is merged into the second word document according to the merging steps of the video material in the order in which the video is in the video excerpt material;
[0096] When the first material set includes at least one global annotation, each global annotation is converted into a picture, and the converted pictures are inserted into the second word document while retaining the original page order;
[0097] After all materials in the first material set are merged into the second word document, a target word document is obtained. In this implementation, different processing methods are provided for different materials. The insertion method and order are explained, so that various types of materials can be merged into the word document according to reasonable rules.
[0098] In one example, when the first material set includes at least one picture material, the steps of creating a corresponding picture insertion paragraph for each picture material in the second word document, reading at least one picture material into the second word document in a stream manner, and inserting each picture into the picture insertion paragraph corresponding to the picture may include: in the second word document, displaying the first picture on the left, displaying the second picture in the center, and scaling the size of the third picture in proportion to display in one page, the first picture is a picture whose size is less than or equal to a first threshold, the second picture is a picture whose size is greater than the first threshold and less than or equal to a second threshold, the size of the third picture is greater than the second threshold, and the second threshold is determined according to the maximum display area of one page of the second word document. This example gives the layout rules after the picture material is inserted, avoiding only formal merging, so that the merged word document is also reasonable in layout. In this example, small pictures, such as small icons, are mainly displayed on the left, large pictures are displayed in the center, and oversized pictures (exceeding the displayable range of one page) are displayed after being reduced.
[0099] It should also be understood that the size here refers to the width and height. For example, the first picture is a picture with a size less than or equal to the first threshold, which means that both the width and height of the first picture are less than or equal to the first threshold; the second picture is a picture with a size greater than the first threshold and less than or equal to the second threshold, which means that at least one of the width and height of the second picture is greater than the first threshold, and both the width and height of the second picture are less than or equal to the second threshold; the size of the third picture being greater than the second threshold means that the width of the third picture is greater than the second threshold and / or the height is greater than the second threshold. Scaling the size of the third picture proportionally to be displayed on one page means that through proportional scaling, the size of the third picture is less than or equal to the second threshold, that is, both the width and height of the third picture are less than or equal to the second threshold, so as to ensure that it can be displayed completely on one page.
[0100] In another example, the above method further includes: in the second word document, the inserted word files, excel files, ppt files, pdf files, and offline html files are all arranged in chapter form, each chapter corresponding to a file, and the title of each chapter is the file name corresponding to that chapter. In this example, the layout rules of the inserted material of the file type are given, so that the merged word document is also reasonable in layout. It should also be understood that the ppt file and the pdf file will be converted into pictures and then inserted, so the layout rules for each page of content can refer to the layout rules of pictures, and each file corresponds to a chapter, and the chapter name can be the file name.
[0101] It should also be understood that for text, since the word document already has its own layout rules, there is no need to set custom layout rules like the above pictures and files. For videos and the videos in video excerpts, since the thumbnail of the first frame image of the video is displayed, it can be processed according to the layout rules of pictures. For the text in video excerpts, the layout rules of text can be referred to, for the screenshots in video excerpts, the layout rules of pictures can be referred to, and for global annotations, since they will be converted into pictures, the layout rules of pictures can be referred to.
[0102] In another example, the above method further includes: after all the materials in the first material set are merged into the second word document, deleting the blank pages in the second word document to obtain the target word document. This example deletes the redundant blank pages and improves the readability of the document.
[0103] In one example, the above method further includes: real-time monitoring of the size of the second Word document; when it is monitored that the size of the second Word document is greater than or equal to a preset Word document size threshold, stopping the merging of the materials in the first material set into the second Word document, so as to obtain the target Word document. In this example, the size of the document is restricted, avoiding the situation that the document is too large and exceeds the processing capacity or storage capacity of the electronic device, resulting in lag.
[0104] In one implementation, Figure 5 the method shown further includes steps S506 - S508 to share the synthesized target document to other applications.
[0105] S506. After generating the target Word document, display a floating capsule (snackbar), and the snackbar includes a sharing control.
[0106] S507. In response to the user's click operation on the sharing control, display a third pop-up window, and the third pop-up window includes at least one application icon.
[0107] S508. In response to the user's click operation on any target icon among the at least one application icon, start the second application corresponding to the target icon, and open the target Word document in the second application.
[0108] The second application refers to other applications outside the first application, and the relevant content can be referred to the above introduction.
[0109] In one implementation, the second pop-up window further includes a PDF document generation control, and the PDF document generation control is used to indicate the generation of a PDF document. The above method further includes: in response to the user's click operation on the PDF document generation control, merge all the materials in the first material set into a target PDF document. In this implementation, an example of the interaction process for synthesizing a PDF document is given. That is to say, the solution of the embodiment of the present application can not only be used to synthesize Word documents, but also be used to synthesize PDF documents.
[0110] In one example, when, in response to the user's click operation on the PDF document generation control, all the materials in the first material set are merged into a target PDF document, it may include: merging all the materials in the first material set into a first Word document; converting the first Word document into a target PDF document. Since the editable function of PDF is much weaker than that of Word documents, in order to enable more types of materials to generate PDF documents, a method of first synthesizing into a Word document and then converting it into a PDF document is provided.
[0111] In one example, the step of merging all the materials in the first material set into the first Word document may include: creating an empty third Word document; and performing at least one of the following operations according to the materials in the first material set:
[0112] When the first material set includes at least one text material, create a corresponding text insertion paragraph for each text material in the third Word document, and insert the content of each text material in the at least one text material into the corresponding text insertion paragraph of the text material in the third Word document while retaining the original line breaks, spaces, and relative position information;
[0113] When the first material set includes at least one picture material, create a corresponding picture insertion paragraph for each picture material in the third Word document, read the at least one picture material into the third Word document by means of a stream, and insert each picture into the corresponding picture insertion paragraph of the picture;
[0114] When the first material set includes at least one video material, create a video insertion paragraph for each video material in the third Word document, and for each video material, insert the first frame image of the video material as a thumbnail into the corresponding video insertion paragraph of the video material;
[0115] When the first material set includes at least one audio material, create an audio insertion paragraph for each audio material in the third Word document, and for each audio material, insert the title information of the audio material into the corresponding audio insertion paragraph of the audio material;
[0116] When the first material set includes at least one Excel file, for each Excel file, create tables in the third Word document with the same number of worksheets as in the Excel file, traverse the Excel file, and merge the content of each worksheet in the Excel file into the corresponding table in the third Word document while retaining the format;
[0117] When the first material set includes at least one Word file, merge the content of each Word file into the third Word document while retaining the format in the relative order in which the Word document is selected;
[0118] When the first material set includes at least one TXT file, merge the content of each TXT file into the third Word document in the relative order in which the TXT file is selected;
[0119] When the first material set includes at least one PPT file, for each PPT file, each page of the PPT file is converted into an image, and the converted images are inserted into the third Word document in the original page order;
[0120] When the first material set includes at least one PDF file, for each PDF file, each page of the PDF file is converted into an image, and the converted images are inserted into the third Word document in the original page order;
[0121] When the first material set includes at least one offline HTML file, after each offline HTML file is converted into a Word file, the offline HTML file is merged into the third Word document according to the merging steps of the Word file;
[0122] When the first material set includes at least one video excerpt material, for each video excerpt material, the text of the video excerpt material is merged into the third Word document in the order in which it appears in the video excerpt material according to the merging steps of the text material, the screenshots of the video excerpt material are merged into the third Word document in the order in which they appear in the video excerpt material according to the merging steps of the picture material, and the thumbnail of the first frame image of the video of the video excerpt material is merged into the third Word document in the order in which it appears in the video excerpt material;
[0123] When the first material set includes at least one global annotation, each global annotation is converted into an image, and the converted images are inserted into the third Word document in the original page order;
[0124] After all the materials in the first material set are merged into the third Word document, a first Word document is obtained.
[0125] It can be seen that the process of merging into a Word document in this example is similar to the process of merging into a Word document in step S505, except for the processing methods of the three types of materials: video, audio, and video excerpt.
[0126] However, it should be understood that in other examples, other processing procedures can also be set according to the material type to obtain the above-mentioned first Word document. For example, when it is pre-set that the PDF document only supports text and pictures, the operations performed according to the materials in the first material set can only include: when the first material set includes at least one text material, create corresponding text insertion paragraphs in the third Word document for each text material, and insert the content of each text material in the at least one text material into the corresponding text insertion paragraph in the third Word document while preserving the original line breaks, spaces, and relative position information; when the first material set includes at least one picture material, create corresponding picture insertion paragraphs in the third Word document for each picture material, read the at least one picture material into the third Word document in a streaming manner, and insert each picture into the corresponding picture insertion paragraph for that picture. The execution processes for other types of materials can no longer be set. Figure 7 Another example of the execution process for synthesizing a PDF document is also given, and other examples will not be listed one by one.
[0127] In one example, the above steps of, when the first material set includes at least one picture material, creating corresponding picture insertion paragraphs in the third Word document for each picture material, reading the at least one picture material into the third Word document in a streaming manner, and inserting each picture into the corresponding picture insertion paragraph for that picture can include: in the third Word document, display the first picture on the left, display the second picture in the center, and scale the size of the third picture proportionally to fit on one page. The first picture is a picture with a size less than or equal to a first threshold, the second picture is a picture with a size greater than the first threshold and less than or equal to a second threshold, and the size of the third picture is greater than the second threshold. The second threshold is determined according to the maximum display area of one page of the second Word document. That is to say, the layout rules for pictures can follow the layout rules for synthesizing the target Word document described above, which will not be elaborated here.
[0128] In one example, the above method further includes: in the third Word document, the inserted Word files, Excel files, PPT files, PDF files, and offline HTML files are all arranged in chapter form, each chapter corresponds to a file, and the title of each chapter is the file name corresponding to that chapter. That is to say, the layout rules after file insertion can follow the layout rules for synthesizing the target Word document described above, which will not be elaborated here.
[0129] In one example, the above method further includes: after all the materials in the first material set are merged into the third Word document, deleting the blank pages in the third Word document, thereby obtaining the first Word document. That is to say, the rule for deleting blank pages can follow the rule for deleting blank pages when synthesizing the target Word document above, and will not be elaborated here.
[0130] In one example, the above method further includes: monitoring the size of the third Word document in real time; when it is monitored that the size of the third Word document is greater than or equal to the preset PDF document size threshold, stopping merging the materials in the first material set into the third Word document, and generating the first Word document. That is to say, the monitoring of the size of the exported document can follow the rule for synthesizing the target Word document above, and will not be elaborated here.
[0131] In another example, the above method further includes: after generating the target PDF document, displaying a floating ball prompt box, where the floating ball prompt box includes a sharing control; in response to the user's click operation on the sharing control, displaying a third pop-up window, where the third pop-up window includes at least one application icon; in response to the user's click operation on any target icon among the at least one application icon, starting the second application corresponding to the target icon, and opening the target PDF document in the second application. That is to say, the method for sharing the target document after the target Word document is synthesized is also applicable to the target PDF document.
[0132] In another implementation, the second pop-up window further includes a TXT document generation control or a long picture document generation control. The TXT document generation control is used to indicate generating a TXT document, and the long picture document generation control is used to indicate generating a long picture. The above method further includes: when the first material set only includes multiple text materials, in response to the user's click operation on the TXT document generation control, merging all the text materials in the first material set in the selected order into a TXT document; or, when the first material set only includes multiple picture materials and / or global annotation materials, in response to the user's click operation on the long picture document generation control, converting all the picture materials and / or the pictures converted from all the global annotation materials in the first material set, and merging them in the selected order into a long picture document. In this implementation, the execution process of how to synthesize when the target document is a TXT document or a long picture document is given. Since the types of materials supported by these two types of documents are single, they can be merged only by inserting them in order.
[0133] In one example, the number of pages of the long picture document is less than or equal to the preset page number threshold. The preset page number threshold can be, for example, 50 pages.
[0134] In another example, the second pop-up window also includes a long image document generation control, and the above method also includes: creating a fourth word document, merging all materials in the first material set into the fourth word document to obtain a fifth word document, and converting the fifth word document into a long image document. In this example, the editing capability of the word document is still used, first generating a word document and then converting it into a long image document. The relevant process can refer to the execution process when the target document is a PDF document, and will not be repeated.
[0135] Figure 5 The method shown realizes the function of synthesizing multiple and / or multiple materials into a target document with one click, that is, after selecting the material, all the selected materials can be synthesized into the target document by simply clicking the control of the target document. This solves the problem that in the traditional solution, when editing a document, the user can only manually search for materials from different applications and manually copy and paste or insert them into the document being edited in the form of an inserted object, and the inserted files (such as word files, txt files, ppt files, pdf files, excel files, and html files, etc.) no longer only appear in the form of small icons for inserting attachments, but can parse the contents of the file and add it to the document, that is, lay it out in the target document, which is convenient for users to perform subsequent editing. Compared with the traditional solution, this solution is more flexible and improves the user experience.
[0136] Figure 6 It is a schematic flow chart of a method for synthesizing a word document according to an embodiment of the present application. Figure 6 It can be seen as Figure 5 An example of the method shown.
[0137] S601: A user initiates document merging through a collection space application.
[0138] That is to say, the user initiates the document merging (synthetic document function) through the display interface of the collection space application.
[0139] In one example, the document merge may be initiated by clicking the sharing control “Share / Export” in the interface 205 .
[0140] S602: Construct a material information list in the collection space.
[0141] The material information list can be regarded as an example of the first material set. The material information list can be presented as a pop-up window #1 shown in interface 206.
[0142] S603. Initiate document merging to the document center through the collection space and carry a material information list.
[0143] This step can be implemented through the operations shown in interfaces 206 and 207.
[0144] S604. Obtain all the materials to be merged in the document platform. If it is of the text or website type, directly obtain the content. If it is of other types, obtain the file path.
[0145] This step mainly prepares the source files of each material in the material information list. If the material is of the text or website type (i.e., text), directly obtain the content of the text. If the material is of other types, first obtain the file path of the material and wait to be called later.
[0146] S605. Create an empty new word document in the document platform.
[0147] This word document is an example of the second word document mentioned above.
[0148] S606. In the document platform, for text-type materials, after creating paragraphs and text-format objects in the word document, directly insert them, retaining original line breaks, spaces, and other information.
[0149] That is, for text materials, create corresponding text insertion paragraphs for each text material in the word document, and insert the content of each text material into the corresponding text insertion paragraph of the text material in the word document while retaining the original line breaks, spaces, and relative position information.
[0150] S607. In the document platform, for picture-type materials, after creating paragraphs and picture-format text objects, read the pictures into the text objects through a stream.
[0151] That is to say, create corresponding picture insertion paragraphs for each picture material in the word document, read each picture material into the word document through a stream, and insert each picture into the corresponding picture insertion paragraph of the picture. When reading through a stream, it is to read by means of the file path of the picture in step S604.
[0152] S608. In the document platform, for video / audio-type materials, create custom paragraphs, read the first frame of the video as a thumbnail, read the video stream into the input stream, and append video and picture objects in the paragraphs.
[0153] That is to say, for videos, create a video insertion paragraph in the word document for each video material. For each video material, insert the first-frame image of the video material as a thumbnail into the video insertion paragraph corresponding to the video material, read the video stream of the video material into the word document, and insert the read video stream into the video insertion paragraph corresponding to the video material. For audio, create an audio insertion paragraph in the word document for each audio material. For each audio material, insert the title information of the audio material into the audio insertion paragraph corresponding to the audio material, read the audio stream of the audio material into the word document, and insert the read audio stream into the audio insertion paragraph corresponding to the audio material. When reading the video stream and audio stream, the file paths in the above text can be used for reading.
[0154] S609. In the document platform, for material of the table type, traverse and read the worksheets one by one, add the corresponding number of tables in the word document, merge each worksheet with the newly added table one by one, and retain the fonts and cell styles in the worksheet.
[0155] That is to say, for each excel file to be merged, create tables in the word document with the same number of worksheets as in the excel file. Traverse the excel file and merge the content of each worksheet in the excel file into the table corresponding to the worksheet in the word document while retaining the format. An excel file can be regarded as a workbook, and a workbook can include one or more worksheets. In the embodiments of the present application, instead of simply inserting the excel table as an attachment into the document, the content in the excel file is traversed and parsed and added to the document. When traversing the excel file, the source file of the excel file can be found using the file path in the above text, and then opened and traversed. Similarly, when opening other files such as pdf and ppt, the source file can also be found using the file path, which will not be elaborated here.
[0156] S610. In the document platform, for material of the pdf file, traverse and read each page of the pdf, and convert each read page into a picture and append it to the word document.
[0157] That is to say, for each pdf file to be merged, convert each page of the pdf file into a picture, and insert the converted pictures into the word document in the original page order. Suppose there is a pdf file to be merged, and the pdf file contains 5 pages of content. It can be converted into 5 pictures, and after sorting the 5 pictures in the original page order, they are inserted into the word document in sequence. It should be understood that the values in this example are for facilitating the understanding of the solution and do not have any limitations.
[0158] It should be understood that converting a PDF file into pictures and inserting them into a Word document, rather than just inserting it as an attachment and displaying it as a small icon in the Word document, can facilitate viewing the content of the PDF file. Additionally, directly converting a PDF file into a Word document will cause the content format to be chaotic. Therefore, here we choose to convert it into pictures first instead of directly converting the document format, which can maximize the retention of the content in the PDF file and is relatively simple in terms of technical implementation.
[0159] It should also be understood that although a PDF file can include annotation content, the annotations are directly superimposed on the text. Therefore, the annotation content will be presented in the picture when converting to a picture, so no processing is required.
[0160] S611. In the document platform, for the PPT file materials, traverse and read each page of the PPT, and convert each read page into a picture and append it to the Word document.
[0161] That is to say, for each PPT file to be merged, each page of the PPT in the PPT file is converted into a picture, and the converted pictures are inserted into the Word document in the original page order. It should be understood that converting a PPT file into pictures and inserting them into a Word document, rather than just inserting it as an attachment and displaying it as a small icon in the Word document, can facilitate viewing the content of the PPT file. Additionally, directly converting a PPT file into a Word document will cause the content format to be chaotic. Therefore, here we choose to convert it into pictures first instead of directly converting the document format, which can maximize the retention of the content in the PPT file and is relatively simple in terms of technical implementation.
[0162] It should also be understood that each page of the PPT file can also include annotation content. The annotation can only be a text annotation. Therefore, the annotation content can be parsed into text and inserted before or after the insertion position of the picture converted from that page of the PPT.
[0163] S612. In the document platform, for the HTML type of materials, first convert the HTML into a Word file, and then process it according to the merging method of the Word file.
[0164] It should be understood that here it refers to the offline HTML type of materials, that is, the offline web page. The online website is the website in the above website types, which is just a link and can be equivalent to text.
[0165] That is to say, after converting each offline HTML file into a Word file, merge the offline HTML file into the Word document according to the merging steps of the Word file.
[0166] S613. In the document middle platform, for materials of the word type, directly merge the word files into the created word document.
[0167] That is to say, when there are at least one word file, the content in each word file is merged into the above-mentioned word document in the selected relative order while preserving the format. Since the above steps are all executed in the word document, and inserting a word in word can be directly inserted while preserving all the original formats, so here it is only necessary to insert the word files to be inserted in sequence.
[0168] It should also be understood that each page of the word file may also include annotation content, and the annotation content can be preserved during insertion, so no other processing is required.
[0169] S614. In the document middle platform, for materials of the global annotation type, convert the global annotation into a picture and process it according to the picture merging method.
[0170] That is to say, each global annotation is converted into a picture, and the converted pictures are inserted into the word document while preserving the original page order.
[0171] S615. In the document middle platform, for materials of the video excerpt type, append the text, screenshots, and videos in it to the word document in sequence.
[0172] A video excerpt will include a video, as well as text and / or screenshots. Therefore, different elements (different types of materials) can be processed respectively by their corresponding processing methods. It can be understood that a video excerpt is a combined type of material, that is, a material will include multiple types of materials.
[0173] That is to say, for each video excerpt material, the text of the video excerpt material is merged into a word document in the order in which it appears in the video excerpt material according to the merging steps of the text material, the screenshot of the video excerpt material is merged into the word document in the order in which it appears in the video excerpt material according to the merging steps of the picture material, and the video of the video excerpt material is merged into the word document in the order in which it appears in the video excerpt material according to the merging steps of the video material. For example, assume that a certain video excerpt includes text #1, screenshot #2, video #1, text #2, and video #2, and is sorted as above. When merging this video excerpt, text #1 is merged into the word document according to the merging method of the text material (step S606), then screenshot #2 is merged into the word document according to the merging method of the picture material (step S607), then video #1 is merged into the word document according to the merging method of the video material (step S608), then text #2 is merged into the word document according to the merging method of the text material (step S606), and then video #2 is merged into the word document according to the merging method of the video material (step S608), thus completing the merging of this video excerpt material.
[0174] S616. After synthesis, through the document middle platform, store the synthesized word document in the specified disk location.
[0175] That is to say, after steps S601 - S615 are executed and all the materials to be merged are merged into the word document, a synthesized word document (an example of the target word document) is obtained, and it can be stored in the specified disk location.
[0176] Steps S604 - S616 can be regarded as an example of step S505.
[0177] S617. Use the document middle platform to pop up a snackbar indicating successful merging.
[0178] For example, it can be the snackbar shown in interface 208.
[0179] S618. In response to the user's operation of clicking the sharing control in the snackbar, trigger sharing.
[0180] For example, it can be clicking the sharing control "Share to Other Applications" shown in interface 208 to trigger sharing.
[0181] S619. In the document middle platform, call the application programming interface (API) of the sharing framework.
[0182] S620. Pull up the sharing panel through the sharing framework.
[0183] This sharing panel can be, for example, the pop-up window #3 shown in interface 209.
[0184] S621. In the sharing framework, in response to the user's operation of clicking on the application icon in the sharing panel, select the sharing target.
[0185] That is to say, based on which application icon the user clicks, that application is the following third-party application.
[0186] S622. Through the sharing framework, pull up the third-party application and pass the unified resource identifier (URI) of the merged document to the third-party application.
[0187] That is to say, start the third-party application and send the URI to the third-party application.
[0188] S623. In the third-party application, read and use the merged document.
[0189] That is to say, the third-party application reads the merged word document based on the received URI.
[0190] It can be seen that Figure 6 An example of the merging process of the word document is given. In this example, the types of materials can be text, pictures, videos, audios, files, etc., which are very rich. Moreover, files such as excel are not simply inserted as attachments in a rough way, but their contents are parsed and then inserted into the word document.
[0191] Figure 7 It is a schematic flowchart of a method for synthesizing a pdf document according to an embodiment of the present application. Figure 7 It can be regarded as Figure 5 An example of the method shown.
[0192] S701. The user initiates document merging through the collection space application.
[0193] That is to say, the user initiates document merging (synthesizing document function) through the display interface of the collection space application.
[0194] In one example, it can be through the operation of clicking the sharing control "Share / Export" in interface 205 to initiate document merging.
[0195] S702. Build a list of material information in the collection space.
[0196] The material information list can be regarded as an example of the first material set. The material information list can be presented as a pop-up window #1 shown in interface 206. It should be understood that the material information list may not be presented to the user through the interface, but only used in the background.
[0197] S703. Initiate document merging to the document center through the collection space and carry a material information list.
[0198] This step may be implemented through the operations shown in interface 206 and interface 207 .
[0199] It should be understood that since the subsequent steps have determined the document type to be exported, e.g. Figure 6 For word documents, Figure 7 It is a pdf document, so when initiating a document merge, in addition to carrying a list of material information, you can also carry the document type that needs to be synthesized.
[0200] S704. Obtain all materials to be merged in the document center. If they are text or URL types, directly obtain the content; if they are other types, obtain the file path.
[0201] This step mainly prepares the source files of each material in the material information list. If it is a text or URL type (that is, text) material, directly obtain the content of the text. If it is other types of materials, first obtain the file path of the material and wait for subsequent calls.
[0202] S705. Create an empty new word document in the document center.
[0203] This word document is an example of the third word document mentioned above.
[0204] S706. In the document, for text-type materials, create paragraphs and text-formatted objects in the word document and insert them directly, retaining the original line breaks, spaces and other information.
[0205] That is, for text materials, a corresponding text insertion paragraph is created in the word document for each text material, and the content of each text material is inserted into the corresponding text insertion paragraph in the word document while retaining the original line breaks, spaces and relative position information.
[0206] S707. In the document platform, for picture-type materials, after creating text objects in paragraph and picture formats, read the pictures into the text objects in a streaming manner.
[0207] That is to say, in the word document, create corresponding picture insertion paragraphs for each picture material, read each picture material into the word document in a streaming manner, and insert each picture into the picture insertion paragraph corresponding to the picture. When reading in a streaming manner, it is to read by means of the file path of the picture in step S704.
[0208] S708. In the document platform, for materials of table type, traverse and read the worksheets one by one, add corresponding numbers of tables in the word document, merge the worksheets with the newly added tables one by one, and retain the fonts and cell styles in the worksheets.
[0209] That is to say, for each excel file to be merged, create tables in the word document with the same number of worksheets as in the excel file, traverse the excel file, and merge the content of each worksheet in the excel file into the table corresponding to the worksheet in the word document while retaining the format.
[0210] S709. In the document platform, for materials of pdf file, traverse and read each page of the pdf, and convert each read page into a picture and append it to the word document.
[0211] That is to say, for each pdf file to be merged, convert each page of the pdf file into a picture, and insert the converted pictures into the word document in the original page order. Suppose there is a pdf file to be merged, and the pdf file contains 5 pages of content, it can be converted into 5 pictures, and after sorting the 5 pictures in the original page order, insert them into the word document in sequence. It should be understood that the values in this example are for the convenience of understanding the solution and there is no limitation.
[0212] S710. In the document platform, for materials of ppt file, traverse and read each page of the ppt, and convert each read page into a picture and append it to the word document.
[0213] That is to say, for each ppt file to be merged, convert each page of the ppt file into a picture, and insert the converted pictures into the word document in the original page order.
[0214] It should also be understood that each page of the ppt file may also include annotation content. The annotation can only be text annotation, so the annotation content can be inserted in front of or behind the insertion position of the picture converted from the page of the ppt after being parsed into text.
[0215] S711. In the document platform, for materials of html type, first convert the html into a word file, and then process it according to the merging method of the word file.
[0216] That is to say, after converting each offline HTML file into a Word file, merge the offline HTML file into the Word document according to the merging steps of the Word file.
[0217] S712. In the document middleware platform, for materials of the Word type, directly merge the Word file into the created Word document.
[0218] That is to say, when there are at least one Word file, keep the format of the content in each Word file and merge it into the above Word document according to the relative order in which the Word file is selected. Since the above steps are all executed in the Word document, and inserting a Word file in Word can be directly inserted while retaining all the original formats, so here it is only necessary to insert the Word files to be inserted in sequence.
[0219] S713. In the document middleware platform, for materials of the global annotation type, convert the global annotation into a picture and process it according to the merging method of pictures.
[0220] That is to say, convert each global annotation into a picture, and insert the converted picture into the Word document while retaining the original page order.
[0221] S714. Convert the completed Word document after strong merging into a PDF document.
[0222] S715. After synthesis, through the document middleware platform, store the converted PDF document in the specified disk location.
[0223] That is to say, after steps S701 - S713 are executed, and all the materials to be merged are merged into the Word document, obtaining a synthesized Word document (an example of the third Word document), then step S714 can be executed to convert the Word document into a PDF document, and then step S715 can be executed to store the PDF document in the specified disk location.
[0224] S716. Use the document middleware platform to pop up a snackbar indicating successful merging.
[0225] For example, it can be the snackbar shown in interface 208.
[0226] S717. In response to the user's operation of clicking the sharing control in the snackbar, trigger sharing.
[0227] For example, it can be clicking the sharing control "Share to Other Applications" shown in interface 208 to trigger sharing.
[0228] S718. In the document middleware platform, call the API of the sharing framework.
[0229] S719. Pull up the sharing panel through the sharing framework.
[0230] The sharing panel can be, for example, the pop-up window #3 shown in interface 209.
[0231] S720. In the sharing framework, in response to the user's operation of clicking on the application icon in the sharing panel, select the sharing target.
[0232] That is to say, based on which application icon the user clicks, that application is the following third-party application.
[0233] S721. Through the sharing framework, pull up the third-party application and pass the URI of the merged document to the third-party application.
[0234] That is to say, start the third-party application and send the URI to the third-party application.
[0235] S722. Read and use the pdf document in the third-party application.
[0236] That is to say, the third-party application reads the pdf document based on the received URI.
[0237] It can be seen that Figure 7 An example of the merging process of the pdf document is given. In this example, the types of materials can be text, pictures, and various files, but do not include videos, audios, and audio excerpts. Figure 7 It is not directly synthesized into a pdf document, but by leveraging the editing capabilities of a word document, first merge all mergeable materials into a word document and then convert it into a pdf document. It should also be understood that Figure 7 In the example of, the materials supported for merging pdf documents include text, pictures, tables, pdf, ppt, offline html, word, and global comments. In actual applications, the types of materials can also be determined according to the actual processing capabilities of the electronic device. For example, it can still include videos, but the video materials only retain the first-frame image and do not load the video stream. Another example is that the video excerpt can only retain the text and screenshots and does not retain the video stream. Another example is that it can only include three types of materials: text, pictures, and global comments. Other situations will not be listed one by one.
[0238] For txt documents and long picture documents, reference can be made to Figure 6 and Figure 7The execution process is only that the process of merging the materials to be merged until the target document is generated can be different. For example, assuming a txt document is generated, it can include: the user initiates document merging through the collection space application; constructs a material information list in the collection space; initiates document merging to the document middle platform through the collection space and carries the material information list; obtains all the materials to be merged in the document middle platform. Since it is a text type, the text content is directly obtained; creates an empty new txt document in the document middle platform; in the document middle platform, for text type materials, directly inserts them after creating a paragraph in the txt document; after all materials (only text materials) are inserted in sequence, uses the document middle platform to pop up a snackbar indicating successful merging; in response to the user's operation of clicking the sharing control in the snackbar, triggers sharing; in the document middle platform, calls the API of the sharing framework; pulls up the sharing panel through the sharing framework; in the sharing framework, in response to the user's operation of clicking the application icon in the sharing panel, selects the sharing target; through the sharing framework, pulls up a third-party application and passes the URI of the merged document to the third-party application; the third-party application reads and uses the merged txt document. Another example, assuming a long picture document is generated, it can include: the user initiates document merging through the collection space application; constructs a material information list in the collection space; initiates document merging to the document middle platform through the collection space and carries the material information list; obtains all the materials to be merged in the document middle platform. Since it is a picture type, the file path needs to be obtained; creates an empty new long picture document in the document middle platform; in the document middle platform, for picture type materials, directly inserts them after creating a paragraph in the long picture document; after all materials (only picture materials) are inserted in sequence, uses the document middle platform to pop up a snackbar indicating successful merging; in response to the user's operation of clicking the sharing control in the snackbar, triggers sharing; in the document middle platform, calls the API of the sharing framework; pulls up the sharing panel through the sharing framework; in the sharing framework, in response to the user's operation of clicking the application icon in the sharing panel, selects the sharing target; through the sharing framework, pulls up a third-party application and passes the URI of the merged document to the third-party application; the third-party application reads and uses the merged long picture document. Another example, assuming a long picture document is generated, it can refer to Figure 7 the process shown, still creates a word document and then converts the word document into the target document. Only at this time, the target document becomes a long picture document. In this example, the pdf document after step S714 in Figure 7 can be directly replaced with a long picture document, and other contents remain unchanged.
[0239] The method of the embodiments of the present application has been mainly introduced in combination with the accompanying drawings. It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown, these steps are not necessarily executed in the order shown in the figures. Unless there is a clear description in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps. The device of the embodiments of the present application will be introduced below in combination with the accompanying drawings.
[0240] Figure 8 is a schematic diagram of a device for synthesizing documents according to an embodiment of the present application. As Figure 8 shown, the device 2000 includes a display unit 2001 and a processing unit 2002. The device 2000 may be integrated in an electronic device such as a mobile phone, a tablet computer, a touch-screen laptop computer, etc.
[0241] The device 2000 can be used to execute any one of the above methods. For example, the display unit 2001 can be used to execute step S501, and the processing unit 2002 is used to execute steps S502 - S508. The device 2000 can also be used to execute Figure 6 and Figure 7 each step. The device 2000 can also be used to execute Figures 2 - 4 the interaction process shown.
[0242] In one implementation, the device 2000 may further include a storage unit for storing relevant data. The storage unit may be integrated in any one of the above units, or may be a unit independent of all the above units.
[0243] Figure 9 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. As Figure 9As shown, the electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, an antenna 1, an antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, a headphone jack 970D, a sensor module 980, a button 990, a motor 991, an indicator 992, a camera 993, a display screen 994, and a subscriber identification module (SIM) card interface 995, etc. Among them, the sensor module 980 may include a pressure sensor 980A, a gyroscope sensor 980B, a barometric pressure sensor 980C, a magnetic sensor 980D, an acceleration sensor 980E, a distance sensor 980F, a proximity light sensor 980G, a fingerprint sensor 980H, a temperature sensor 980J, a touch sensor 980K, an ambient light sensor 980L, a bone conduction sensor 980M, etc.
[0244] It can be understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device 900. In other embodiments of this application, the electronic device 900 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0245] Exemplarily, Figure 9 The illustrated processor 910 may include one or more processing units. For example, the processor 910 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0246] Among them, the controller may be the nerve center and command center of the electronic device 900. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching instructions and executing instructions.
[0247] A memory can also be set in the processor 910 for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. This memory can store the instructions or data that the processor 910 has just used or recycled. If the processor 910 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.
[0248] The electronic device 900 implements the display function through the GPU, the display screen 994, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 994 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 910 may include one or more GPUs, which execute program instructions to generate or change display information.
[0249] The display screen 994 is used to display images, videos, etc. The display screen 994 includes a display panel. In some embodiments, the electronic device 900 may include 1 or N display screens 994, where N is a positive integer greater than 1.
[0250] The electronic device 900 can implement the shooting function through the ISP, the camera 993, the video codec, the GPU, the display screen 994, and the application processor, etc.
[0251] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 900 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0252] The pressure sensor 980A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 980A may be disposed on the display screen 994. There are many types of pressure sensors 980A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force acts on the pressure sensor 980A, the capacitance between the electrodes changes. The electronic device 900 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 994, the electronic device 900 detects the intensity of the touch operation according to the pressure sensor 980A. The electronic device 900 can also calculate the position of the touch according to the detection signal of the pressure sensor 980A. In some embodiments, touch operations with the same touch position but different touch operation intensities may correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
[0253] The touch sensor 980K, also known as the "touch panel". The touch sensor 980K can be disposed on the display screen 994, and the touch sensor 980K and the display screen 994 form a touch screen, also known as the "touch display screen". The touch sensor 980K is used to detect touch operations acting on it or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 994. In other embodiments, the touch sensor 980K can also be disposed on the surface of the electronic device 900, at a different position from the display screen 994.
[0254] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, for their specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details are not described here again.
[0255] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0256] An embodiment of this application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, the electronic device can implement the steps in any of the above methods.
[0257] An embodiment of this application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by an electronic device, it can implement the steps in each of the above method embodiments.
[0258] An embodiment of this application provides a computer program product, which includes a computer program. When the computer program is executed by an electronic device, it can implement the steps in each of the above method embodiments.
[0259] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of this application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a portable hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0260] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0261] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0262] In the embodiments provided in this application, it should be understood that the disclosed device / equipment and method can be implemented in other ways. For example, the device / equipment embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical, or other form.
[0263] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0264] It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0265] It should also be understood that the term "and / or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0266] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when", "once", "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if detected [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detected [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0267] In addition, in the description of the specification and appended claims of this application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0268] The reference to "one embodiment" or "some embodiments" etc. described in this specification means that a specific feature, structure or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0269] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included within the protection scope of the present application.
Claims
1. A method for synthesizing a document, characterized in that, Including: Run the first application on the electronic device and display the first interface, where the first interface includes multiple materials, and the multiple materials include at least one of text, picture, video, audio, word file, ppt file, pdf file, excel file, offline html file, txt file, video excerpt, and global annotation; In response to the user's selection operation on at least one of the multiple materials, display a selection identifier of the selected material and a first control in the first interface, and the first control is used to indicate generating a document; In response to the user's click operation on the first control, display a first pop-up window in the first interface, and display a first material set in the first pop-up window, where the first material set includes all the selected materials and all the selected materials are sorted in the selected order; In response to the user's click operation on the second control in the first pop-up window, display a second pop-up window, where the second pop-up window includes at least one document generation control, and each document generation control corresponds to a document generation function, and the second control is used to indicate generating a document; In response to the user's click operation on the word document generation control in the second pop-up window, merge all the materials in the first material set into a target word document, and the word document generation control is used to indicate generating a word document.
2. The method according to claim 1, wherein The second pop-up window further includes a pdf document generation control, and the pdf document generation control is used to indicate generating a pdf document. The method further includes: In response to the user's click operation on the pdf document generation control, merge all the materials in the first material set into a target pdf document.
3. The method according to claim 2, wherein The step of, in response to the user's click operation on the pdf document generation control, merging all the materials in the first material set into a target pdf document includes: Merge all the materials in the first material set into a first word document; Convert the first word document into the target pdf document.
4. The method according to claim 1, characterized in that, The second pop-up window further includes a txt document generation control or a long picture document generation control. The txt document generation control is used to indicate generating a txt document, and the long picture document generation control is used to indicate generating a long picture. The method further includes: When the first material set only includes multiple text materials, in response to the user's click operation on the txt document generation control, merge all the text materials in the first material set in the selected order into a txt document; or, When the first material set only includes multiple picture materials and / or global annotation materials, in response to the user's click operation on the long picture document generation control, merge all the picture materials in the first material set and / or the pictures converted from all the global annotation materials in the selected order into a long picture document.
5. The method according to claim 1, wherein After displaying the second pop-up window in response to the user's click operation on the second control in the first pop-up window, the method further includes: When at least one of video, audio, word file, ppt file, pdf file, excel file, and video excerpt is included in the first material set, a word document generation control is displayed in the second pop-up window; or, When only at least one of text, picture, offline html file, and global annotation is included in the first material set, a word document generation control and a pdf document generation control are displayed in the second pop-up window; or, When only text material is included in the first material set, a word document generation control, a pdf document generation control, and a txt document generation control are displayed in the second pop-up window; or, When only at least one of picture and global annotation is included in the first material set, a word document generation control, a pdf document generation control, and a long picture document generation control are displayed in the second pop-up window.
6. The method according to claim 1, characterized in that, The response to the user's click operation on the word document generation control in the second pop-up window to merge all materials in the first material set into a target word document includes: Create an empty second word document; According to the materials in the first material set, perform at least one of the following operations: When at least one text material is included in the first material set, create a corresponding text insertion paragraph for each text material in the second word document, and insert the content of each text material in the at least one text material into the corresponding text insertion paragraph of the text material in the second word document while retaining the original line breaks, spaces, and relative position information; When at least one picture material is included in the first material set, create a corresponding picture insertion paragraph for each picture material in the second word document, read the at least one picture material into the second word document by means of a stream, and insert each picture into the picture insertion paragraph corresponding to the picture; When at least one video material is included in the first material set, create a video insertion paragraph for each video material in the second word document. For each video material, insert the first frame image of the video material as a thumbnail into the video insertion paragraph corresponding to the video material, read the video stream of the video material into the second word document, and insert the read video stream into the video insertion paragraph corresponding to the video material; When at least one audio material is included in the first material set, create an audio insertion paragraph for each audio material in the second word document. For each audio material, insert the title information of the audio material into the audio insertion paragraph corresponding to the audio material, read the audio stream of the audio material into the second word document, and insert the read audio stream into the audio insertion paragraph corresponding to the audio material; When at least one Excel file is included in the first material set, for each Excel file, create a table with the same number of worksheets as in the Excel file in the second Word document, traverse the Excel file, and merge the content of each worksheet in the Excel file into the corresponding table in the second Word document while preserving the format; When at least one Word file is included in the first material set, merge the content of each Word file into the second Word document while preserving the format in the relative order in which the Word file is selected; When at least one TXT file is included in the first material set, merge the content of each TXT file into the second Word document in the relative order in which the TXT file is selected; When at least one PPT file is included in the first material set, for each PPT file, convert each page of the PPT file into a picture, and insert the converted pictures into the second Word document in the original page order; When at least one PDF file is included in the first material set, for each PDF file, convert each page of the PDF file into a picture, and insert the converted pictures into the second Word document in the original page order; When at least one offline HTML file is included in the first material set, convert each offline HTML file into a Word file, and then merge the offline HTML file into the second Word document according to the merging steps of the Word file; When at least one video excerpt material is included in the first material set, for each video excerpt material, merge the text of the video excerpt material into the second Word document in the order of the text in the video excerpt material according to the merging steps of the text material, merge the screenshots of the video excerpt material into the second Word document in the order of the screenshots in the video excerpt material according to the merging steps of the picture material, and merge the video of the video excerpt material into the second Word document in the order of the video in the video excerpt material according to the merging steps of the video material; When at least one global annotation is included in the first material set, convert each global annotation into a picture, and insert the converted pictures into the second Word document in the original page order; After all the materials in the first material set are merged into the second Word document, the target Word document is obtained.
7. The method according to claim 6, wherein When at least one picture material is included in the first material set, create a corresponding picture insertion paragraph for each picture material in the second Word document, read the at least one picture material into the second Word document by means of a stream, and insert each picture into the picture insertion paragraph corresponding to the picture, including: In the second Word document, display the first picture on the left, the second picture centered, and scale the third picture proportionally to fit within one page. The first picture is a picture with a size less than or equal to a first threshold, the second picture is a picture with a size greater than the first threshold and less than or equal to a second threshold, and the size of the third picture is greater than the second threshold. The second threshold is determined based on the maximum display area of one page of the second Word document.
8. The method according to claim 6, wherein The method further includes: In the second Word document, the inserted Word files, Excel files, PPT files, PDF files, and offline HTML files are arranged in chapter form. Each chapter corresponds to a file, and the title of each chapter is the file name corresponding to that chapter.
9. The method according to claim 6, wherein The method further includes: After all the materials in the first material set are merged into the second Word document, delete the blank pages in the second Word document to obtain the target Word document.
10. The method according to claim 6, wherein The method further includes: Monitor the size of the second Word document in real time; When it is detected that the size of the second Word document is greater than or equal to a preset Word document size threshold, stop merging the materials in the first material set into the second Word document to obtain the target Word document.
11. The method according to claim 3, characterized in that, The merging of all the materials in the first material set into a first Word document includes: Create an empty third Word document; According to the materials in the first material set, perform at least one of the following operations: When the first material set includes at least one text material, create a corresponding text insertion paragraph in the third Word document for each text material, and insert the content of each text material in the at least one text material into the corresponding text insertion paragraph in the third Word document while retaining the original line breaks, spaces, and relative position information; When the first material set includes at least one picture material, create a corresponding picture insertion paragraph in the third Word document for each picture material, read the at least one picture material into the third Word document through a stream, and insert each picture into the picture insertion paragraph corresponding to that picture; When the first material set includes at least one video material, create a video insertion paragraph in the third Word document for each video material, and for each video material, insert the first frame image of the video material as a thumbnail into the video insertion paragraph corresponding to that video material; When the first material set includes at least one audio material, create an audio insertion paragraph in the third Word document for each audio material, and for each audio material, insert the title information of the audio material into the audio insertion paragraph corresponding to that audio material; When at least one Excel file is included in the first material set, for each Excel file, create a table in the third Word document with the same number of worksheets as in the Excel file. Traverse the Excel file and merge the content of each worksheet in the Excel file into the corresponding table in the third Word document while preserving the format; When at least one Word file is included in the first material set, merge the content of each Word file into the third Word document while preserving the format in the relative order in which the Word document is selected; When at least one TXT file is included in the first material set, merge the content of each TXT file into the third Word document in the relative order in which the TXT file is selected; When at least one PPT file is included in the first material set, for each PPT file, convert each page of the PPT file into an image, and insert the converted images into the third Word document in the original page order; When at least one PDF file is included in the first material set, for each PDF file, convert each page of the PDF file into an image, and insert the converted images into the third Word document in the original page order; When at least one offline HTML file is included in the first material set, after converting each offline HTML file into a Word file, merge the offline HTML file into the third Word document according to the merging steps of the Word file; When at least one video excerpt material is included in the first material set, for each video excerpt material, merge the text of the video excerpt material into the third Word document in the order of the text in the video excerpt material according to the merging steps of the text material, merge the screenshots of the video excerpt material into the third Word document in the order of the screenshots in the video excerpt material according to the merging steps of the picture material, and merge the thumbnail of the first frame image of the video of the video excerpt material into the third Word document in the order of the video excerpt material; When at least one global comment is included in the first material set, convert each global comment into an image, and insert the converted images into the third Word document in the original page order; After all the materials in the first material set are merged into the third Word document, the first Word document is obtained.
12. The method according to any one of claims 1 to 11, characterized in that The method further includes: After generating the target Word document, display a floating capsule snackbar, which includes a sharing control; In response to the user's click operation on the sharing control, display a third pop-up window, which includes at least one application icon; In response to a user's click operation on any one of the at least one application icon, start the second application corresponding to the target icon, and open the target word document in the second application.
13. An electronic device, comprising a memory, one or more processors, and a computer program stored in the memory and executable on the processors, characterized in that, When the one or more processors execute the computer program, the electronic device implements the method according to any one of claims 1 to 12.
14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the electronic device, it implements the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Content sharing method and system based on dragging operations
CN103369048A
Apparatus and method for processing information list in terminal device
CN104572803A
Information transfer method and electronic equipment
CN117130507A
Method for generating new readable file by extracting and combining multiple files
CN117235019A
Methods and systems of enabling document sharing in co-browsing sessions
US20210081363A1