File processing method and device, electronic equipment, storage medium and program product
By analyzing the common features in the presentation file and creating a second layout, the problem of inconsistent content of multiple pages in the presentation file is solved, and a more efficient editing process is achieved.
Patent Information
- Application Number
- CN202411084725.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, the contents of multiple pages in the demonstration file are not unified due to custom editing, which leads to cumbersome and complex editing operations, making it difficult to improve editing efficiency.
By analyzing the common characteristics of each page under the same layout in the presentation file, creating a corresponding second layout, and applying it to the presentation file, thereby reducing editing operations for each page and achieving content unification.
It improves the editing efficiency of the presentation file, makes the content of each page more unified, and reduces the complexity of editing operations.
Smart Images

Figure CN119065556A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of document processing, and in particular to a file processing method, device, electronic device, storage medium and program product. Background Art
[0002] Presentation files can include documents or software applications used to present information, data, and tutorials. Presentation files usually contain visual elements and convey these visual elements to users in the form of pages to effectively convey information. Among them, visual elements can include: charts, pictures, videos, and text.
[0003] Users can use editing software to integrate text, pictures, charts, animations and other elements to create professional and attractive presentation files. Presentation files are widely used in daily work in various industries, such as marketing, conference reports, education and training, etc. Therefore, the demand for efficient editing of presentation files is becoming more and more important. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a file processing method, device, electronic device, storage medium and program product, so as to make the content of each page in the presentation file more unified on the basis of reducing the editing operations for each page.
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a file processing method, comprising:
[0006] In response to an opening operation on a first presentation file, determining common features of first pages using a first layout in the first presentation file; wherein the first presentation file includes at least two pages;
[0007] Creating a second layout corresponding to the first layout based on the common features; wherein the second layout at least includes the common features;
[0008] Apply the second layout to the first page to obtain a first target presentation file.
[0009] According to a second aspect of an embodiment of the present disclosure, there is provided a file processing device, comprising:
[0010] A determination module is configured to determine, in response to an opening operation on a first presentation file, common features of first pages using a first layout in the first presentation file; wherein the first presentation file includes at least two pages;
[0011] A first creation module is configured to create a second layout corresponding to the first layout based on the common features; wherein the second layout at least includes the common features;
[0012] The first application module is configured to apply the second layout to the first page to obtain a first target presentation file.
[0013] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0014] processor;
[0015] Memory for storing computer programs or instructions;
[0016] The processor executes the computer program or instructions to implement the steps of any one of the methods in the first aspect above.
[0017] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the storage medium stores a computer program or instructions. When the computer program or instructions in the storage medium are executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0018] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of any one of the methods described in the first aspect.
[0019] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0020] The present disclosure analyzes and extracts common features of each page (first page) under the same layout (first layout) in the presentation file, sets the common features to the second layout, and then applies the second layout to the presentation file.
[0021] When there are multiple pages in a presentation file, use the common features of the pages of the same layout to create a second layout corresponding to the same layout, and apply the second layout to the presentation file. This can reduce the editing operations for each page and make the content of each page in the presentation file more unified, thereby improving the editing efficiency of the presentation file.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0024] Figure 1 The following is a flow chart of a file processing method according to an exemplary embodiment. Figure 1.
[0025] Figure 2 It is a schematic diagram showing different types of layouts according to an exemplary embodiment.
[0026] Figure 3 is a schematic diagram of a second format according to an exemplary embodiment Figure 1 .
[0027] Figure 4 is a schematic diagram of a first format according to an exemplary embodiment.
[0028] Figure 5 is a schematic diagram of a second format according to an exemplary embodiment Figure 2 .
[0029] Figure 6 is a schematic diagram of a text page according to an exemplary embodiment Figure 1 .
[0030] Figure 7 is a schematic diagram of a text page according to an exemplary embodiment Figure 2 .
[0031] Figure 8 is a schematic diagram of a text page according to an exemplary embodiment Figure 3 .
[0032] Fig. 9 The figure is a block diagram of a file processing device according to an exemplary embodiment.
[0033] Fig.10 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0035] Figure 1 The following is a flow chart of a file processing method according to an exemplary embodiment. Figure 1 .like Figure 1 As shown, the method mainly includes the following steps:
[0036] In step 101, in response to an opening operation on a first presentation file, common features of a first page using a first layout in the first presentation file are determined;
[0037] In step 102, a second layout corresponding to the first layout is created based on the common features; wherein the second layout includes at least the common features;
[0038] In step 103, the second layout is applied to the first page to obtain a first target presentation file.
[0039] It should be noted that the file processing method proposed in the present disclosure can be applied to electronic devices or servers. Here, electronic devices may include: terminal devices, such as mobile terminals or fixed terminals. Among them, mobile terminals may include: mobile phones, tablet computers, laptop computers, etc. Fixed terminals may include: desktop computers, smart TVs, etc. As a type of computer, a server can provide computing or application services for other clients (such as computers, terminal devices such as smart phones, and even large devices such as train systems) in the network.
[0040] The file processing method in the embodiment of the present disclosure may be configured in a file processing device, and the file processing device may be set in a server, or may also be set in an electronic device, which is not limited by the embodiment of the present disclosure.
[0041] It should be noted that the execution subject of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) in a server or electronic device in terms of hardware, or may be, for example, a related background service in a server or electronic device in terms of software, without limitation.
[0042] Presentation files can include documents or software applications used to present information, data, and tutorials. Presentation files usually contain visual elements and convey these visual elements to users in the form of pages. Among them, visual elements can include: charts, pictures, videos, and text.
[0043] Exemplarily, the presentation files provided by the present disclosure may include: PowerPoint presentations (PPT documents, also known as PPT documents), portable document format (PDF) documents, interactive presentation files (such as application files of web pages), Keynote presentations, etc.
[0044] In some embodiments, a presentation file can be created and edited by a pre-installed tool (e.g., an application), and the tool can run on one or more operating systems, such as Windows operating system, Mac operating system, Linux operating system, Android operating system, IOS operating system, Harmony operating system, or other operating systems.
[0045] In the disclosed embodiment, the common features (page styles or objects in the pages) of each page in the same layout in the presentation file can be extracted based on the selected tool, and the common features can be set on the second layout, and then the second layout is applied to the presentation file to normalize the presentation file. Among them, the selected tool can be a software tool generated based on a programming language, and the information and content of the presentation file can be obtained through an interface call, and then the presentation file can be edited. In some embodiments, the corresponding tool can be selected based on the type of the presentation file.
[0046] In some embodiments, the tool for creating and editing a presentation file may be an editing tool independent of the presentation file. In other embodiments, the tool for creating and editing a presentation file may be integrated into the editing tool of the presentation file. Taking the presentation file as a PPT document as an example, the PPT document may be edited by a tool obtained by programming based on VBA (visual basic for applications), JS (javascript) or other macro languages.
[0047] In the embodiments of the present disclosure, the demonstration file is a PPT document, and the selected tool is a tool obtained by programming based on the VBA macro language. It can be understood that the demonstration file can also be other types of demonstration files, and the selected tool can be other types of tools, which are not specifically limited in the embodiments of the present disclosure.
[0048] It should be noted that the first presentation file may be a presentation file with a type tag. For example, it may be a PPT document with a type tag. Here, the type tag may include: a tag for marking each page (slide page) in the first presentation file, a tag for marking each layout in the first presentation file, a tag for marking the master in the first presentation file, etc. Among them, based on the tags of each page in the first presentation file, the type of each page can be determined; based on the tags for marking each layout in the first presentation file, the type of each layout can be determined. In some embodiments, the first presentation file includes at least two pages.
[0049] In some embodiments, different types of pages may include: cover page, body page, directory page, end page, decorative page, data page, image page, etc.
[0050] Figure 2 is a schematic diagram of different types of layouts according to an exemplary embodiment, such as Figure 2As shown, different types of layouts may include: "Title Slide" layout, "Title and Content" layout, "Table of Contents" layout, "Section Title, Two-Column Content" layout, "Comparison" layout, "Title Only" layout, "Blank" layout, "Content Only" layout, "Title and Subtitle" layout, "End Slide" layout, and custom layout, etc. Among them, Figure 2 All the layouts in the diagram are blank layouts, and the currently displayed page 201 is the cover page.
[0051] In some embodiments, each type tag in the first presentation file may be marked when the first presentation file is created; or it may be marked before the first presentation file is processed in the present disclosure. Exemplarily, in response to an opening operation on the first presentation file, the first presentation file is marked to obtain a first presentation file with a type tag. After obtaining the first presentation file with a type tag, the tags of each page in the first presentation file and the tags of the layout currently used by each page may be identified, thereby obtaining the type of each page and the type of the layout used by each page, and then determining the first page in the first presentation file that uses the first layout.
[0052] It should be noted that the first page using the first layout may be one or more. When the first page using the first layout is one, the common features may be determined based on the one first page. When the pages using the first layout are multiple, the common features may be determined based on the multiple first pages.
[0053] In some embodiments, the first layout may be any type of layout, for example, a text page layout or a custom layout, etc. The first page is a slide page using the first layout, and there is a corresponding relationship between the first layout and the first page. Taking the first layout as a text page layout as an example, the first page may be a text page; taking the first layout as a custom layout as an example, the first page may be a custom page; taking the first layout as a cover page layout as an example, the first page may be a cover page. The opening operation may be an opening instruction initiated by the editing software (application) to start and open the first presentation file.
[0054] In some embodiments, one or more pages in the presentation file may use the body page layout. The body page layout may include: "title and content" layout, "title only" layout, and "blank" layout. Through the page tag, all pages using the body page layout can be obtained. The layout according to the body page layout is divided into three categories: the first category, title and content; the second category, title only; and the third category, blank.
[0055] For the first category, there needs to be both a title and a text shape (object) on the page. The method for determining the text shape is: the shape contains text, or the shape's label is text, or the shape is a table, or the shape is a picture, or the shape is a chart; and the area of the shape must be greater than a preset area threshold (for example, the area of the shape is greater than 32*32 pixels). For the second category, there can be only a title shape on the page, but no text shape. For the third category, it can be a text page that does not meet the first and second category conditions.
[0056] When applying a body page layout, you can set the layout of a slide page of the Title and Content type to the Title and Content layout, and point the slide page's title shape to the title placeholder on the layout, and keep the original position. Set the layout of a slide page of the Title type to the Title Only layout, and point the slide page's title shape to the title placeholder on the layout, and keep the original position. Set the layout of a slide page of the Untitled type to the Blank layout.
[0057] In other embodiments, after the opening operation is detected, the pages in the first presentation file may be grouped based on the types of the layouts currently used by the pages. It can be understood that one type of layout may correspond to a group of pages, and then each layout and the corresponding group of pages are processed separately. Exemplarily, when the opening operation for the first presentation file is detected, the body pages using the body page layout may be determined, the custom pages using the custom layout may also be determined, and the cover pages using the cover page layout may also be determined.
[0058] The first layout mentioned in the present disclosure may be any layout among the layouts currently used by the pages in the first presentation file, and each first page may be a group of pages using the any layout.
[0059] In the embodiment of the present disclosure, determining the common features of the first page using the first layout in the first presentation file may be based on processing the first page using the first layout in the first presentation file, selecting the content in the first page, and using the selected content as the common features. Exemplarily, the common features may be the content of the first page or the content of each first page or the content of multiple first pages selected by the user as the common features. In another embodiment, after determining each first page using the first layout in the first presentation file, each first page may be analyzed and processed to determine the common features. Exemplarily, the process of analyzing and processing each first page to determine the common features may include: determining the features existing in each first page as the common features; or determining the features existing in a preset number of first pages as the common features, for example, determining the features existing in 5 first pages as the common features, etc.
[0060] The common features may be features existing in part or all of the first pages.
[0061] In some embodiments, when the common features are features present in all first pages, after determining the common features, the common features can be deleted from each first page to obtain the first page after the deletion process, and the second layout is applied to all the first pages after the deletion process to obtain the first target presentation file. The features of the page may include: page style and / or objects in the page. The page style may include: background style of the page, layout of objects in the page, etc.
[0062] In some other embodiments, applying the second layout to the first page to obtain a first target presentation file includes:
[0063] Determining, from each of the first pages, pages to be processed that have common features;
[0064] Deleting the common features from the page to be processed to obtain a second page;
[0065] The second layout is applied to the second page and the first page that has not been deleted to obtain a first target presentation file.
[0066] It should be noted that, in the case where not all first pages have common features, the features in each first page can be analyzed and processed, and the features (such as objects) that appear in each first page with a higher probability can be determined as common features. For example, features that appear in each first page with a frequency greater than a preset threshold can be determined as common features. The frequency of appearance in each first page can be the cumulative number of times the feature appears in each first page. The above is an exemplary description of determining common features. In other embodiments, common features can also be determined by other methods, as long as the common features of each first page can be determined, and no specific limitation is made here.
[0067] Since not all first pages have common features, after determining the common features, the pages to be processed that have the common features can be determined from the first pages, and the common features can be deleted from the pages to be processed to obtain the second page. The second layout is then applied to the second page and the first pages that have not been deleted to obtain the first target presentation file.
[0068] In the disclosed embodiment, after the common features are determined, the common features can be deleted from the corresponding first page, and then the second layout can be applied to the page after the deletion process. Since the second layout includes the common features, by deleting the common features from the corresponding first page, it is possible to avoid the situation where the original objects and common features on some pages are repeated due to the application of the second layout.
[0069] In some embodiments, the function and type of the feature are not specifically limited. Exemplarily, it can be a non-text feature or a text feature, etc. Among them, the text feature can be the part used to display and edit text in the presentation file, for example, it can include a text box. The non-text feature can be all features except text, for example, it can include: graphic objects (such as rectangles, circles, triangles, etc.), pictures, etc. Exemplarily, the common feature can be a non-text object, for example, it can be a decorative object (decorative shape) in the page.
[0070] In some embodiments, determining common features of first pages using the first layout includes:
[0071] Based on the feature information of the objects in each first page in the first demonstration file, a common object is determined from the objects included in the first page, and the common object is determined as a common feature.
[0072] In some embodiments, images corresponding to the objects in each first page can be generated based on the feature information of the objects in each first page. After the images corresponding to the objects in each first page are obtained, the pixel values of each image can be compared to obtain a first comparison result, and based on the first comparison result, a common object can be determined from the objects included in each first page. In some embodiments, non-text objects in the first page can be determined as objects to be processed, or text objects in the first page can be determined as objects to be processed, which is not specifically limited here.
[0073] Exemplarily, taking the case where the first page is a text page and the object to be processed is a non-text object (e.g., a decorative shape), each text page can be analyzed, and objects that do not contain text (non-text objects) can be determined as objects to be processed. After the non-text objects are determined, images can be generated based on feature information of the non-text objects in each first page, and pixel values of each image can be compared, and based on the first comparison result, common objects can be determined from the non-text objects included in each first page.
[0074] It should be noted that images can correspond to objects, that is, one object corresponds to one image, and objects corresponding to images with the same pixel values can be determined as common objects; images can correspond to pages, and if there are multiple objects on a page, there can be multiple objects in one image. In this case, objects located in areas with the same pixel values can be determined as common objects.
[0075] In some embodiments, the number of non-text objects in the first page may be one or more.
[0076] Taking the case where there are multiple non-text objects in the first page and one first page corresponds to one image as an example, it can be determined whether there are regions with the same pixel value in each image, and the non-text objects located in the region with the same pixel value are determined as common features. Taking the case where the first page is a text page and the non-text objects are decorative shapes as an example, if there are multiple decorative shapes in the text page, it can be determined whether there are regions with the same pixel value in each image, and the decorative shapes located in the region with the same pixel value are determined as common decorative shapes.
[0077] Taking the example that there is at least one non-text object in the first page, images can be generated based on the feature information of each non-text object, that is, one image is generated for each non-text object, and it is determined whether the pixel values in the images corresponding to each non-text object are the same. If there are non-text objects with the same pixel values in the images, the non-text object can be determined as a common object. Still taking the example that the first page is a text page and the non-text object is a decorative shape, a first picture generated based on a first decorative shape in any first page and a second picture generated based on a second decorative shape in other first pages can be obtained, and it is determined whether the pixel values of the first picture and the second picture are the same. If the pixel values of the first picture and the second picture are the same, the first decorative shape and the second decorative shape are determined as common decorative shapes.
[0078] The above embodiments are for the case where there are multiple first pages. In other embodiments, when there is only one first page, the objects in the one first page can be directly determined as common features.
[0079] In the disclosed embodiment, images corresponding to the objects in each first page can be generated based on the feature information of the objects in each first page. After the images corresponding to the objects in each first page are obtained, the pixel values of each image can be compared, and based on the first comparison result, common objects can be determined from the objects included in each first page, and the features of the common objects can be determined as common features.
[0080] By converting each object in the first page into an image format and determining the common object based on the converted image, compared with performing feature analysis on each object one by one and determining the common object, the workload of presentation file processing can be reduced and work efficiency can be improved; and by processing each object in an image format, at least common objects of the same shape can be achieved on each first page, thereby achieving a unified style for each first page.
[0081] In some other embodiments, the feature information of the objects in the first page of the first presentation file may be directly compared to obtain a second comparison result, and based on the second comparison result, a common object may be determined from the objects included in the first page, and the common object may be determined as a common feature. The feature information of the object may include at least one of the following: attribute information of the object, the type of the object; and the content included in the object. Exemplarily, the attribute information of the objects in the first page may be compared, and based on the obtained second comparison result, a common object may be determined from the objects included in the first page. For example, when the second comparison result indicates that there are objects with the same attribute information, the objects with the same attribute information may be determined as common objects.
[0082] In some embodiments, after determining the common features, a second layout corresponding to the first layout may be created based on the common features. For example, a blank layout of the same type as the first layout may be created, and the common features may be updated to the blank layout to obtain the second layout. After obtaining the second layout, the second layout may be applied to the first page to obtain the first target presentation file.
[0083] It should be noted that the common features are determined based on the first page using the first layout, and after the common features are determined, a second layout can be created based on the common features and applied to the first page. That is, the first layout is the layout initially used by the first page, the second layout is the layout currently used by the first page, and the first layout and the second layout can be corresponded through the first page. In the first presentation file, both the first layout and the second layout can be applied to the same object, that is, the first page.
[0084] In some embodiments, when there are multiple first layouts, multiple second layouts can be determined, and the corresponding first pages can be adjusted based on each second layout to obtain a first target presentation file. Take the multiple first layouts as an example, that is, a text page layout and a directory layout. When the second layout corresponding to the text page layout and the second layout corresponding to the directory layout are obtained, the second layout corresponding to the text page layout can be applied to all the text pages in the first presentation file, and the second layout corresponding to the directory layout can be applied to all the directory pages in the first presentation file.
[0085] When there are multiple pages in a presentation file, users will customize and edit each page according to their needs, which will lead to uneven use of objects in each page, thus making the resulting presentation file non-standard. At this time, in order to make the content of each page in the presentation file more uniform, users need to edit or repeatedly adjust each related page separately, and the operation steps are cumbersome and complicated.
[0086] The present disclosure analyzes and extracts objects representing common features of various pages under the same layout in a presentation file, sets the common features on a second layout, and then applies the second layout to the presentation file. In the case of multiple pages in a presentation file, the common features of various pages of the same layout are used to create a second layout corresponding to the same layout, and the second layout is applied to the presentation file, which can make the content of various pages in the presentation file more unified on the basis of reducing the editing operations for various pages, thereby improving the editing efficiency of the presentation file.
[0087] In some other embodiments, creating a second layout corresponding to the first layout based on the common features may include:
[0088] The common features are updated to the first layout or the master referenced by the first layout to obtain the second layout.
[0089] It should be noted that the first layout can be a layout initially configured for the presentation file, or it can be a user-defined layout, which is applied to each page in the presentation file. In some embodiments, when the first layout is a blank layout, the common features can be directly updated to the blank layout to obtain the second layout. In other embodiments, when the first layout has initial content, part of the initial content can be updated to common features, or all of the initial content can be updated to common features to obtain the second layout. In other embodiments, when the first layout has initial content, it is also possible to add common features to the first layout while retaining all the initial content to obtain the second layout. Among them, the initial content may include: initial page style and / or initial object.
[0090] Exemplarily, after obtaining the common features, the common features can be directly updated to the first layout in the first demonstration file. Taking the first layout as a directory layout, the common features can be directly updated to the directory layout to obtain the second layout (updated directory layout). At this time, all directory pages using the directory layout in the first demonstration file are adjusted corresponding to the second layout, and the common features are synchronized to each directory page. Taking the first layout as a text page layout, the common features can be directly updated to the text page layout to obtain the second layout (updated text page layout). At this time, all text pages using the text page layout in the first demonstration file are adjusted corresponding to the second layout, and the common features are synchronized to each text page.
[0091] By updating the common features to the first layout, it is possible to achieve a unified change of all first pages using the first layout without editing the first pages one by one.
[0092] In some other embodiments, after the common features are obtained, the common features may be updated to the master referenced by the first layout in the first presentation file, that is, the master of the first presentation file. Figure 3 is a schematic diagram of a second format according to an exemplary embodiment Figure 1 ,like Figure 3 As shown, the common features can be updated to the master 301 referenced by the first layout in the first presentation file. The master of the presentation file is mainly used to unify the style of all pages in the presentation file, including fonts, colors, layouts, etc. If changes are made in the master of the presentation file, these changes will be automatically applied to all newly created pages based on the master.
[0093] Taking the first layout as the body page layout as an example, the first page is the body page. Since when a new body page is created, it will inherit the master by default, by updating the common features to the master, all body pages can be unified even if the body page layout is not changed.
[0094] By updating the common features to the master referenced by the first layout, the common features can be synchronized to all pages that reference the master based on the master. Since the first layout inherits the master, unified changes can be made to all first pages that use the first layout, and changes can also be made to the pages corresponding to other layouts that inherit the master, thereby saving time and effort in editing presentation files.
[0095] In some embodiments, the method further comprises:
[0096] Determining a base page from the first page;
[0097] The page style of the base page is updated to the first layout or the master; the common features are updated to the first layout or the master referenced by the first layout to obtain the second layout, including:
[0098] In response to updating the page style of the reference page to the first layout or the master, the common features are updated to the first layout or the master to obtain the second layout.
[0099] It should be noted that the features of each first page can be analyzed to determine the reference page from each first page. The page style includes: background style and / or object style; the background style can include background content and / or background style; the object style can include: object shape and / or object style.
[0100] In some embodiments, the first page including the most features (e.g., objects) may be determined as the reference page; or the first page including features greater than a preset threshold may be determined as the reference page. For example, if the first page is a text page, the first page including the most text shapes may be determined as the reference page.
[0101] In other embodiments, the first page including preset features may be determined as the reference page, wherein the preset features may be features pre-set as needed. Still taking the first page as a text page as an example, the first page including both a title and a text shape may be determined as the reference page.
[0102] After determining the reference page, the style of the reference page can be synchronized to the first layout or master. That is, the page style of the reference page is updated to the first layout or master; wherein the page style includes: background style and / or object style. Taking the first page as a text page and the reference page as a reference text page as an example, updating the page style of the reference page to the first layout or master includes at least one of the following:
[0103] Copy the background style of the base text page to the first layout or master;
[0104] The title shape of the base text page is synchronized to the title placeholder shape of the first layout or master through the format brush (if there is no title shape in the first layout or master, the title format in the first layout or master maintains the default style). The title shape can include: font size, color, underline, bold, italic, etc.
[0105] Synchronize the text shape of the base text page to the text placeholder shape of the first layout or master through the format brush (if there is no text shape in the first layout or master, the text placeholder format in the first layout or master maintains the default style).
[0106] After updating the page style to the first layout or master, the common features can be updated to the first layout or master to obtain the second layout. By determining a reference page, updating the page style of the reference page to the first layout or master, and then updating the common features to the first layout or master to obtain the second layout, the obtained second layout includes not only the common features but also the page style of the reference page, and can maintain the original style of the page on the basis of achieving object synchronization.
[0107] In some embodiments, determining a reference page from the first page includes:
[0108] In response to an opening operation on the first presentation file, traversing pages in the first presentation file;
[0109] When the pages in the first presentation file are traversed, the first page using the first layout is determined, and the first traversed first page is determined as the reference page.
[0110] It should be noted that after detecting the opening operation, the pages in the first demonstration file can be traversed, and the type of layout currently used by the pages in the first demonstration file can be determined based on the type tags of each page. After traversing the pages in the first demonstration file, the first page using the first layout is determined, and the first traversed first page is determined as the reference page.
[0111] There may be one or more pages in the first demonstration file. There may be one or more first pages using the first layout. Taking the case where there is one first page using the first layout as an example, the one first page may be directly determined as the reference page. Taking the case where there are multiple pages in the first demonstration file and there are multiple first pages as an example, each page in the first demonstration file may be traversed, and after traversing each page in the first demonstration file, each first page using the first layout may be determined, and the first traversed first page may be determined as the reference page.
[0112] Exemplarily, when an opening operation for the first demonstration file is detected, each page in the first demonstration file can be traversed, and after traversing each page in the first demonstration file, the text page using the text page layout is determined, and the first titled text page traversed by the page tag is determined as the base text page; or the first untitled text page traversed is determined as the base text page.
[0113] Since the first traversed first page can characterize the page characteristics of each first page, by determining the first traversed page as the reference page, the efficiency of file processing can be improved while improving the accuracy of the obtained second layout.
[0114] In some embodiments, the method further comprises:
[0115] In response to detecting a new creation operation for the first presentation file in the second layout, a third page is created based on the second layout; wherein the third page includes common features.
[0116] In some embodiments, the common features can be updated to the first layout to obtain the second layout, and if a new operation for the first presentation file is detected in the second layout, a third page is created based on the second layout. The new operation can be used to indicate a new page, that is, an operation for creating a new slide.
[0117] It should be noted that if the second layout is obtained by updating the first layout based on common features, an operation for creating a new slide (third page) needs to be detected based on the selection of the second layout before the third page can be created based on the second layout.
[0118] If the second layout is not selected and other layouts are selected, there is no need to synchronize common features and pages can be created based on other layouts.
[0119] For example, if the new operation is used to create a cover page, and if the common features determined based on the main text page are synchronized to the cover page, the generated presentation file will be more confusing. In the disclosed embodiment, by distinguishing the generation process of the second layout and performing different processing on the detected new operation, the final presentation file can be more in line with user needs.
[0120] In other embodiments, if the common features are updated to the master to obtain the second layout, and any new creation operation is detected in the master view, a third page is created based on the second layout. By updating the common features to the master referenced by the first layout, the common features can be synchronized to all pages that reference the master based on the master. Since the first layout inherits the master, all first pages that use the first layout can be uniformly changed, and the pages corresponding to other layouts that inherit the master can also be changed, thereby saving time and effort in editing the presentation file.
[0121] In some embodiments, creating a second layout corresponding to the first layout based on the common features includes:
[0122] Based on the initial stacking order of each object in the first page, determine the target stacking order of the common objects and each object in the first page; based on the target stacking order and the initial style of each object in the first page, lay out the common objects and each object in the first page to obtain a second layout.
[0123] Here, in the case of a first page having multiple objects with stacking settings, a target stacking order of the public object and each object in the first page may be determined based on an initial stacking order of each object in the first page; wherein the first page includes at least one custom object. The custom object may be an object updated to the first page based on a user operation.
[0124] It should be noted that the initial stacking order of each object in the first page can be the stacking order of each object in the first page when the first page uses the first layout. The target stacking order can be the stacking order between the common object and each object in the first page in the second layout.
[0125] Exemplarily, the various objects when the first page uses the first layout can be set at the bottom layer, and the common objects can be set at the upper layer to restore the style of the first layout. Figure 4 is a schematic diagram of a first format according to an exemplary embodiment, Figure 5 is a schematic diagram of a second format according to an exemplary embodiment Figure 2 ,like Figure 4 and 5 As shown, the stacking order of each object in the second layout 501 is associated with the stacking order of each object in the first layout 401. In the process of generating the second layout, the objects from the original layout (first layout) are set at the bottom layer, and the objects from the first page (common objects) are set at the upper layer, so that the shape order of the first layout can be restored.
[0126] After the common objects and the objects in the first page are laid out based on the target stacking order, the objects after the layout can be adjusted based on the initial styles of the objects in the first page to obtain the second layout. Exemplarily, after the objects are laid out according to the target stacking order, the initial styles of the objects can be synchronized to the objects after the layout according to the target stacking order by means of a format brush.
[0127] Taking the case where the first layout is a special page layout (custom page layout) and the first page is a special page (custom page) as an example, the text shape on the first page can be synchronized to the corresponding type of placeholder in the second layout through the format brush, and the text shape on the first page can be set to the placeholder; at the same time, the size and position of the placeholder are adjusted to be consistent with the size and position of the text shape on the first page; if there is no placeholder in the second layout, a new placeholder is created. Among them, in addition to the types such as title shape and body shape, the placeholder also includes extended types. Among them, the extended types include at least one of the following: company (text placeholder), speaker (text placeholder), date (text placeholder), year (text placeholder), etc.
[0128] In the disclosed embodiment, the common objects and the objects in the first page can be laid out based on the target stacking order and the initial styles of the objects in the first page to obtain a second layout. The common features in the first pages can be synchronized while maintaining the initial styles of the objects in the first page.
[0129] In some embodiments, based on the target stacking order and the initial styles of the objects in the first page, the common objects and the objects in the first page are laid out to obtain a first target presentation file, including:
[0130] When there are at least two objects of the same type in the public object and the objects in the first page, determine the target object from the at least two objects of the same type based on the attribute parameters of the at least two objects of the same type, and delete the objects except the target object from the at least two objects of the same type;
[0131] According to the target stacking order and the initial styles of the objects in the first page, the objects after the deletion process are laid out to obtain the first target presentation file.
[0132] In some embodiments, determining the target object from at least two objects of the same type based on the attribute parameters of at least two objects of the same type includes at least one of the following:
[0133] Determining a target object from at least two objects of the same type based on contents of at least two objects of the same type;
[0134] determining a target object from at least two objects of the same type based on sizes of the at least two objects of the same type;
[0135] Based on the stacking order of at least two objects of the same type, a target object is determined from the at least two objects of the same type.
[0136] For example, the object with the most text content can be determined as the target object. For another example, the object with the largest text box area can be determined as the target object. For another example, the topmost object can be determined as the target object.
[0137] Exemplarily, after determining the target stacking order of the common object and each object in the first page, it can be determined whether there are at least two objects of the same type in the common object and each object in the first page. Among them, each object in the first page can be: each object existing in the first page when the first layout is used, that is, the initial object in the first page. In some embodiments, the content indicated by objects of the same type is the same. Exemplarily, it can be determined whether the content indicated by the common object and each object in the first page is the same. If there is an object with the same indicated content, the object can be determined as an object of the same type.
[0138] For example, based on the identification of the company, multiple objects may be identified: (1) an object including the word "company" (text content); (2) an object including the specific name of the company (text content); (3) an object including a picture of the company (picture content). At this time, since the specific name of the company is to be selected, the object with text content can be selected first. If there are multiple objects with text content ((1) and (2)), the object with the most text (2) can be selected. In other embodiments, if there are no objects including text content, the object with the largest text box area can also be selected. If there are multiple objects to be screened after screening based on the above two conditions, the top-level object can be selected as the target object.
[0139] Since the target object is determined from the public object and each object in the first page, the determined target object can be one or more of the public object and each object in the first page, which are not listed here. As long as the target object can be retained and non-target objects (objects other than the target object in at least two objects of the same type) can be deleted, it will be fine.
[0140] In the disclosed embodiment, before laying out each object, the type of each object can be judged first. If at least two objects of the same type are determined, a target object can be determined from the at least two objects of the same type based on the attribute information of the objects of the same type, and objects other than the target object can be deleted from the at least two objects of the same type, thereby obtaining each object after the deletion process. Since at least two objects of the same type may appear due to misjudgment during recognition, the accuracy of the determined second layout can be improved by deleting objects other than the target object from the at least two objects of the same type.
[0141] In some embodiments, the method further comprises:
[0142] Backing up the initial styles of each first page in the first demonstration file to obtain a backup style;
[0143] Apply the second layout to the first page to obtain the first target presentation file, including:
[0144] In response to an application operation of applying the second layout to the first page, determining a backup style of the first page;
[0145] The first page using the second layout is adjusted based on the backup style to obtain a first target presentation file.
[0146] Here, before generating the second layout, the initial style in the first page can be backed up to obtain a backup style, and in response to the application operation of applying the second layout to the first page, after the second layout is applied to the first page, the first page using the second layout can be adjusted based on the backup style to obtain the first target presentation file. The application operation can be an operation automatically triggered after obtaining the second layout, or an operation input based on human-computer interaction, as long as the second layout can be applied to the first page, and no specific limitation is made here.
[0147] Exemplarily, the initial style of each object in each first page in the first presentation file can be backed up to obtain a backup style; in response to applying the second layout to the first page, the object with the backup style in the first page is determined; and the corresponding object is adjusted based on the backup style to obtain a first target presentation file.
[0148] Taking the first page as a body page as an example, the shape and font size attributes on the first page can be restored based on the backup style. For example, first back up the styles of all objects on the first page, and after applying the second layout, use the format brush to apply all the backed-up styles to the corresponding objects.
[0149] In some embodiments, the body page may include: a body page having a title and content; a page with only a title; a page without a title, such as Figures 6 to 8 As shown, Figure 6 is a body page 601 with a title and content, Figure 7 It is a text page 701 with only a title; Figure 8 It is an untitled text page 801.
[0150] Taking the first page as a special page as an example, the position and size of the objects on the first page and the stacking order of each object can be restored based on the backup style.
[0151] In the disclosed embodiment, before generating the second layout, the initial style of each feature in the first page can be backed up to obtain a backup style. After the second layout is applied to the first page, the corresponding features are adjusted based on the backup style to obtain a first target presentation file. This can achieve synchronization of common features in each first page while maintaining the original style of the first page.
[0152] It should be noted that after obtaining the first target presentation file, the second layout can also be associated with the first target presentation file, so that the second layout can be used when operating each page in the first target presentation file. Among them, operating each page of the first target presentation file may include at least one of the following: creating a new page in the first target presentation file; editing a page in the first target presentation file; copying a page in the first target presentation file to other presentation files; copying a page in other presentation files to the first target presentation file.
[0153] In some embodiments, the method further comprises:
[0154] In response to a setting operation of copying a first target page in a first target presentation file to a second presentation file, a second target page is determined from the second presentation file based on a type of a second layout used by the first target page; wherein the type of layout used by the second target page is the same as the type of the second layout used by the first target page;
[0155] The second layout used by the first target page is applied to the second target page to obtain a second target presentation file.
[0156] It should be noted that after the second layout is applied to the first presentation file, the common features (objects or attributes) representing the first presentation file can be adjusted to the master or the first layout. Therefore, when creating one or more pages (slide pages) based on the first target presentation file, these common features can be automatically included by selecting the corresponding second layout, avoiding the problem of tedious editing by users after creating the new file.
[0157] In other embodiments, after obtaining the first target presentation file, in response to the setting operation of copying the first target page in the first target presentation file to the second presentation file, the second target page can be determined from the second presentation file based on the type of the second layout used by the first target page; the second layout used by the first target page is applied to the second target page to obtain the second target presentation file. The type of layout used by the second target page is the same as the type of the second layout used by the first target page. The setting operation can be an operation automatically triggered after obtaining the first target presentation file, or an operation input based on human-computer interaction, as long as it can achieve the copying of the first target page in the first target presentation file to the second presentation file, and is not specifically limited here.
[0158] Exemplarily, by copying the first target page created by the master or second layout used in the first target presentation file to the second presentation file, the second target page in the second presentation file can also be set to the layout used by the newly copied first target page, which can conveniently and efficiently achieve the style exchange between the two documents, thereby improving the efficiency of document editing or beautification.
[0159] Fig. 9 FIG. 1 is a block diagram of a file processing device according to an exemplary embodiment. Fig. 9 As shown, the device 900 mainly includes:
[0160] The determining module 901 is configured to determine the common features of the first page using the first layout in the first presentation file in response to an opening operation on the first presentation file; the first creating module 902 is configured to create a second layout corresponding to the first layout based on the common features; wherein the second layout at least includes the common features;
[0161] The first application module 903 is configured to apply the second layout to the first page to obtain a first target presentation file.
[0162] In some embodiments, the first application module 903 is specifically configured as follows:
[0163] Determining, from each of the first pages, a page to be processed that has the common feature;
[0164] Deleting the common feature from the page to be processed to obtain a second page;
[0165] The second layout is applied to the second page and the first page that has not been deleted to obtain the first target presentation file.
[0166] In some embodiments, the first creation module further includes:
[0167] The first updating module is configured to update the common features to the first layout or a master referenced by the first layout to obtain the second layout.
[0168] In some embodiments, the file processing device 900 further includes:
[0169] A page determination module, configured to determine a reference page from the first page;
[0170] A second updating module is configured to update the page style of the reference page to the first layout or the master layout;
[0171] The first update module is specifically configured as follows:
[0172] In response to updating the page style of the reference page to the first layout or the master, the common features are updated to the first layout or the master to obtain the second layout.
[0173] In some embodiments, the page determination module is specifically configured to:
[0174] In response to an opening operation on the first presentation file, traversing pages in the first presentation file;
[0175] When all pages in the first presentation file are traversed, the first page using the first layout is determined, and the first traversed first page is determined as the reference page.
[0176] In some embodiments, the determining module 901 is specifically configured to:
[0177] Based on the feature information of the objects in each of the first pages in the first demonstration file, a common object is determined from the objects included in the first page, and the common object is determined as the common feature.
[0178] In some embodiments, the first creation module 902 further includes:
[0179] The order determination module is configured to determine the target stacking order of the common objects and the objects in the first page based on the initial stacking order of the objects in the first page; the layout module is configured to layout the common objects and the objects in the first page based on the target stacking order and the initial styles of the objects in the first page to obtain the second layout.
[0180] In some embodiments, the layout module is specifically configured to:
[0181] When there are at least two objects of the same type in the common object and the objects in the first page, determine a target object from the at least two objects of the same type based on attribute parameters of the at least two objects of the same type, and delete objects other than the target object from the at least two objects of the same type;
[0182] According to the target stacking order and the initial styles of the objects in the first page, the objects after the deletion process are laid out to obtain the second layout.
[0183] In some embodiments, the file processing device 900 further includes:
[0184] A backup module, configured to back up the initial style of each of the first pages in the first demonstration file to obtain a backup style;
[0185] The first application module 903 is specifically configured as follows:
[0186] In response to an application operation of applying the second layout to the first page, determining the backup style of the first page;
[0187] The first page using the second layout is adjusted based on the backup style to obtain the first target presentation file.
[0188] In some embodiments, the file processing device 900 further includes:
[0189] a creation module, configured to, in response to detecting a new creation operation for the first presentation file in the second layout, create a third page based on the second layout;
[0190] Wherein, the third page includes the common features.
[0191] In some embodiments, the file processing device 900 further includes:
[0192] an execution module, configured to, in response to a setting operation of copying a first target page in the first target presentation file to a second presentation file, determine a second target page from the second presentation file based on a type of a second layout used by the first target page; wherein the type of layout used by the second target page is the same as the type of the second layout used by the first target page;
[0193] The second application module is configured to apply the second layout used by the first target page to the second target page to obtain a second target presentation file.
[0194] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0195] Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, which may be a computer or a terminal in one or more of the above embodiments. Fig.10 FIG. 1 is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment. Fig.10 As shown, the electronic device 1000 adopts general computer hardware and includes a processor 1001 , a memory 1002 , a bus 1003 , an input device 1004 , and an output device 1005 .
[0196] In some possible implementations, the memory 1002 may include computer storage media in the form of volatile and / or non-volatile memory, such as read-only memory and / or random access memory. The memory 1002 may store an operating system, application programs, other program modules, executable code, program data, user data, etc.
[0197] Input device 1004 can be used to input commands and information to the electronic device, such as a keyboard or a pointing device, such as a mouse, trackball, touchpad, microphone, joystick, game pad, satellite TV antenna, scanner or similar device. Input device 1004 can be connected to processor 1001 via bus 1003.
[0198] The output device 1005 can be used for the electronic device 1000 to output information. In addition to the monitor, the output device 1005 can also be other peripheral output devices, such as a speaker and / or a printing device. The output device 1005 can also be connected to the processor 1001 through the bus 1003.
[0199] The electronic device 1000 may be connected to a network, such as a local area network (LAN), via the antenna 1006. In a networked environment, executable instructions may be stored in a remote storage device, rather than being limited to local storage.
[0200] When the processor 1001 in the electronic device 1000 executes the executable code or application stored in the memory 1002, the electronic device 1000 can implement the file processing method in the above embodiment. The specific execution process refers to the above embodiment and will not be repeated here.
[0201] The memory 1002 may store information for implementing Fig. 9 The executable instructions of the functions of the determination module 901, the first creation module 902 and the first application module 903. Fig. 9 The functions / implementation processes of the determination module 901, the first creation module 902 and the first application module 903 can be realized by Fig.10 The processor 1001 in the embodiment calls the executable instructions stored in the memory 1002 to implement the above-mentioned implementation process and functions.
[0202] Based on the same inventive concept, the embodiment of the present disclosure further provides a storage medium, in which instructions are stored, and when the instructions are executed on a computer, the file processing method in one or more of the above embodiments is executed.
[0203] Based on the same inventive concept, the embodiments of the present disclosure further provide a computer program or a computer program product. When the computer program product is executed on a computer, the computer implements the file processing method in one or more of the above embodiments.
[0204] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0205] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A file processing method, characterized in that: include: In response to an opening operation on a first presentation file, determining common features of a first page using a first layout in the first presentation file; Creating a second layout corresponding to the first layout based on the common features; wherein the second layout at least includes the common features; Apply the second layout to the first page to obtain a first target presentation file.
2. The method according to claim 1, characterized in that The step of applying the second layout to the first page to obtain a first target presentation file includes: Determining, from the first pages, pages to be processed that have the common feature; Deleting the common feature from the page to be processed to obtain a second page; The second layout is applied to the second page and the first page that has not been deleted to obtain the first target presentation file.
3. The method according to claim 1, characterized in that The step of creating a second layout corresponding to the first layout based on the common features includes: The common features are updated to the first layout or a master referenced by the first layout to obtain the second layout.
4. The method according to claim 3, characterized in that The method further comprises: determining a reference page from the first page; Updating the page style of the reference page to the first layout or the master; updating the common features to the first layout or the master referenced by the first layout to obtain the second layout, includes: In response to updating the page style of the reference page to the first layout or the master, the common features are updated to the first layout or the master to obtain the second layout.
5. The method according to claim 4, characterized in that The determining a reference page from the first page includes: In response to an opening operation on the first presentation file, traversing pages in the first presentation file; When all pages in the first presentation file are traversed, the first page using the first layout is determined, and the first traversed first page is determined as the reference page.
6. The method according to claim 1, characterized in that The determining of the common features of the first page using the first layout in the first presentation file includes: Based on the feature information of the objects in the first page in the first presentation file, a common object is determined from the objects included in the first page, and the common object is determined as the common feature.
7. The method according to claim 6, characterized in that The step of creating a second layout corresponding to the first layout based on the common features includes: Based on the initial stacking order of each object in the first page, determine the target stacking order of the common object and each object in the first page; based on the target stacking order and the initial style of each object in the first page, lay out the common object and each object in the first page to obtain the second layout.
8. The method according to claim 7, characterized in that The step of laying out the common objects and the objects in the first page based on the target stacking order and the initial styles of the objects in the first page to obtain the second layout includes: When there are at least two objects of the same type in the common object and the objects in the first page, determine a target object from the at least two objects of the same type based on attribute parameters of the at least two objects of the same type, and delete objects other than the target object from the at least two objects of the same type; According to the target stacking order and the initial styles of the objects in the first page, the objects after the deletion process are laid out to obtain the second layout.
9. The method according to claim 1, characterized in that: The method further comprises: Backing up the initial style of each of the first pages in the first demonstration file to obtain a backup style; The step of applying the second layout to the first page to obtain a first target presentation file includes: In response to an application operation of applying the second layout to the first page, determining the backup style of the first page; The first page using the second layout is adjusted based on the backup style to obtain the first target presentation file.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: In response to detecting a new creation operation for the first presentation file in the second layout, creating a third page based on the second layout; Wherein, the third page includes the common features.
11. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: In response to a setting operation of copying a first target page in the first target presentation file to a second presentation file, determining a second target page from the second presentation file based on a type of a second layout used by the first target page; wherein the type of layout used by the second target page is the same as the type of the second layout used by the first target page; The second layout used by the first target page is applied to the second target page to obtain a second target presentation file.
12. A file processing device, characterized in that: include: A determination module, configured to determine, in response to an opening operation on a first presentation file, a common feature of a first page using a first layout in the first presentation file; A first creation module is configured to create a second layout corresponding to the first layout based on the common features; wherein the second layout at least includes the common features; The first application module is configured to apply the second layout to the first page to obtain a first target presentation file.
13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
