CN118228699A - File editing method and device, electronic equipment and storage medium - Google Patents

File editing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN118228699A
CN118228699A CN202410336537.9A CN202410336537A CN118228699A CN 118228699 A CN118228699 A CN 118228699A CN 202410336537 A CN202410336537 A CN 202410336537A CN 118228699 A CN118228699 A CN 118228699A
Authority
CN
China
Prior art keywords
layout
content
target
file
target file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410336537.9A
Other languages
Chinese (zh)
Inventor
晁云曈
曹宗华
陈杰鑫
雷淑玲
余爱华
刘康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Wuhan Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202410336537.9A priority Critical patent/CN118228699A/en
Publication of CN118228699A publication Critical patent/CN118228699A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the disclosure provides a file editing method and device, electronic equipment and a storage medium. The file editing method can comprise the following steps: detecting a first operation for a target file; the first operation is used for writing first content into the target file; determining a target layout of the first content written into the target file; and writing the first content into the target file in the target layout.

Description

File editing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to, but not limited to, the field of file and image technologies, and in particular, to a method and apparatus for editing a file, an electronic device, and a storage medium.
Background
During file editing, copy-and-paste of content or content insertion, etc., may be involved. In some cases, but in general, after content is pasted or inserted into a file, a user needs to manually adjust the layout, format, etc. of the pasted or inserted content.
Disclosure of Invention
The embodiment of the disclosure provides a file editing method and device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a file editing method, including: detecting a first operation for a target file; the first operation is used for writing first content into the target file; determining a target layout of the first content written into the target file; and writing the first content into the target file in the target layout.
A second aspect provides a file editing apparatus, the apparatus comprising: a detection module configured to detect a first operation for a target file; the first operation is used for writing first content into the target file; a determining module configured to determine a target layout of the first content written to the target file; a writing module configured to write the first content to the target file in the target layout.
A third aspect of an embodiment of the present disclosure provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: the file editing method provided by any technical scheme in the first aspect is realized when executable instructions are run.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, where an executable program is stored, where the executable program when executed by a processor implements the file editing method provided by any of the technical aspects of the first aspect.
A fifth aspect of the disclosed embodiments provides a computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the file editing method provided in any of the technical aspects of the first aspect.
According to the technical scheme provided by the embodiment of the disclosure, in the process of editing the file, if the first operation is detected and before the related first content is inserted, the electronic device can automatically determine the target layout, and write the first content into the target file according to the target layout, so that the file effect after the first content is written is better, the operation of manually adjusting the first content and/or the target file by a user is reduced, and the intelligence of editing the file by the electronic device is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow chart illustrating a method of editing a file according to an exemplary embodiment.
Fig. 2A is a schematic diagram illustrating an area distribution according to an example embodiment.
Fig. 2B is a schematic diagram illustrating an area distribution according to an example embodiment.
Fig. 2C is a schematic diagram illustrating a region distribution according to an example embodiment.
Fig. 3 is a flow chart illustrating a method of editing a file according to an exemplary embodiment.
Fig. 4A is a schematic diagram illustrating an area distribution according to an example embodiment.
Fig. 4B is a schematic diagram illustrating an area distribution according to an example embodiment.
Fig. 5 is a schematic structural view of an image processing apparatus according to an exemplary embodiment.
Fig. 6 is a schematic diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of embodiments of the present disclosure as detailed in the accompanying claims.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
As shown in fig. 1, the embodiment of the present disclosure provides a file editing method that can be performed by any electronic device. The method may include:
S1110, detecting a first operation for a target file; the first operation is used for writing first content into the target file;
S1120: determining a target layout of the first content written into the target file;
s1130: and writing the first content into the target file in the target layout.
The electronic device may comprise a terminal device or a server. The terminal device may be a mobile terminal installed with a file editing client, for example. The server may be a service device that remotely edits the file or locally edits the file.
In some embodiments, the target file may be a file of various forms, including, for example, but not limited to, a text file, a rich media file, and/or a layout file, among others. Illustratively, the layout file may include, but is not limited to, a presentation file mobile file format (Portable Document Format, PDF), a drawing board, and the like.
In some embodiments, the first operation may be any operation of writing information such as a plurality of characters, a plurality of words, or graphics, etc. into the target file. Illustratively, the first operation is to paste or insert first content into the target file.
The first operation may be any operation of copying, moving, or inserting the target file from outside the target file. Illustratively, the first operation may include, but is not limited to, a paste operation, a move operation, or an insert operation.
In some embodiments, the first content may have been written to the content of the target file. For example, pictures, text, tables, relationship diagrams, embedded connection objects (objects LINKING AND Embedding, OLE), web page tags (including but not limited to hypertext markup language (Hyper Text Markup Language, html) tags), and/or inserted various shapes that have been written into the target file.
Illustratively, the presentation file may include, but is not limited to, various presentations (e.g., microsoft Office PowerPoint, commonly known as PPT).
In an editing state of the presentation file, a first operation for the presentation file is detected, based on determining a target layout for writing the first content into the presentation file, and the first content is automatically written into the target file based on the determined target layout.
In some embodiments, the layout may be such that different portions of the content are arranged in a predetermined manner. For example, the target layout may include, but is not limited to, at least one of:
a context map, i.e. if the first content comprises text and pictures, the text is arranged above the pictures;
The following figures, namely, if the first content comprises characters and pictures, the characters are arranged below the pictures;
a left-right diagram, namely, if the first content comprises characters and pictures, the characters are arranged on the left side of the pictures;
right-hand left-hand picture, i.e. if the first content comprises words and pictures, the words are arranged on the right side of the pictures;
a single line, i.e. all parts of the first content are written in a single line;
a single column, i.e. all parts of the first content are written in a column;
multiple rows, for example, the first content may be automatically line-fed into multiple rows according to the writing area;
multiple columns, for example, the first content may be automatically permuted into multiple columns according to the writing area;
A table, i.e. the first content is written in a table;
Automatically generating a subtitle and a text, namely automatically generating the subtitle when the first content is written, and writing the automatically generated subtitle and the text of the first content into a target file together;
and automatically extracting the abstract and the text, namely automatically extracting the abstract and the text of the first content when the first content is written, and writing the abstract and the text into the target file together.
Of course, the above is merely an illustration of a layout or a target layout, and the specific implementation is not limited to the above illustration.
Of course, the above is merely an illustration of a layout or a target layout, and the specific implementation is not limited to the above illustration.
Fig. 4A and 4B are schematic layout diagrams of a presentation file.
After the target layout is determined, the first content is pasted or inserted into the target file according to the target layout. Illustratively, the first content is written to a blank area of the target file in the target layout, e.g., the first content is written to a blank area of the current page where the first operation is detected, etc. Illustratively, the blank area is an area where no content is currently written. Also illustratively, the blank area is an area that does not overlap with the first content after the second content is written.
In the process of editing the file, if the first operation is detected and before the related first content is inserted, the electronic device automatically determines the target layout, and writes the first content into the target file according to the target layout, so that the file effect after the first content is written is better, the operation of manually adjusting the first content and/or the target file by a user is reduced, and the intelligence of editing the file by the electronic device is improved.
In some embodiments, the determining the target layout of the first content write to the target file includes:
Determining an alternative layout according to at least one of a related layout of the first content, a related layout of the target file, a layout of the page acted by the first operation, a layout of the page written by the first content, a similar page of the page written by the first content, a preset layout and a layout designated by a user;
a target layout is determined from the alternative layouts.
After the candidate layouts are determined, the candidate layout with the highest priority may be selected as the target layout according to the priorities of the respective candidate layouts.
After the alternative layouts are determined, a layout with a high frequency of use may be preferably selected as the target layout according to the frequency of use of each alternative layout. In other embodiments, the target layout may be determined directly from any of the related layouts described above, without first determining an alternative layout.
In some embodiments, the determining the target layout of the first content written to the target file includes at least one of:
determining the target layout according to the related layout of the first content and/or the related layout of the target file;
determining the target layout according to the layout of the page acted by the first operation;
determining the target layout according to the layout of the page specified by the user;
determining a preset layout as the target layout; the preset layout includes: and the default layout or the layout with highest use frequency of the target file.
In some embodiments, the original layout of the first content when copied or pasted into the target file, the layout of the file in which the first content is located, and the layout suitable for the first content may all be considered as related layouts of the first content.
In some embodiments, the target file related layout may include: the current layout of the target file, the layout of the current edited page of the target file, the layout of the template used by the target file, the default layout of the target file, the layout of the related files of the target file, and the like can be regarded as the related layout of the target file.
In some embodiments, the target layout is determined according to the related layout of the first content and/or the related layout of the target file, so that the target layout is necessarily related to at least one of the related layout of the first content and the related layout of the target file, and the first content is written into the target file according to the target layout, so that the target layout is beneficial to displaying the first content and has strong consistency in layout coordination with other contents of the target file.
In some embodiments, the object file application software may be provided with template content of different types of content, which is provided with an available layout, such that the similar content of the first content may be any one or more of the template content.
In some embodiments, similar content of the first content may also include, but is not limited to, at least one of:
Content in the target file that is similar to the content meaning and/or content intent of the first content;
content similar to the content meaning and/or content intention of the first content in other files opened by the current opening target application;
Content in the same type of file as the target file on the network has a meaning and/or intent similar to that of the first content.
Illustratively, the meaning of the content depends on the content itself. The content is intended to be related to the purpose of expression of the content.
In some embodiments, the second content may be any content written to the target file prior to the first content. In some embodiments, the second content may include at least one of:
the last written content of the target file before the first content is written;
writing the first content into the content of the adjacent area of the position in the target file;
And writing the content of the target file at any position or any time which is the same as or similar to the first content in the target file.
Of course, the foregoing is merely illustrative of the second content, and the specific implementation is not limited to the foregoing examples.
In some embodiments, the page acted upon by the first operation may include, but is not limited to, at least one of:
detecting a page displayed by the target file during a first operation;
pages for the first content to write.
In some embodiments, the user may specify a page, at which point the target layout may be determined based on the layout of the page specified by the user.
In some embodiments, the object file has a specified layout at the time of editing, which may be considered a preset layout. For another example, the default layout of the target file may be a preset layout. Of course, only a descriptive illustration of the target layout is provided herein.
In some embodiments, if it is detected that the user has a specified page, the layout of the specified page is prioritized as the target layout, and the layout of the page acted by the first operation is ignored, and/or the relevant layout according to the first content and the target file.
For another example, in the event that no user-specified layout is detected, the determination of the target layout based on the first content and the associated layout of the target file may be used preferentially,
In some embodiments, the determining the target layout of the first content written to the target file according to the related layout of the first content and/or the related layout of the target file includes at least one of:
determining a current layout of the first content as the target layout;
determining a current layout of similar content of the first content as the target layout;
Determining the target layout according to the layout of the second content of the target file; the second content is written before the first content is written into the target file;
determining the target layout according to the layout of the template association used by the target file;
Determining the target layout according to the layout used by the similar files of the target file;
determining the target layout according to the layout of the page where the target area is located;
determining the target layout according to the layout of the adjacent pages of the page where the target area is located;
determining the target layout according to the layout used by the similar page of the page where the target area is located;
Determining the target layout according to the default layout of the target file;
determining the target layout according to user input;
The target layout is determined according to at least one of the meaning of the first content and the content intent.
In some embodiments, the above-described solution is of course merely an illustration of determining a target layout, and the specific implementation is not limited to the above-described illustration.
In some embodiments, the determining the target layout of the first content written to the target file according to the related layout of the first content and/or the related layout of the target file includes:
Determining a reference layout according to the related layout of the first content and/or the related layout of the target content;
The target layout is selected from the reference layouts.
In some embodiments, the electronic device may obtain the reference layout according to various alternatives for obtaining the target layout, and then determine the target layout based on the successfully obtained reference layout. After one or more reference layouts are acquired, a target layout may also be selected from the successfully acquired reference layouts according to the manner in which the target layout is selected.
In some embodiments, not only is the layout associated with the first content and/or the target file selected, but the target layout most appropriate for the current editing situation of the target file may be selected according to a further selection policy.
In some embodiments, the selecting the target layout from the reference layouts includes at least one of:
determining the target layout according to the priority of the successfully acquired reference layout;
The target layout is selected from the reference layouts according to the matching degree of each reference layout and the expression intention of the first content.
In some embodiments, determining the target layout of the second content write target file includes at least one of:
mode 1: determining a current layout of the second content as a target layout;
Mode 2: determining a target layout according to the layout of the first content;
mode 3: determining a target layout according to a template used by the target file;
mode 4: determining a target layout according to the layout used by the similar files of the target file;
mode 5: determining a target layout according to the layout of the page where the target area is located;
mode 6: determining a target layout according to the layout of the adjacent pages of the page where the target area is located;
mode 7: determining a target layout according to the default layout of the target file;
mode 8: determining a target layout according to user input;
Mode 9: determining a target layout according to at least one of the meaning, attribute and content intention of the second content;
Mode 10: and determining the target layout according to the layout used by the similar page of the page where the target area is located.
In some embodiments, the target layout may be determined according to any of the above-described ways, e.g., any of the ways may be randomly selected to determine the target way.
Illustratively, the current layout of the second content is a layout between the second content write target files. For example, the layout of the content such as pictures and/or text written to the presentation file prior to writing.
Also illustratively, the first content is the content of the current written target file, the current first content having an existing layout.
Illustratively, taking the example that the target file is a presentation file, templates used by the presentation file may include, but are not limited to, various presentation templates provided by an application program, and/or presentation templates generated based on user customization, and/or templates downloaded from a network.
In the target file, the similar page of the page where the target area is located may be a page where similar content is written, which is determined according to the file outline, and may be determined as a similar page. Or in other files except the target file, writing the page with similar content into the page where the target area is located as the similar page. Illustratively, any two directory pages may be considered similar pages. For another example, any two pages of content may be considered similar pages. Of course the above is merely illustrative of similar pages.
In some embodiments, the priority is set for the above manner, the target layout is determined preferentially according to the high priority manner, and when the target layout cannot be determined according to the high priority manner, the target layout can be determined by adopting the next-gear priority manner. For example, the priority of mode 3 is higher than the priority of mode 2, and the priority of mode 2 is higher than the priority of mode 4. Thus, when the current target file does not use the template, the target layout cannot be determined according to mode 3, and then mode 2 can be used to determine the target layout. If the current target file has no content or the first content has been deleted, the target layout cannot be determined according to sentence pattern 2, and then the target layout can be determined according to pattern 4. And repeating the steps until the proper target layout is determined.
In some embodiments, the user-directly specified layout may be selected as the target layout based on user input.
In some embodiments, the target layout is determined based on one or both of the meaning of the second content and the intent of the content. For example, two sentences describing different objects are contained for the text, and at this time, a layout for line division or segment drop display may be automatically performed as a target layout according to the text content.
For example, the meaning of the first content and the second content may be extracted through various deep learning models or machine models.
Also by way of example, summaries of text and/or pictures may be extracted separately by various algorithms, and meaning similarities between different content determined based on keyword matching of the summaries, etc.
In some embodiments, as shown in fig. 3, the method further comprises:
S1140, in the case where the second content is written into the target file, it is detected that the trigger condition is satisfied, and predetermined adjustment is performed.
Illustratively, in some embodiments, the predetermined adjustment includes at least one of:
Adjusting the overall layout of the target file;
adjusting a layout of the first content and at least a portion of the second content;
The layout of part or all of the second content is adjusted.
After the intelligent writing of the first content is completed, in order to improve the editing effect of the target file, overall adjustment is automatically performed. Typically, the adjustment of the overall layout may include: and after the first content is written into the target file, fine tuning the overall layout of all the contents in the target file. The adjustment of the overall layout may enable the overall layout of the target file to have coordination and uniformity, and such adjustment of the overall layout may be used as the layout of the subsequent written content when the subsequent content is written, which is, of course, merely illustrative, and the layout of the subsequent content writing may be the same as or different from the adjusted overall layout.
In some embodiments, according to the outline or title of the target file, it is determined that the first content is the core content of the target file, for example, based on the user indication or the intelligent identification of the AI model, after the first content is written into the target file with the determined target layout, the layout of the second content is adjusted by combining the layout of the first content, so that the overall layout of the target file or at least the layout with the relevant portion has a better visual effect.
In some embodiments, the adjustment of the overall layout may include: and after the first content is written into the target file, under the condition that the position sequence among all the contents in the target file is kept unchanged, the relative position relation among the contents is finely adjusted.
Illustratively, the adjustment operation may include an overall adjustment of the layout of the target file, an adjustment of the local layout, an adaptation of the layout between different portions, and so on. Of course, this is merely an example of an adjustment operation, and the specific implementation is not limited to this example.
In some embodiments, after the writing of the first content is completed, or after the first content is written according to the target layout, the layout of the first content and at least a portion of the second content may be cooperatively adjusted again, where, for example, at least a portion of the second content may be a portion of the second content adjacent to the first content, or a portion or all of the second content having a content association with the first content.
In this way the layout of the first content and at least part of the second content is made identical or similar, so that consecutively distributed or content-associated parts of the object file have similarity.
In the embodiment of the disclosure, an adjustment operation is also introduced, and the adjustment operation can be an adjustment operation for the whole target file, so that the layout effect of the target file is better.
Of course, the foregoing is merely illustrative of overall layout adjustment, and the specific implementation is not limited to the foregoing examples.
In some embodiments, adjusting the trigger condition includes at least one of:
the first content is written into the target file;
editing the target file;
The time length which is adjusted last time from the target file is longer than or equal to the first time length;
the number of the written content of the target file reaches a first number after the last adjustment;
the number of pages of the target file adjusted after the last adjustment reaches a second number;
and detecting an adjustment operation input by the editing interface.
If the electronic device writes the second content into the target file based on the first operation, that is, after the target file completes the processing of the first operation, the electronic device may perform overall or local adjustment of the related content based on the setting or the user instruction.
The electronic equipment automatically adjusts when detecting any condition meeting the adjustment triggering condition, so that the editing intellectualization of the target file is realized.
Of course, in some embodiments, it may also be determined whether the adjustment triggering condition is satisfied according to whether the number of editing instructions received after the last adjustment of the target file reaches the specified number. Therefore, by adjusting whether the triggering condition is met or not, necessary adjustment is realized, unnecessary adjustment is reduced, and editing of the target file is simplified.
In some embodiments, the first duration, the first number, and the second number may all be preset values, or suitable values dynamically determined according to the editing status of the current target file.
In other embodiments, the first duration, the first number, and/or the second number may all be determined based on editing habits of the current account.
Illustratively, the first duration may be 1 minute, 2 minutes, 5 minutes, 10 minutes, or the like.
Also for example, the first number and/or the second number may both be empirical or statistical.
Detecting that the adjustment triggering condition is met under the condition that the first content is written into the target file, and adjusting the overall layout of the target file, wherein the adjustment triggering condition comprises at least one of the following components:
After the processing of the first operation, the whole or partial adjustment of the relevant content may be made based on the setting or the user instruction.
In the embodiment of the disclosure, through the adjustment of the overall layout, the layout of any two different pages meets a certain similarity condition, so that the layouts of the different pages have similarity in layout.
In some embodiments, the layout of different pages of the target file may be different, but in order to make the overall layout of the target file consistent, the layout variation of adjacent pages may be made to satisfy the fade condition by fine-tuning the overall layout. The fade condition may define an allowable variation term or a supported variation amount.
In some embodiments, the relative position relationship between different contents in the target file can be adjusted according to the association relationship between different content blocks in the target file.
In some embodiments, the relative positional relationship between different portions in the same content block may be adjusted, so that the layout between different portions of a single content is optimized, and the overall performance of the target file is improved.
The content blocks may be intelligently divided into file content by an artificial intelligence model running on the electronic device, for example, the content in the target file may be divided into individual content blocks according to the time the content is written to the target file, the relevance between the content, and the distribution of the content in the target file. For example, a predetermined number of lines or columns of text is set as one content block. A word segment is considered a content block. For another example, a picture or a picture and the text description of the picture are considered a piece of content.
In some embodiments, the method further comprises:
A format of the first content written to the target area is determined.
Illustratively, the format may be associated with a style of font, font size, etc. of the text. For example, the format may relate to a picture resolution and/or style of the picture.
In some embodiments, determining a format of the first content writing target area includes at least one of:
determining the format of the first content written in the target area according to the format of the second content;
determining the format of the first content written in the target area according to the format before the first content is written in the target area;
And determining the format of the first content written in the target area according to a second operation on the format control.
Therefore, before the first content is written, the format after the first content is written is determined based on the user operation or the self-adaptive operation of the electronic equipment, so that the intelligence of file editing is greatly improved. For example, if the electronic device adaptive operation determines the format after the first content is written, based on the first operation, the writing of the first content into a proper position is realized, and the writing of the target file in a proper layout and/or format is realized, which is equivalent to the realization of multiple operations of the file by one user operation.
In some embodiments, the method further comprises:
after the target area is determined, the format control is hovered over the target area.
The format control displayed in the target area can indicate the current security area automatically selected by the electronic equipment to the user on one hand, and the floating display format control is convenient for the user to select the format on the other hand. Illustratively, the format control is automatically hidden after no user operation is detected on the format control and the display duration reaches a preset duration. Also illustratively, the format control automatically hides after determining the format of the first content written to the target file based on the format control.
For example, when pasting content within a presentation file, it is often stacked in a specific location such as the upper right corner or center, requiring readjustment after each pasting. The embodiment of the disclosure provides a method for calculating the layout of file contents, reasonably typesetting pasted contents into a file space, and realizing consistency of typesetting of the pasted contents and files, thereby improving efficiency of pasting the contents for a plurality of times.
The embodiment of the disclosure aims to solve the problem of unordered typesetting after pasting object contents. The reasonable layout of the content objects in the free space is realized through the algorithm, and the manual typesetting layout is reduced so as to improve the pasting efficiency. The embodiment of the disclosure combines the file information and the content object information, and realizes reasonable typesetting layout of the content by using an algorithm in the pasting process. And the automatic typesetting layout of the content is realized based on the file information, so that the pasting efficiency is improved.
In some embodiments, upon detecting the first operation, a target area for the first content write is also determined. The target area may preferably be a blank area where the content is not written once.
In some embodiments, the determining the target area is performed when the target file meets a first condition upon detection of the first operation.
Illustratively, the first condition may include, but is not limited to, at least one of:
Detecting that the target file has no focus temporarily;
detecting that the cursor is positioned outside the editable range of the target file;
detecting that the focus is out of the editable range of the target file;
detecting that the area where the focus is located is a distribution area of the first content;
the area where the light is detected is the area where the first content is located.
The focus may be a current active area on the target file that is used to receive input from the input device. The input device may include, but is not limited to, a mouse, keyboard, stylus, touch panel, etc. Illustratively, clicking on an edit box at a previous time, the focus is located within the edit box. The edit box is now active. The edit box may receive content entered by the revenue device in the active state. At which point the keyboard copy-and-paste or inserted content will be written into the edit box, etc. In some cases, the focus may move with a cursor or user manipulation that acts on a particular location.
The editable field may be understood as an area within the file where information is available for the user to write. For example, each page of the presentation file in which information such as text, pictures, etc. can be written, such as a slide page in which editing is available, can be used as a remark column for editing.
In the embodiment of the disclosure, if the target file has no focus, it is indicated that the target file has no active area currently. In some embodiments, the target file has no focus, and in order to avoid repeated stacking of the inserted or pasted second content in a specific area, in embodiments of the present disclosure, a distribution area of the first content already in the target file is used.
Illustratively, the blank area is an area where no content is currently written. Also illustratively, the blank area is an area that does not overlap with the first content after the second content is written.
In some embodiments, in response to the target file having a focus, determining that the active area in which the focus is located is the target area for writing the second content, or in response to the focus of the target file being located within an editable area of the target file, determining that the active area in which the focus is located is the target area for writing the second content.
If the first content is written into the target area, the following provides a determination method of the target area. Illustratively, selecting the target region from the blank region includes at least one of:
Selecting a blank area located in a specified range as a target area;
The target area is selected from the blank area according to at least one of a first attribute of the first content and a second attribute of the second content.
After the blank area is determined, the blank area within the specified position range (specified range) is selected as the target area. For example, the specified position range may be an area range determined based on a user input operation. For another example, the specified range may be an area range determined according to the editing state of the target file.
Illustratively, the specified range determined according to the editing state of the target file may include, but is not limited to, at least one of:
determining the area range of the last editing operation of the target file as a designated range;
the range having the largest number of edits in the specified period before the first operation is determined as the specified range;
the range in which the content is most written in the specified period before the first operation is determined as the specified range;
the end specific range of the first content of the target file is determined as the specified range.
In some embodiments, if there are one or more blank areas within the specified range, then the one or more blank areas are preferentially selected from the specified range as the target area. If there is no blank area in the specified range, a target area is selected from the blank areas outside the specified range.
After determining the target area, the electronic device determines a schematic diagram of the blank area and the non-blank area according to different display parameters, and then the user clicks an icon of the blank area in the corresponding schematic diagram, so that the selection of the target area based on the user operation can be completed. In which case non-blank areas may not be selected.
Also illustratively, the electronic device automatically background selects a blank area as the target area. At this time, the foreground of the electronic device may or may not display the schematic. For example, the electronic device determines that the electronic device automatically selects a blank area as the target area based on the configuration of the editing application, in which case the schematic diagram may not need to be selected. For another example, the electronic device foreground displays a schematic diagram, and if no user operation input is detected within a specified time, the electronic device is shifted to automatically select a blank area as a target area.
In some embodiments, selecting a blank region located in a specified range as the target region includes at least one of:
Selecting a blank area of a current display page in a target file as a target area;
Selecting a blank area of a last page in the target file as a target area;
a blank area located adjacent to the last editing position of the target file before the first operation is performed is selected as the target area.
In this way, the continuity of editing operation is mainly considered, so that the first content is automatically inserted into the area more consistent with the user's will, and the intelligence and user satisfaction of writing the first content into the target area are improved.
In some embodiments, according to a first attribute of the first content and a second attribute of the second content, one or more blank areas are selected from the blank areas as target areas based on similarity and/or difference of the attributes in combination with a distribution area of the first content.
Both the first attribute and the second attribute may be collectively referred to as content attributes. In some embodiments, the content attributes may include, but are not limited to, at least one of:
The area occupied by the content;
Meaning of the content.
In some embodiments, a blank area meeting the matching requirement with the first area is selected as the target area according to the first area required by the first content to write the target file in the first setting.
If a plurality of blank areas exist in the target file, the blank areas with the matched areas are preferentially selected as the target areas, so that the problem of poor editing effect caused by the fact that the first area required by writing the first content in the first setting is not matched with the area of the selected blank areas is solved.
In some embodiments, the first setting is a current setting of the second content or a target setting of the second content.
In some embodiments, the current setting of the second content may be a setting before the second content is written to the target area. In some embodiments, different settings may be provided in order to meet different types of content viewing requirements. These settings may include layout style and/or layout parameters related to the layout style, etc. Settings for text may include, but are not limited to: the characters comprise fonts, character sizes, line spacing, character spacing, line head setting and line end setting. Also by way of example, the settings of the picture may include a hierarchical setting (foreground or background), picture area, resolution of the image, text surround settings of the picture, and so forth. Also illustratively, the relative positional relationship between the elements in the second content, the format setting of the elements, etc., e.g., the relative positional relationship of the context diagram.
Of course, the foregoing description is merely illustrative of the first content, and the specific implementation is not limited to the foregoing examples.
In some embodiments, the blank area meeting the matching requirement with the first area includes at least one of:
The current area of the blank area is larger than the first area;
The current area of the blank area is larger than or equal to the second area; the second area is the first area adjusted by the allowable first scaling factor;
The maximum available area of the blank area is greater than or equal to the first area or the second area; the maximum available area of the blank area is the maximum area of the blank area after the first content is adjusted with the allowable second scaling factor.
In some embodiments, the first scaling factor may be a preset scaling factor, or a scaling factor that is dynamically determined based on factors such as the first area of the second content and the achievement of a specified sharpness after scaling and/or format or style uniformity with the first content.
In some embodiments, the second scaling factor may be a preset scaling factor, or a scaling factor that is dynamically determined according to factors such as the current area of the first content and reaching a specified sharpness after scaling.
In some embodiments, the conditions associated with the specified definition of the text may include the specified font size. The specified definition related condition of the picture may include a specified resolution. Illustratively, the scaling is based on the second content being viewable, e.g., the specified sharpness-related condition may include a minimum word size, etc., and no longer scaling down to the minimum word size; as another example, the specified sharpness related condition may include a maximum word size, and no further enlargement after enlargement to the maximum word size. For another example, the scaling is based on that elements in the second content do not overlap each other, and in the case of the scaling, the text in the text box is also scaled, and the content elements are easily overlapped due to the modification of the layout. In some embodiments, the relevant conditions specifying sharpness may be set pertinently for viewing preferences and/or vision conditions, etc. of different users.
By adaptive adjustment of the areas of the first content and the second content, a suitable blank area can be found in the blank area for the first content to write.
In some embodiments, determining that the first content is written to the target area in the first area or the adjusted area according to the area size relationship between the target area and the first area includes at least one of:
Determining that the second content is written in the target area with the first area in response to the current area of the target area being greater than or equal to the first area;
Determining that the second content is written into the target area in an enlarged area in response to the current area of the target area being greater than the first area; the second content occupies the target area after being amplified;
determining, in response to the current area of the target area being smaller than the first area, that the second content is written in the target area in a reduced area; the second content occupies the target area after being reduced;
Determining, in response to the maximum available area of the target area being greater than or equal to the first area, that the second content is written to the target area in the adjusted area; the second content is adjusted to occupy the current area of the target area or the adjusted area of the target area;
Determining a second content to write in the target area with the adjusted area in response to the current area of the target area being greater than or equal to the second area; the second content is adjusted to occupy the current area of the target area or the adjusted area of the target area;
In response to the maximum available area of the target area being greater than or equal to the second area, determining that the second content is written in the area-adjusted target area with the adjusted area, in some embodiments, adjusting the first content based on a scaling factor corresponding to the specified sharpness, the maximum available area and/or the minimum available area of the target area may be determined. The area corresponding to the target area is adjustable and/or the area of the second content written into the target file is also adjustable, in this case, the second content is not overlapped with the first content after being written by adjusting one of the two areas, and the visual effect is better. A better visual effect may refer to the first content and the second content being similar in typesetting effect, uniform in style, and the like.
Therefore, one or more blank areas are selected as the target areas in an area matching mode, so that the first content is written into the target file, and the method has the advantage of good display effect.
Also illustratively, in this manner, after the second content is written to the target area, the second content may occupy the target area, i.e., the target area has no empty area left for other content to write.
In some embodiments, the target region is selected from the blank region according to the meaning of the first content and the meaning of the second content; the relative position between the target area and the area where the first content is located, correlates with the similarity between the meaning of the first content and the meaning of the second content.
For example, the first content is a text description for the article a, the second content is an appearance picture for the article a, and the meaning of the first content and the second content is that the first content and the second content have relevance, and a blank area near the first content can be selected to be determined as a target area.
In some embodiments, the more similar the meaning between the first content and the second content, the closer the first content and the second content are located in the target file, so that one or more regions from the blank region that are appropriate for the current first content may be selected as target regions from the blank region according to the similarity of the meaning of the first content and the second content.
In some embodiments, the method further comprises:
determining a target animation effect in the case that an animation setting condition to the first content is satisfied;
and setting the animation of the first content when the target file is played according to the target animation effect.
The setting of animation effects is also contemplated in embodiments of the present disclosure. For example, in some embodiments, whether the animation setup condition of the first content is met may be determined according to whether any of the contents of the target file has a setup animation. For another example, it may be determined whether the animation setup condition of the first content is satisfied according to whether the first content is better using the animation effect.
In summary, in the embodiment of the present disclosure, in the case where the animation setting condition is satisfied, the electronic device may also automatically or intelligently perform setting of the animation effect according to whether the animation setting condition is satisfied. The target animation effect determines an animation effect for the electronic device for the first content playback. After the target animation effect is determined, generating a script or instruction block for playing the animation of the target file in the background. When the target file is played later or the first content is played, the user can play the first content with the target animation effect.
In some embodiments, the animation setup conditions include at least one of:
the second content of the target file is provided with an animation effect;
The page in which the first content is inserted is provided with an animation effect;
The object file is configured with a default animation effect;
an animation effect setting operation for the first content is detected.
The above is the distance that satisfies only the animation setting condition.
In determining the target animation effect, at least one of the following may be employed:
Setting a target animation effect according to the expression intention of the first content, for example, the artificial intelligence model recognizes the expression intention of the first content and determines the target animation effect according to the expression intention;
the animation effect of the first content insert page written content is set as a target animation effect.
Determining a target animation effect according to a user instruction;
Setting a default animation effect of the target file as a target animation effect;
and setting the self-driven drawing effect of the template used by the target file as a target animation effect.
The above is merely an example of the target animation effect, and the specific implementation is not limited to the above example.
In some embodiments, layout information of existing content is obtained: when a user performs paste/insert operation of an object in a content display area without a focus (or called cursor focus), the layout information of the existing content in the current content display area can be obtained; and acquiring information of objects such as texts, pictures and videos contained in the file content. Here, information of objects such as text, pictures, and video may include, but is not limited to, information such as fonts, word sizes, word number sizes, and positions. The embodiment of the disclosure aims to solve the problem of poor layout effect after pasting object content. The reasonable layout of the content objects in the free space is realized through the algorithm, and the manual typesetting layout is reduced so as to improve the pasting efficiency. The embodiment of the disclosure combines the file information and the content object information, and realizes reasonable typesetting layout of the content by using an algorithm in the pasting process. And the automatic typesetting layout of the content is realized based on the file information, so that the pasting efficiency is improved.
Acquiring layout information of existing content: when a user performs paste/insert operation of an object in a content display area without a focus (or called cursor focus), the layout information of the existing content in the current content display area can be obtained; and acquiring information of objects such as texts, pictures and videos contained in the file content. Here, information of objects such as text, pictures, and video may include, but is not limited to, information such as fonts, word sizes, word number sizes, and positions. In some embodiments, the location information may include, but is not limited to: to the left of the key points of the geometry corresponding to the corresponding region, e.g., vertex coordinates, contour coordinates, etc.
As shown in fig. 2A, the current page may be divided into a plurality of regions, for example, named Shape1, S hape, shape3, shape4, shape5, shape6, and Shape7, respectively, according to the existing content distribution of the current page.
Further, based on the acquired information, an information table (SHAPELIST) of the content layout and blank area of each page or content block is generated.
ShapeList=[{type,top,left,width,height,font,words,page,used},...];
Object type: empty, picture, text, table, relationship diagram, shape, ole, iframe, etc.
The number of times of use: the number of uses of the blank area where the content is not written is initially set to 0. The area where the content was once written, the number of uses is set to 1. The 1 represents that the area has been written one or more times. In some embodiments, the number of uses is set to the number of actual writes. Illustratively, SHAPELIST is selected as the current page layout table, and the paste/insert shape used flag is 1.
When the layout information is not acquired, the layout is performed according to the size of the content display area. Illustratively, the target file is a default page layout of its own. For example, taking a presentation file (e.g., a slide) as an example, each page has a center region of content and a peripheral region outside the center region. If the content is written to the peripheral area, the content of the peripheral area may not be displayed when the document is printed.
In some embodiments, a Container (Container) may be used, with the layout information of the page or the page settings identified by the information of the Container.
For example, if the target file is a slide, the container may be the edit scope of the slide itself, or the region represented by the placeholder in the slide.
For example, when no layout information is acquired, the information of a Container (Container) may be set according to a default page layout of the object file itself. Illustratively, container { top, left, width, height }. Here, "top" represents the upper edge of the page, "left" represents the left edge of the page, "width" represents the width of the page, and "height" represents the height of the page.
The layout style information selection rule may be as follows:
According to the information of the first paste object, the object contained in each page (page) is searched from SHAPELIST, and the matching priority is as follows:
a first priority, matching object types, which may relate to video, picture, text, embedded objects, etc.;
The second priority, matching object content, which may relate to word count, video and picture aspect ratio.
The first priority is higher than the second priority, or the second priority is higher than the first priority. The first priority and the second priority can be specifically set according to the priority preference of the editing account of the target file and the file intention of the target file.
At least one of the following ways may be adopted in confirming the layout of the inserted object (or object):
If the layout information is not matched and there is a previous page (page-1) or a next page (page+1), the layout of the current page is used, for example, a default layout of the current page is used.
If the layout information is not matched and the front page and the back page do not exist, the electronic equipment can automatically layout. In performing the automatic layout, a Container (Container) based on the display area may be divided into a plurality of objects.
In doing a layout of multiple objects based on a container, it may be done based on the following rules:
Objects are inserted in the current page in sequence from left to right and/or top to bottom. An object may include a content.
Illustratively, as shown in fig. 2B, when the current page is pasting the 1 st object, the blank area is divided into a plurality of areas according to the size of the 1 st object, and information of the areas is added to SHAPELIST.
The spot-filled region Shape1 in fig. 2B is the region into which the 1 st object is inserted. Other objects continue to be pasted, e.g., the 2 nd object continues to be inserted. The area of the current page is re-divided according to the size of the 2 nd object, the Shape2 (Shape 2) shown in fig. 2B is divided into two areas, resulting in a new Shape2 and a Shape5 (Shape 5), the information of the old Shape2 in SHAPELIST is deleted, and the information of the new Shape2 is added to SHAPELIST and the information of the Shape5 is added in SHAPELIST. The region division of the current page after the insertion of the 2 nd object may be as shown in fig. 2C.
In some embodiments, the following is a combination of layout sources, which determines whether the layout of the present page is applicable, and then determines whether the layout of the adjacent page is applicable.
Illustratively, paste the slide page where the operation is located; for example, the picture and text 1 is already arranged in the slide, the pasting operation is also carried out on the picture and text 2, the arrangement mode of the picture and text 2 can be adjusted according to the arrangement mode of the picture and text 1, then the picture and text 1 and the picture and text 2 can be arranged in the slide together, the editing range of the slide is not exceeded, and the user is prevented from further needing additional adjustment.
In some embodiments, when pasting or inserting according to content, information may be pasted or inserted according to the current format of the file, the original format of the pasted or inserted content, or in plain text format.
Slides of the same type as the current slide; as is the case with directory pages, the same type of slide can be determined by copying the type and number of elements, even semantically.
The format and/or layout of the current page, etc. may refer to adjacent slide pages and/or user-specified slide pages.
The above is exemplified as a presentation file, and other types of files are the same, so that the manner of pasting or inserting the content can realize the self-adaptive adjustment of the format, for example, quick typesetting of the pasted content, so as to ensure the consistency of the layout style.
When the front page and the back page are not found, the Container (Container) of the display area is divided into a plurality of objects by adopting automatic layout, and the usage rules are as follows:
Sequentially inserting or pasting objects from left to right and from top to bottom:
Pasting the 1 st object, dividing the blank area into 4 blocks according to the size of the 1 st object, and adding SHAPELIST; a block is selected from the divided blank area for insertion or pasting of the 1 st object. Repeating the steps to finish the insertion of each object.
The more one pasting mode is:
pasting according to a preset layout, such as a plurality of rows and columns;
the preset layout source may be a layout of a content paste to a current file, a preset layout, a layout used by a current file, or a default layout.
At the time of pasting, the inserted file is pasted to the blank. Upon pasting to a specified range (user selected), both of these approaches are applicable without affecting other content already present in the slide.
In some embodiments, SHAPELIST is information for all of the content in each page. Based on this SHAPELIST, the blank area in each page can also be determined, although this SHAPELIST can be used for maintenance or another list, or the SHAPELIST can be calculated and updated in real time during the paste operation.
After continuing to paste the object, the original blank area shap is divided into shape2 and shape5 according to the size of the object 2, and SHAPELIST is added, and so on.
In the acquired layout information and rule, when there is a paste/insert operation of the object 1 in the content display area:
Position information of the object 1 is acquired, the position information including a position P0, a width W0, and a height H0. The rule for specifically acquiring the position information is as follows:
Layout information of the type in the target layout is acquired based on the type information of the object 1, and the layout of the objects 2, 3, etc. are inserted after the object 1 is determined based on the layout information.
For example, an object type is obtained that relates to a picture, video, audio, text, formula, embedded control, and so forth.
Object content: the aspect ratio of the non-text classes is the same as 16:9,4:3, within N words of difference.
When the matching of the object content cannot be satisfied, the object type matching is performed, when
When the object type is not obtained based on the object type, the blank area matched with the original layout is found as a target area according to the original layout of the inserted content. For example, if the inserted content has a subtitle, the editing component writes the content in the target area with the corresponding layout information by preferentially searching the area adjacent to the blank area as the target area and returning the area position and layout information of the target area to the editing component.
Repeating the steps, typesetting other content pastes in sequence according to the follow-up rules, and selecting unused object layout from the object layout information table.
The width and height of the pasting object 1 are calculated, and for example, a target area is determined according to the size of the object 1. For example, if the object 1 is a picture or a text, the width and height of the picture or the text are acquired, and the target area is determined according to the width and height of the picture or the text. For example, when the width and height of the acquired picture or text exceeds the acquired target area, the object to be inserted or the object of the written file can be adaptively adjusted.
In some embodiments, the picture width and height acquisition manner may be as follows:
taking the minimum wide-to-high scaling ratio ratio=min (W0/W1, H0/H1);
display size (width: W1 ratio, height: H1 ratio).
In this way, based on the minimum wide-to-high scaling and the current display size, the maximum area and/or the minimum area of the target area into which the picture can be inserted can be known.
The text width and height acquisition mode can be as follows:
Applying font information displayed in the target area, using character information (W1, H1); w1 represents the width of the character; h1 represents the height of the character.
Calculating a vertical blank region height dh=h0-H1; h0 is the height of the current page. If the height H1> H0 is displayed, the word size is adjusted to ensure H1< H0,
If dH is greater than the threshold, the data is added to a content layout information table (top: t0, left: l0, width: W0, height: dH) as a blank area.
The horizontal blank region width dw=w0-W1 is calculated.
DW is greater than the threshold, and is added to the content layout information table (top: t0, left: l0+W0, width: dW, height: H1) as a blank area.
If the height H1< H0 is displayed, the pasting object 1 is executed.
At the in-file position P0, the object width and height (W1, H1) is inserted based on the acquired object width and height information.
Continuing the operation of inserting or pasting the object 2, the following operations may be performed:
Based on the acquired object layout, target pasting region information is acquired therefrom:
The method comprises the steps of selecting the same type of object layout preferentially from left to right and from top to bottom, and selecting unused object layout when no region of the same type exists;
the width and height of the pasting object and the blank area are calculated, and as the pasting object 1 is operated,
The paste other content continuation object 2 may be as follows:
Through the mode of dynamic layout adjustment, the display effect of inserting or pasting a plurality of content objects can be improved by arranging the content objects in sequence in the pasting process, most scenes can avoid users to adjust the object positions for the second time, and meanwhile, the difficulty in selection caused by stacking the content can be avoided.
As shown in fig. 5, an embodiment of the present disclosure provides a file editing apparatus, including:
A detection module 110 configured to detect a first operation for a target file; the first operation is used for writing a first inner write into the target file;
A determining module 120 configured to determine a target layout of the first content written to the target file;
a writing module 130 configured to determine a target layout of the first content written to the target file.
In some embodiments, the write module is configured to perform at least one of:
determining the target layout according to the related layout of the first content and/or the related layout of the target file;
determining the target layout according to the layout of the page acted by the first operation;
determining the target layout according to the layout of the page specified by the user;
determining a preset layout as the target layout; the preset layout includes: and the default layout or the layout with highest use frequency of the target file.
In some embodiments, the writing module is configured to perform at least one of:
determining a current layout of the first content as the target layout;
determining a current layout of similar content of the first content as the target layout;
Determining the target layout according to the layout of the second content of the target file; the second content is written before the first content is written into the target file;
determining the target layout according to the layout of the template association used by the target file;
Determining the target layout according to the layout used by the similar files of the target file;
determining the target layout according to the layout of the page where the target area is located;
determining the target layout according to the layout used by the similar page of the page where the target area is located;
determining the target layout according to the layout of the adjacent pages of the page where the target area is located;
Determining the target layout according to the default layout of the target file;
determining the target layout according to user input;
The target layout is determined according to at least one of the meaning of the first content and the content intent.
In some embodiments, the writing module is configured to determine a reference layout according to a layout related to the first content and/or a layout related to the target content;
The target layout is selected from the reference layouts.
In some embodiments, the writing module is configured to perform at least one of:
Determining the target layout according to the priority of the acquired reference layout;
The target layout is selected from the reference layouts according to the matching degree of each reference layout and the expression intention of the first content.
In some embodiments, the apparatus further comprises:
An adjustment module configured to perform a predetermined adjustment upon detecting that a trigger condition is satisfied in a case where the second content is written to the target file; the predetermined adjustment includes at least one of:
Adjusting the overall layout of the target file;
adjusting a layout of the first content and at least a portion of the second content;
and adjusting the layout of part or all of the second content.
In some embodiments, the adjustment triggering condition includes at least one of:
The target file completes the writing of the first content;
The target file is edited;
The time length from the last adjustment of the target file is longer than or equal to the first time length;
the number of written content of the target file reaches a first number after the last adjustment;
the number of the pages of the target file adjusted after the last adjustment reaches a second number;
and detecting an adjustment operation input by the editing interface.
In some embodiments, the adjustment module is configured to perform at least one of:
the layout of any two pages of the target file meets the similar condition;
The layout change of two or more pages of the target file meets the gradual change condition;
Adjusting the relative positions of different content blocks in the target file;
And adjusting the relative positions of different parts in one content block in the target file.
In some embodiments, the apparatus further comprises:
an animation module configured to determine a target animation effect in the case that an animation setting condition to the first content is satisfied;
And the setting module is configured to set the animation of the first content when the target file is played according to the target animation effect.
In some embodiments, the animation setup conditions include at least one of:
the second content of the target file is provided with an animation effect;
The page in which the first content is inserted is provided with an animation effect;
The object file is configured with a default animation effect;
an animation effect setting operation for the first content is detected.
An embodiment of the present disclosure provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: when used for executing the executable instructions, the method for editing the file provided by any one of the foregoing technical solutions is implemented, for example, the method for editing the file shown in any one of fig. 1 and/or fig. 3 is implemented.
The electronic device may be the aforementioned first client, second client, and/or server.
As shown in fig. 6, an embodiment of the present disclosure shows a structure of an electronic device. For example, the electronic device 900 may function as a client-mounted terminal and/or server. Referring to fig. 6, electronic device 900 includes a processing component 922 that further includes one or more processors and memory resources represented by memory 932 for storing instructions, such as application programs, executable by processing component 922. The application programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Furthermore, processing component 922 is configured as an executable program to perform any of the methods previously described above as being applied to an access device, for example, to implement a file editing method as shown in any of fig. 1 and/or 3.
The electronic device 900 may also include a power supply component 926 configured to perform power management for the electronic device 900, a wired or wireless network interface 950 configured to connect the electronic device 900 to a network, and an input output (I/O) interface 958. The electronic device 900 may operate based on an operating system stored in memory 932, such as Windows Server TM, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
In an exemplary embodiment, an embodiment of the present disclosure provides a computer readable storage medium storing an executable program, where the executable program when executed by a processor implements a file editing method provided by any one of the foregoing technical solutions.
The computer readable storage medium may specifically be: a non-transitory computer readable storage medium.
Illustratively, such as memory 932 including executable programs, the above-described instructions may be executed by processing component 922 of electronic device 900 to perform the above-described methods.
The non-transitory computer readable storage medium may be a ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other implementations of the disclosed embodiments will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the embodiments of the disclosure following, in general, the principles of the embodiments of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosed embodiments being indicated by the following claims.
It is to be understood that the disclosed embodiments are not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present disclosure is limited only by the appended claims.

