Invention content
To solve the above problems, the embodiment of the invention discloses a kind of PowerPoint template replacing method and devices.Technology
Scheme is as follows:
A kind of PowerPoint template replacing method, including:
The template replacement that user is received for pending PowerPoint document instructs;
It is instructed according to the template replacement, determines target PowerPoint template;
For each pending lantern slide of the pending PowerPoint document, following operation is executed:
According to preset matching algorithm, every lantern slide and pending lantern slide in the target PowerPoint template are calculated
Object matching degree;
It will be true with the highest lantern slide of object matching degree of the pending lantern slide in the target PowerPoint template
It is set to template lantern slide;
According to the object type in the pending lantern slide, the contents of object in the pending lantern slide is filled into
In the template lantern slide in the object-oriented framework of respective type, processed lantern slide is obtained;
The pending lantern slide is replaced using obtained processed lantern slide.
Specifically, described instruct according to the template replacement, target PowerPoint template is determined, including:
It is instructed according to the template replacement, extracts the object-type information that the pending PowerPoint document includes;
Select a PowerPoint template comprising the object-type information extracted as mesh from default template library
Mark PowerPoint template.
Specifically, the basis presets the first matching algorithm, every lantern slide in the target PowerPoint template is calculated
With the object matching degree of pending lantern slide, including:
According to the number of same type object in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and the pending lantern slide.
Specifically, the basis presets the first matching algorithm, every lantern slide in the target PowerPoint template is calculated
With the object matching degree of pending lantern slide, including:
According to the similarity degree of characteristics of objects in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and pending lantern slide, the characteristics of objects include text box size, dimension of picture size, chart
Size.
Specifically, the object type according in the pending lantern slide, by pair in the pending lantern slide
As in the object-oriented framework of respective type in fills to the template lantern slide, obtaining processed lantern slide, including:
Extract the contents of object in the pending lantern slide;
Determine the corresponding object type of the contents of object;
The contents of object is filled into the template lantern slide in the object-oriented framework of respective type, is obtained processed unreal
Lamp piece.
A kind of PowerPoint template replacement device, including:
Command reception module is replaced, is instructed for the template replacement of pending PowerPoint document for receiving user;
Target template determining module determines target PowerPoint template for being instructed according to the template replacement;
Lantern slide replaces module, for each pending lantern slide for the pending PowerPoint document, holds
Row lantern slide replacement operation, wherein the lantern slide replaces module and includes:
Matching degree computational submodule, for calculating every lantern slide and pending magic lantern in the target PowerPoint template
The object matching degree of piece;
Template lantern slide determination sub-module, for by the target PowerPoint template with the pending lantern slide
The highest lantern slide of object matching degree is determined as template lantern slide;
Processed lantern slide obtains submodule, for according to the object type in the pending lantern slide, being waited for described
Contents of object in processing lantern slide is filled into the template lantern slide in the object-oriented framework of respective type, is obtained processed unreal
Lamp piece;
Lantern slide replaces submodule, for replacing the pending lantern slide using obtained processed lantern slide.
Specifically, the target template determining module, including:
Object-type information extracting sub-module, for being instructed according to the template replacement, the extraction pending demonstration text
The object-type information that original text document includes;
Target template determination sub-module, for selecting one to include the object type letter extracted from default template library
The PowerPoint template of breath is as target PowerPoint template.
Specifically, the matching degree computational submodule, is specifically used for:
According to the number of same type object in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and the pending lantern slide.
Specifically, the matching degree computational submodule, is specifically used for:
According to the similarity degree of characteristics of objects in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and pending lantern slide, the characteristics of objects include text box size, dimension of picture size, chart
Size.
Specifically, the processed lantern slide obtains submodule, including:
Contents of object extraction unit, for extracting the contents of object in the pending lantern slide;
Object type determination unit, for determining the corresponding object type of the contents of object;
Processed lantern slide obtaining unit, for the contents of object to be filled into respective type in the template lantern slide
Object-oriented framework in, obtain processed lantern slide.
The technical solution provided using the embodiment of the present invention, for every pending lantern slide of PowerPoint document,
Contents of object in pending lantern slide is filled into the object-oriented framework of determining template lantern slide respective type, has been located
Lantern slide is managed, and pending lantern slide is replaced using processed lantern slide, has not only replaced the background of PowerPoint document in this way
Figure, theme color, while also having replaced the format structure in PowerPoint document lantern slide so that the version of entire PowerPoint document
The comparison match such as formula structure, Background, theme color reach more preferably bandwagon effect, and the user experience is improved.
Specific implementation mode
It is provided for the embodiments of the invention a kind of PowerPoint template replacing method first to illustrate, this method can be with
Include the following steps:
The template replacement that user is received for pending PowerPoint document instructs;
It is instructed according to the template replacement, determines target PowerPoint template;
For each pending lantern slide of the pending PowerPoint document, following operation is executed:
According to preset matching algorithm, every lantern slide and pending lantern slide in the target PowerPoint template are calculated
Object matching degree;
It will be true with the highest lantern slide of object matching degree of the pending lantern slide in the target PowerPoint template
It is set to template lantern slide;
According to the object type in the pending lantern slide, the contents of object in the pending lantern slide is filled into
In the template lantern slide in the object-oriented framework of respective type, processed lantern slide is obtained;
The pending lantern slide is replaced using obtained processed lantern slide.
The technical solution provided using the embodiment of the present invention, for every pending lantern slide of PowerPoint document,
Contents of object in pending lantern slide is filled into the object-oriented framework of determining template lantern slide respective type, has been located
Lantern slide is managed, and pending lantern slide is replaced using processed lantern slide, has not only replaced the background of PowerPoint document in this way
Figure, theme color, while also having replaced the format structure in PowerPoint document lantern slide so that the version of entire PowerPoint document
The comparison match such as formula structure, Background, theme color reach more preferably bandwagon effect, and the user experience is improved.
In order to make those skilled in the art more fully understand the technical solution in the embodiment of the present invention, below in conjunction with this hair
Attached drawing in bright embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described
Embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field
The every other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention
Range.
It is shown in Figure 1, by a kind of implementing procedure for PowerPoint template replacing method that the embodiment of the present invention provides
Figure, this method may comprise steps of:
S110:The template replacement that user is received for pending PowerPoint document instructs;
Pending PowerPoint document makes for user, carries out the document for replacing template processing.When user is discontented
When the bandwagon effect of meaning current presentation manuscript document, needs that the PowerPoint document is carried out to replace template processing, can send out
Template replacement instructs.In practical applications, a quick botton can be provided in the menu of PowerPoint, user clicks this and presses
Button, you can send out template replacement instruction.After user is received for the template replacement instruction of pending PowerPoint document, continue
Execute the operation of step S120.
S120:It is instructed according to the template replacement, determines target PowerPoint template;
It is understood that the replacement for PowerPoint template, needs in PowerPoint system, one is pre-set
Template library, the template library can be saved on local terminal when installing PowerPoint software, may be stored in demonstrating simultaneously
Manuscript server end passes through demonstration corresponding with the interaction acquisition of server end after client receives template replacement instruction
Manuscript template or template replacement operation can be completed directly in server end.Template library can include multiple types, a variety of samples
The PowerPoint template of formula, certainly, these templates can be the default settings of system operation personnel, can also be that user oneself creates
It builds.
In practical applications, the method for determining target PowerPoint template can include but is not limited to following three kinds:
The first:When user has the demand for the replacement template of PowerPoint document, can be specified from template library
One PowerPoint template carries PowerPoint Template Information in this case in template replacement instruction, the present invention is implemented
After the executive agent of example receives template replacement instruction, can the PowerPoint template specified by user be directly determined as target
PowerPoint template.
Second:User has no way of selecting for numerous PowerPoint templates in template library, can be according to certain matching
Method finds out from template library and matches with pending PowerPoint document if characteristics of objects is similar, object type is mutually same
Multiple PowerPoint templates, and by these PowerPoint templates by it is preset it is a kind of in a manner of (such as thumbnail mode) show use
Family, further according to the selection instruction of user, determines target PowerPoint template to be selected by user.
The third:User's selection is not needed, after the template replacement instruction for receiving user, by certain matching process,
The PowerPoint template most to match with pending PowerPoint document is found out, and as target PowerPoint mould
Plate.
In a kind of specific implementation mode of the present invention, which may comprise steps of:
Step 1:It is instructed according to the template replacement, extracts the object type that the pending PowerPoint document includes
Information;
Step 2:A PowerPoint template for including the object-type information extracted is selected from default template library
As target PowerPoint template.
For convenience of description, above-mentioned two step is combined and is illustrated.
It is understood that PowerPoint document includes at least a lantern slide, every lantern slide is by specific object structure
At object type can have the types such as text box, picture, chart.It is instructed according to template replacement, extracts pending PowerPoint
All object-type informations that document is included, and by the PowerPoint in the object-type information extracted and default template library
The object-type information that template includes is compared, and determines the PowerPoint mould including at least extracted object-type information
Plate, and select from these qualified PowerPoint templates one as target PowerPoint template.It can randomly choose,
These qualified PowerPoint templates can also be showed user, after being specified by user, by the demonstration specified by user
Manuscript template is as target PowerPoint template.According to object-type information determine target PowerPoint template, can with wait for
Handling PowerPoint document has stronger matching.
For example, there are three types of the object-type informations extracted from pending PowerPoint document, text box, picture and chart
Type, in this case, determining target PowerPoint template are also required to include at least these three object types.Actually answering
In, more careful division can be carried out to the object type of PowerPoint document, such as by text box be divided into horizontally-arranged text box,
Vertical setting of types text box etc. can determine more matched target PowerPoint template in this way.
Certainly, those skilled in the art can also be according to other features of PowerPoint document, such as same type object
Number etc. determines that target PowerPoint template, the present invention are without limitation.
By step S110 and step S120, pending PowerPoint document and target PowerPoint template are obtained, after
The continuous operation for executing step S130.
S130:For each pending lantern slide of pending PowerPoint document, lantern slide replacement operation is executed;
Specifically, may comprise steps of for each pending lantern slide replacement operation, it is shown in Figure 2:
S131:According to preset matching algorithm, calculate in the target PowerPoint template every lantern slide with it is pending unreal
The object matching degree of lamp piece;
It is understood that including multiple lantern slides in identified target PowerPoint template, every lantern slide includes
Object may be different, there is different format structures.For pending lantern slide, need in target PowerPoint template
In determine matched lantern slide.It can be calculated every in target PowerPoint template by preset matching algorithm
Open the object matching degree of lantern slide and pending lantern slide.
The present invention a kind of specific implementation mode in, can according to the number of same type object in different lantern slides,
Calculate the object matching degree of every lantern slide and the pending lantern slide in the target PowerPoint template.
For arbitrary two lantern slides, if this two lantern slide object types having the same, same type
The number of object is more, shows that the object matching degree of this two lantern slides is higher.For example, lantern slide 1 respectively with lantern slide 2, unreal
Lamp piece 3 is compared, and has picture 3 to open in lantern slide 1, text box 4, has picture 1 to open in lantern slide 2, text box 2, magic lantern
There is picture 3 to open in piece 3, text box 3, then the number of lantern slide 1 and 2 same type object of lantern slide is 3, lantern slide 1 with it is unreal
The number of 3 same type object of lamp piece is 6, and the object matching degree of lantern slide 1 and lantern slide 3 is higher than the object with lantern slide 2
With degree.
Specifically, the object matching degree of every lantern slide and pending lantern slide can utilize in target PowerPoint template
Formula:Object total number is calculated in the sum of number of same type object/pending lantern slide.I.e. by pending lantern slide
It is compared with the object of every lantern slide in target PowerPoint template, obtains pending lantern slide and demonstrate text relative to target
The number of the same type object of every lantern slide in original text template is obtained by being divided by with object total number in pending lantern slide
To the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template.
It, can also be according to the similar journey of characteristics of objects in different lantern slides in another specific implementation mode of the present invention
Degree, calculates the object matching degree of every lantern slide and pending lantern slide in the target PowerPoint template, and the object is special
Sign includes text box size, dimension of picture size, chart size size.
For arbitrary two lantern slides, the characteristics of objects in this two lantern slides can be extracted, such as text box size
Size, dimension of picture size, chart size size etc., the numerical value that the characteristics of objects of same type object is characterized is compared, is obtained
To the similarity of the characteristics of objects of each type object, the characteristics of objects Similarity-Weighted of different object is summed or weighted
Multiplication can be obtained object matching degree.
Certainly, the scheme that those skilled in the art can also be provided through the embodiment of the present invention obtains other and calculates public affairs
Formula, to which the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template be calculated.
S132:By the highest magic lantern of object matching degree with the pending lantern slide in the target PowerPoint template
Piece is determined as template lantern slide;
By step S131, the object of every lantern slide and pending lantern slide in target PowerPoint template is calculated
The highest lantern slide of matching degree is determined as template lantern slide, continues to execute the operation of step S133 by matching degree.
S133:According to the object type in the pending lantern slide, by the contents of object in the pending lantern slide
It is filled into the template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide;
Template lantern slide be PowerPoint template in a pending lantern slide lantern slide the most matched, wherein including
Object exist in the form of object-oriented framework, the logical relation in pending lantern slide and processed lantern slide between each object can be with
It is obtained by extracting object feature.According to the object type in pending lantern slide, by the contents of object in pending lantern slide
It is filled into the object-oriented framework of template lantern slide respective type, obtains processed lantern slide, certainly, processed lantern slide contains
Background in template lantern slide and theme color.
For convenience of understanding, said by taking the pending lantern slide schematic diagrames of Fig. 3 a and the processed lantern slide schematic diagrames of Fig. 3 b as an example
It is bright.
The object for including in the pending lantern slide schematic diagrames of Fig. 3 a is respectively:Two pictures, two texts for including word
Frame, extracting object feature can obtain the logical relation between word in picture and text box, according in pending lantern slide
Two pictures are filled into the frame of the picture/mb-type of template lantern slide by object type respectively, and according to picture and text box
Word content in two text boxes is filled into the text box type of template lantern slide by the logical relation between middle word respectively
Frame in, obtain lantern slide shown in the processed lantern slide schematic diagrames of Fig. 3 b.Therefrom as it can be seen that pending lantern slide background compares
Dullness, layout is in disorder, and processed lantern slide background is exquisite, and layout comparison is reasonable.
In a kind of specific implementation mode of the present invention, this step may comprise steps of:
Extract the contents of object in the pending lantern slide;
Determine the corresponding object type of the contents of object;
The contents of object is filled into the template lantern slide in the object-oriented framework of respective type, is obtained processed unreal
Lamp piece.
Contents of object, the content for as including specifically in object, such as the word in text box.It will be in pending lantern slide
Contents of object extracts, and determines object type corresponding with the contents of object, and contents of object is filled into template magic lantern
In piece in the object-oriented framework of respective type, processed lantern slide is obtained.
S134:The pending lantern slide is replaced using obtained processed lantern slide.
When PowerPoint document institute lantern slide to be handled replaces with corresponding processed lantern slide, that is, complete demonstration
The replacement of manuscript template.
The technical solution provided using the embodiment of the present invention, for every pending lantern slide of PowerPoint document,
Contents of object in pending lantern slide is filled into the object-oriented framework of determining template lantern slide respective type, has been located
Lantern slide is managed, and pending lantern slide is replaced using processed lantern slide, has not only replaced the background of PowerPoint document in this way
Figure, theme color, while also having replaced the format structure in PowerPoint document lantern slide so that the version of entire PowerPoint document
The comparison match such as formula structure, Background, theme color reach more preferably bandwagon effect, and the user experience is improved.
Corresponding to above method embodiment, the embodiment of the present invention additionally provides a kind of PowerPoint template replacement device,
Described in Fig. 4, which may include with lower module:
Command reception module 210 is replaced, is instructed for the template replacement of pending PowerPoint document for receiving user;
Target template determining module 220 determines target PowerPoint template for being instructed according to the template replacement;
Lantern slide replaces module 230, each pending lantern slide for being directed to the pending PowerPoint document,
Execute lantern slide replacement operation.
Wherein, it can also include following submodule that the lantern slide, which replaces module 230, shown in Figure 5:
Matching degree computational submodule 231, for calculate in the target PowerPoint template every lantern slide with it is pending
The object matching degree of lantern slide;
Template lantern slide determination sub-module 232, for by the target PowerPoint template with the pending magic lantern
The highest lantern slide of object matching degree of piece is determined as template lantern slide;
Processed lantern slide obtains submodule 233, is used for according to the object type in the pending lantern slide, will be described
Contents of object in pending lantern slide is filled into the template lantern slide in the object-oriented framework of respective type, is obtained processed
Lantern slide;
Lantern slide replaces submodule 234, for replacing the pending lantern slide using obtained processed lantern slide.
The device provided using the embodiment of the present invention will be waited for for every pending lantern slide of PowerPoint document
Contents of object in processing lantern slide is filled into the object-oriented framework of determining template lantern slide respective type, is obtained processed unreal
Lamp piece, and pending lantern slide is replaced using processed lantern slide, Background, the master of PowerPoint document have not only been replaced in this way
Color is inscribed, while also having replaced the format structure in PowerPoint document lantern slide so that the format knot of entire PowerPoint document
The comparison match such as structure, Background, theme color reach more preferably bandwagon effect, and the user experience is improved.
In a kind of specific implementation mode of the present invention, the target template determining module 220 may include following submodule
Block:
Object-type information extracting sub-module, for being instructed according to the template replacement, the extraction pending demonstration text
The object-type information that original text document includes;
Target template determination sub-module, for selecting one to include the object type letter extracted from default template library
The PowerPoint template of breath is as target PowerPoint template.
In a kind of specific implementation mode of the present invention, the matching degree computational submodule 231 is specifically used for:
According to the number of same type object in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and the pending lantern slide.
In a kind of specific implementation mode of the present invention, the matching degree computational submodule 231 is specifically used for:
According to the similarity degree of characteristics of objects in different lantern slides, every magic lantern in the target PowerPoint template is calculated
The object matching degree of piece and pending lantern slide, the characteristics of objects include text box size, dimension of picture size, chart
Size.
In a kind of specific implementation mode of the present invention, the processed lantern slide obtains submodule 233, may include with
Lower unit:
Contents of object extraction unit, for extracting the contents of object in the pending lantern slide;
Object type determination unit, for determining the corresponding object type of the contents of object;
Processed lantern slide obtaining unit, for the contents of object to be filled into respective type in the template lantern slide
Object-oriented framework in, obtain processed lantern slide.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.
One of ordinary skill in the art will appreciate that all or part of step in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can be stored in computer read/write memory medium,
The storage medium designated herein obtained, such as:ROM/RAM, magnetic disc, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.