Claims (14)

1. A method of editing a file, the method comprising:
detecting a first operation for a target file; the first operation is used for writing first content into the target file;
Determining a target layout of the first content written into the target file;
and writing the first content into the target file in the target layout.
2. The method of claim 1, wherein the determining the target layout of the first content write to the target file comprises at least one of:
determining the target layout according to the related layout of the first content and/or the related layout of the target file;
determining the target layout according to the layout of the page acted by the first operation;
determining the target layout according to the layout of the page specified by the user;
determining a preset layout as the target layout; the preset layout includes: and the default layout or the layout with highest use frequency of the target file.
3. The method according to claim 2, wherein the determining the target layout of the first content written to the target file based on the relevant layout of the first content and/or the relevant layout of the target file comprises at least one of:
determining a current layout of the first content as the target layout;
determining a current layout of similar content of the first content as the target layout;
Determining the target layout according to the layout of the second content of the target file; the second content is written before the first content is written into the target file;
determining the target layout according to the layout of the template association used by the target file;
Determining the target layout according to the layout used by the similar files of the target file;
determining the target layout according to the layout of the page where the target area is located;
determining the target layout according to the layout used by the similar page of the page where the target area is located;
determining the target layout according to the layout of the adjacent pages of the page where the target area is located;
Determining the target layout according to the default layout of the target file;
determining the target layout according to user input;
The target layout is determined according to at least one of the meaning of the first content and the content intent.
4. The method according to claim 2, wherein the determining the target layout of the first content written to the target file according to the relevant layout of the first content and/or the relevant layout of the target file comprises:
Determining a reference layout according to the related layout of the first content and/or the related layout of the target content;
The target layout is selected from the reference layouts.
5. The method of claim 4, wherein the selecting the target layout from the reference layouts comprises at least one of:
Determining the target layout according to the priority of the acquired reference layout;
The target layout is selected from the reference layouts according to the matching degree of each reference layout and the expression intention of the first content.
6. The method according to any one of claims 1 to 5, further comprising:
detecting that a triggering condition is met under the condition that the second content is written into the target file, and executing preset adjustment; the predetermined adjustment includes at least one of:
Adjusting the overall layout of the target file;
adjusting a layout of the first content and at least a portion of the second content;
and adjusting the layout of part or all of the second content.
7. The method of claim 6, wherein the adjustment triggering condition comprises at least one of:
The target file completes the writing of the first content;
The target file is edited;
The time length from the last adjustment of the target file is longer than or equal to the first time length;
the number of written content of the target file reaches a first number after the last adjustment;
the number of the pages of the target file adjusted after the last adjustment reaches a second number;
and detecting an adjustment operation input by the editing interface.
8. The method of claim 6, wherein the detecting that an adjustment trigger condition is met if the first content is written to the target file, adjusts an overall layout of the target file, comprises at least one of:
the layout of any two pages of the target file meets the similar condition;
The layout change of two or more pages of the target file meets the gradual change condition;
Adjusting the relative positions of different content blocks in the target file;
And adjusting the relative positions of different parts in one content block in the target file.
9. The method according to any one of claims 1 to 8, further comprising:
determining a target animation effect in the case that an animation setting condition to the first content is satisfied;
and setting the animation of the first content when the target file is played according to the target animation effect.
10. The method of claim 9, wherein the step of determining the position of the substrate comprises,
The animation setting condition includes at least one of:
the second content of the target file is provided with an animation effect;
The page in which the first content is inserted is provided with an animation effect;
The object file is configured with a default animation effect;
an animation effect setting operation for the first content is detected.
11. A document editing apparatus, the apparatus comprising:
A detection module configured to detect a first operation for a target file; the first operation is used for writing first content into the target file;
A determining module configured to determine a target layout of the first content written to the target file;
a writing module configured to write the first content to the target file in the target layout.
12. An electronic device, comprising:
A processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to: for implementing the file editing method of any of claims 1 to 10 when said executable instructions are executed.
13. A computer-readable storage medium, characterized in that the readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the file editing method of any one of claims 1 to 10.
14. A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 10.
CN202410336537.9A 2024-03-22 2024-03-22 File editing method and device, electronic equipment and storage medium Pending CN118228699A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410336537.9A CN118228699A (en) 2024-03-22 2024-03-22 File editing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410336537.9A CN118228699A (en) 2024-03-22 2024-03-22 File editing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118228699A true CN118228699A (en) 2024-06-21

Family

ID=91497266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410336537.9A Pending CN118228699A (en) 2024-03-22 2024-03-22 File editing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118228699A (en)

Similar Documents

Publication Publication Date Title
US7707495B2 (en) Layout processing method, layout processing apparatus, and layout processing program for dynamically changing a layout of a template having a plurality of a data regions in accordance with content data inserted into the data regions
US7292244B2 (en) System and method for automatic label placement on charts
US10417316B2 (en) Emphasizing a portion of the visible content elements of a markup language document
US11727206B2 (en) Systems and methods for applying layout to documents
US9223757B2 (en) Automated paragraph layout
US9298676B2 (en) Layout determination method, layout determination apparatus, and layout determination program
US7415475B2 (en) Authoring tools, including content-driven treetables, for fluid text
JP5439456B2 (en) Electronic comic editing apparatus, method and program
CN112040142B (en) Method for video authoring on mobile terminal
CN111930289B (en) Method and system for processing pictures and texts
JP2012038286A (en) Content analyzing apparatus, method and program
JP2009048450A (en) Document management program and thumbnail display method
US7027071B2 (en) Selecting elements from an electronic document
WO2023093809A1 (en) File editing processing method and apparatus, and electronic device
CN118228699A (en) File editing method and device, electronic equipment and storage medium
CN107656908B (en) Method and system for implementing placeholder
KR102649627B1 (en) An automatic image placement and execution method using the DTP program, an adobe indesign
CN118211571A (en) File editing method and device, electronic equipment and storage medium
CN112269520B (en) Element display control method and device, interactive panel and storage medium
CN113378526A (en) PDF paragraph processing method, device, storage medium and equipment
CN111382552A (en) Typesetting processing method, device, equipment and storage medium
US20130104014A1 (en) Viewer unit, server unit, display control method, digital comic editing method and non-transitory computer-readable medium
JP7246795B1 (en) Information processing device, method, program, and system
CN117436415A (en) Presentation generation method and device, electronic equipment and storage medium
CN116740235A (en) Text annotation rendering method and device based on format document

Legal Events

Date Code Title Description
PB01 Publication