Summary of the invention
For solving the problems referred to above, the embodiment of the invention discloses a kind of PowerPoint template replacing method and device.Technical scheme is as follows:
A kind of PowerPoint template replacing method, including:
Receive user's template replacement instruction for pending PowerPoint document;
According to described template replacement instruction, it is determined that target PowerPoint template;
For each pending lantern slide of described pending PowerPoint document, perform following operation:
According to preset matching algorithm, calculate the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template;
Lantern slide the highest with the object matching degree of described pending lantern slide in described target PowerPoint template is defined as template lantern slide;
According to the object type in described pending lantern slide, the contents of object in described pending lantern slide is filled in described template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide;
Obtained processed lantern slide is utilized to replace described pending lantern slide.
Concrete, described according to described template replacement instruction, it is determined that target PowerPoint template, including:
According to described template replacement instruction, extract described pending PowerPoint document package containing object-type information;
Select a PowerPoint template comprising the object-type information extracted to some extent as target PowerPoint template from default template base.
Concrete, described basis presets the first matching algorithm, calculates the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, including:
According to the number of same type object in different lantern slides, calculate the object matching degree of every lantern slide and described pending lantern slide in described target PowerPoint template.
Concrete, described basis presets the first matching algorithm, calculates the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, including:
According to the similarity degree of characteristics of objects in different lantern slides, calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, described characteristics of objects comprises text box size, dimension of picture size, chart size size.
Concrete, described according to the object type in described pending lantern slide, the contents of object in described pending lantern slide is filled in described template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide, including:
Extract the contents of object in described pending lantern slide;
Determine the object type that described contents of object is corresponding;
Described contents of object is filled in described template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide.
A kind of PowerPoint template replacement device, including:
Change command reception module, for receiving user's template replacement instruction for pending PowerPoint document;
To Template determines module, for according to described template replacement instruction, it is determined that target PowerPoint template;
Module changed by lantern slide, for each the pending lantern slide for described pending PowerPoint document, performs lantern slide replacement operation, and wherein, described lantern slide is changed module and included:
Matching degree calculating sub module, for calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template;
Submodule determined by template lantern slide, for lantern slide the highest with the object matching degree of described pending lantern slide in described target PowerPoint template is defined as template lantern slide;
Processed lantern slide obtains submodule, for according to the object type in described pending lantern slide, being filled in described template lantern slide by the contents of object in described pending lantern slide in the object-oriented framework of respective type, obtain processed lantern slide;
Submodule replaced by lantern slide, for utilizing obtained processed lantern slide to replace described pending lantern slide.
Concrete, described To Template determines module, including:
Object-type information extracts submodule, for according to described template replacement instruction, extract described pending PowerPoint document package containing object-type information;
To Template determines submodule, for selecting a PowerPoint template comprising the object-type information extracted to some extent as target PowerPoint template from default template base.
Concrete, described matching degree calculating sub module, specifically for:
According to the number of same type object in different lantern slides, calculate the object matching degree of every lantern slide and described pending lantern slide in described target PowerPoint template.
Concrete, described matching degree calculating sub module, specifically for:
According to the similarity degree of characteristics of objects in different lantern slides, calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, described characteristics of objects comprises text box size, dimension of picture size, chart size size.
Concrete, described processed lantern slide obtains submodule, including:
Contents of object extraction unit, for extracting the contents of object in described pending lantern slide;
Object type determines unit, for determining the object type that described contents of object is corresponding;
Processed lantern slide obtains unit, for being filled in described template lantern slide by described contents of object in the object-oriented framework of respective type, obtains processed lantern slide.
The technical scheme that the application embodiment of the present invention provides, every pending lantern slide for PowerPoint document, contents of object in pending lantern slide is filled in the object-oriented framework of the template lantern slide respective type determined, obtain processed lantern slide, and utilize processed lantern slide to replace pending lantern slide, so not only change the Background of PowerPoint document, theme color, also changed the format structure in PowerPoint document lantern slide simultaneously, make the format structure of whole PowerPoint document, Background, the comparison match such as theme color, reach more preferably bandwagon effect, improve Consumer's Experience.
Detailed description of the invention
First a kind of PowerPoint template replacing method embodiment of the present invention provided illustrates, and the method may comprise steps of:
Receive user's template replacement instruction for pending PowerPoint document;
According to described template replacement instruction, it is determined that target PowerPoint template;
For each pending lantern slide of described pending PowerPoint document, perform following operation:
According to preset matching algorithm, calculate the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template;
Lantern slide the highest with the object matching degree of described pending lantern slide in described target PowerPoint template is defined as template lantern slide;
According to the object type in described pending lantern slide, the contents of object in described pending lantern slide is filled in described template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide;
Obtained processed lantern slide is utilized to replace described pending lantern slide.
The technical scheme that the application embodiment of the present invention provides, every pending lantern slide for PowerPoint document, contents of object in pending lantern slide is filled in the object-oriented framework of the template lantern slide respective type determined, obtain processed lantern slide, and utilize processed lantern slide to replace pending lantern slide, so not only change the Background of PowerPoint document, theme color, also changed the format structure in PowerPoint document lantern slide simultaneously, make the format structure of whole PowerPoint document, Background, the comparison match such as theme color, reach more preferably bandwagon effect, improve Consumer's Experience.
In order to make those skilled in the art be more fully understood that the technical scheme in the embodiment of the present invention, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of protection of the invention.
Shown in Figure 1, for the implementing procedure figure of a kind of PowerPoint template replacing method that the embodiment of the present invention provides, the method may comprise steps of:
S110: receive user's template replacement instruction for pending PowerPoint document;
Pending PowerPoint document, makes for user, it is necessary to be replaced the document that template processes.When the bandwagon effect of the dissatisfied current presentation manuscript document of user, it is necessary to this PowerPoint document is replaced template and processes, it is possible to send template replacement instruction.In actual applications, it is possible to providing a quick botton in the menu of PowerPoint, user clicks on, and can send template replacement instruction.After receiving user's template replacement instruction for pending PowerPoint document, continue executing with the operation of step S120.
S120: according to described template replacement instruction, it is determined that target PowerPoint template;
It is understandable that, replacing for PowerPoint template, need in PowerPoint system, pre-set a template base, this template base can be saved on local terminal when installing PowerPoint software simultaneously, it is also possible to is stored in PowerPoint server end, after client receives template replacement instruction, by obtaining corresponding PowerPoint template with the mutual of server end, or template replacement operation can directly complete at server end.Template base can comprise the PowerPoint template of polytype, multiple pattern, and certainly, these templates can be that system operation personnel preset setting, it is also possible to is that user oneself creates.
In actual applications, it is determined that the method for target PowerPoint template can include but not limited to following three kinds:
The first: is when user has for the demand of the replacing template of PowerPoint document, a PowerPoint template can be specified from template base, in this case, template replacement instruction carries PowerPoint Template Information, after the executive agent of the embodiment of the present invention receives template replacement instruction, it is possible to directly the PowerPoint template specified by user is defined as target PowerPoint template.
The second: user has no way of selecting for the numerous PowerPoint templates in template base, can according to certain matching process, as similar in characteristics of objects, object type is mutually equal, the multiple PowerPoint templates matched with pending PowerPoint document are found out from template base, and these PowerPoint templates are showed user in default a kind of mode (such as thumbnail mode), to be selected by user, further according to the selection instruction of user, it is determined that target PowerPoint template.
The third: user need not select, after receiving the template replacement instruction of user, by certain matching process, find out the PowerPoint template matched most with pending PowerPoint document, and it can be used as target PowerPoint template.
In a kind of detailed description of the invention of the present invention, this step may comprise steps of:
Step one: according to described template replacement instruction, extract described pending PowerPoint document package containing object-type information;
Step 2: select a PowerPoint template comprising the object-type information extracted to some extent as target PowerPoint template from default template base.
For convenience of description, above-mentioned two step is combined illustrate.
It is understood that PowerPoint document is including at least a lantern slide, every lantern slide is made up of specific object, and object type can have the types such as text box, picture, chart.According to template replacement instruction, extract all object-type information that pending PowerPoint document comprises, and the object-type information extracted is compared with the object-type information that the PowerPoint template in default template base comprises, determine the PowerPoint template including at least the object-type information extracted, and from these qualified PowerPoint templates, select one as target PowerPoint template.Can randomly choose, it is also possible to these qualified PowerPoint templates are showed user, user after specifying, using the PowerPoint template specified by user as target PowerPoint template.According to the target PowerPoint template that object-type information is determined, it is possible to pending PowerPoint document, there is stronger matching.
Such as, from pending PowerPoint document extract object-type information have three kinds, text box, picture and subtype, in this case, it is determined that target PowerPoint template be also required to include at least these three object type.In actual applications, it is possible to the object type of PowerPoint document is carried out more careful division, as text box being divided into horizontally-arranged text box, vertical setting of types text box etc., so can determine that the target PowerPoint template more mated.
Certainly, those skilled in the art can also according to other features of PowerPoint document, such as the number etc. of same type object, it is determined that target PowerPoint template, the present invention is without limitation.
By step S110 and step S120, it is thus achieved that pending PowerPoint document and target PowerPoint template, continue executing with the operation of step S130.
S130: for each pending lantern slide of pending PowerPoint document, performs lantern slide replacement operation;
Concrete, may comprise steps of for each pending lantern slide replacement operation, shown in Figure 2:
S131: according to preset matching algorithm, calculates the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template;
It is understood that determined target PowerPoint template comprises multiple lantern slides, the possible difference of object that every lantern slide comprises, there is different format structures.For pending lantern slide, it is necessary to determine, in target PowerPoint template, the lantern slide matched with it.The matching algorithm preset can be passed through, calculate the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template.
In a kind of detailed description of the invention of the present invention, it is possible to according to the number of same type object in different lantern slides, calculate the object matching degree of every lantern slide and described pending lantern slide in described target PowerPoint template.
For any two lantern slides, if these two lantern slides have identical object type, then the number of same type object is more many, it was shown that the object matching degree of these two lantern slides is more high.Such as, lantern slide 1 contrasts with lantern slide 2, lantern slide 3 respectively, lantern slide 1 has 3, picture, text box 4, lantern slide 2 has 1, picture, text box 2, lantern slide 3 has 3, picture, text box 3, then lantern slide 1 is 3 with the number of lantern slide 2 same type object, and the number of lantern slide 1 and lantern slide 3 same type object is 6, and the object matching degree of lantern slide 1 and lantern slide 3 is higher than the object matching degree with lantern slide 2.
Concrete, in target PowerPoint template, every lantern slide can utilize formula with the object matching degree of pending lantern slide: in the number sum of same type object/pending lantern slide, the total number of object calculates and obtains.Compare with the object of every lantern slide in target PowerPoint template by pending lantern slide, obtain pending lantern slide relative to the number of the same type object of every lantern slide in target PowerPoint template, by being divided by with the total number of object in pending lantern slide, obtain the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template.
In the another kind of detailed description of the invention of the present invention, can also according to the similarity degree of characteristics of objects in different lantern slides, calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, described characteristics of objects comprises text box size, dimension of picture size, chart size size.
For any two lantern slides, the characteristics of objects in these two lantern slides can be extracted, such as text box size, dimension of picture size, chart size size etc., the numerical value that the characteristics of objects of same type object characterizes is compared, obtain the similarity of the characteristics of objects of each type object, the characteristics of objects Similarity-Weighted of different object is sued for peace or weighting is multiplied and can obtain object matching degree.
Certainly, the scheme that those skilled in the art can also pass through the embodiment of the present invention and provide obtains other computing formula, obtains the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template thus calculating.
S132: lantern slide the highest with the object matching degree of described pending lantern slide in described target PowerPoint template is defined as template lantern slide;
By step S131, calculate and obtain the object matching degree of every lantern slide and pending lantern slide in target PowerPoint template, lantern slide the highest for matching degree is defined as template lantern slide, continues executing with the operation of step S133.
S133: according to the object type in described pending lantern slide, is filled in described template lantern slide by the contents of object in described pending lantern slide in the object-oriented framework of respective type, obtains processed lantern slide;
Template lantern slide is the lantern slide mated the most with pending lantern slide in PowerPoint template, the object wherein comprised exists with object-oriented framework form, pending lantern slide and in processed lantern slide logical relation between each object can pass through to extract characteristics of objects and obtain.According to the object type in pending lantern slide, contents of object in pending lantern slide is filled in the object-oriented framework of template lantern slide respective type, obtaining processed lantern slide, certainly, processed lantern slide contains the Background in template lantern slide and theme color.
For convenience of understanding, illustrate for the processed lantern slide schematic diagram of Fig. 3 a pending lantern slide schematic diagram and Fig. 3 b.
The object comprised in the pending lantern slide schematic diagram of Fig. 3 a is respectively as follows: two pictures, two text boxes comprising word, extract characteristics of objects, the logical relation between word in picture and text box can be obtained, according to the object type in pending lantern slide, two pictures are filled into respectively in the framework of picture/mb-type of template lantern slide, and according to logical relation between word in picture and text box, word content in two text boxes is filled in the framework of text box type of template lantern slide respectively, obtain the lantern slide shown in the processed lantern slide schematic diagram of Fig. 3 b.Therefrom visible, pending lantern slide background is more dull, and layout is in disorder, and processed lantern slide background is exquisite, and layout comparison is reasonable.
In a kind of detailed description of the invention of the present invention, this step may comprise steps of:
Extract the contents of object in described pending lantern slide;
Determine the object type that described contents of object is corresponding;
Described contents of object is filled in described template lantern slide in the object-oriented framework of respective type, obtains processed lantern slide.
Contents of object, is the content specifically comprised in object, the word in text box.Contents of object in pending lantern slide is extracted, and determines the object type corresponding with this contents of object, contents of object is filled in template lantern slide in the object-oriented framework of respective type, it is thus achieved that processed lantern slide.
S134: utilize obtained processed lantern slide to replace described pending lantern slide.
When all pending lantern slides of PowerPoint document replace with corresponding processed lantern slide, namely complete the replacing of PowerPoint template.
The technical scheme that the application embodiment of the present invention provides, every pending lantern slide for PowerPoint document, contents of object in pending lantern slide is filled in the object-oriented framework of the template lantern slide respective type determined, obtain processed lantern slide, and utilize processed lantern slide to replace pending lantern slide, so not only change the Background of PowerPoint document, theme color, also changed the format structure in PowerPoint document lantern slide simultaneously, make the format structure of whole PowerPoint document, Background, the comparison match such as theme color, reach more preferably bandwagon effect, improve Consumer's Experience.
Corresponding to above method embodiment, the embodiment of the present invention additionally provides a kind of PowerPoint template replacement device, and described in Fig. 4, this device can include with lower module:
Change command reception module 210, for receiving user's template replacement instruction for pending PowerPoint document;
To Template determines module 220, for according to described template replacement instruction, it is determined that target PowerPoint template;
Module 230 changed by lantern slide, for each the pending lantern slide for described pending PowerPoint document, performs lantern slide replacement operation.
Wherein, module 230 changed by described lantern slide can also include following submodule, shown in Figure 5:
Matching degree calculating sub module 231, for calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template;
Submodule 232 determined by template lantern slide, for lantern slide the highest with the object matching degree of described pending lantern slide in described target PowerPoint template is defined as template lantern slide;
Processed lantern slide obtains submodule 233, for according to the object type in described pending lantern slide, being filled in described template lantern slide by the contents of object in described pending lantern slide in the object-oriented framework of respective type, obtain processed lantern slide;
Submodule 234 replaced by lantern slide, for utilizing obtained processed lantern slide to replace described pending lantern slide.
The device that the application embodiment of the present invention provides, every pending lantern slide for PowerPoint document, contents of object in pending lantern slide is filled in the object-oriented framework of the template lantern slide respective type determined, obtain processed lantern slide, and utilize processed lantern slide to replace pending lantern slide, so not only change the Background of PowerPoint document, theme color, also changed the format structure in PowerPoint document lantern slide simultaneously, make the format structure of whole PowerPoint document, Background, the comparison match such as theme color, reach more preferably bandwagon effect, improve Consumer's Experience.
In a kind of detailed description of the invention of the present invention, described To Template determines module 220, it is possible to include following submodule:
Object-type information extracts submodule, for according to described template replacement instruction, extract described pending PowerPoint document package containing object-type information;
To Template determines submodule, for selecting a PowerPoint template comprising the object-type information extracted to some extent as target PowerPoint template from default template base.
In a kind of detailed description of the invention of the present invention, described matching degree calculating sub module 231, specifically for:
According to the number of same type object in different lantern slides, calculate the object matching degree of every lantern slide and described pending lantern slide in described target PowerPoint template.
In a kind of detailed description of the invention of the present invention, described matching degree calculating sub module 231, specifically for:
According to the similarity degree of characteristics of objects in different lantern slides, calculating the object matching degree of every lantern slide and pending lantern slide in described target PowerPoint template, described characteristics of objects comprises text box size, dimension of picture size, chart size size.
In a kind of detailed description of the invention of the present invention, described processed lantern slide obtains submodule 233, it is possible to include with lower unit:
Contents of object extraction unit, for extracting the contents of object in described pending lantern slide;
Object type determines unit, for determining the object type that described contents of object is corresponding;
Processed lantern slide obtains unit, for being filled in described template lantern slide by described contents of object in the object-oriented framework of respective type, obtains processed lantern slide.
It should be noted that, in this article, the relational terms of such as first and second or the like is used merely to separate an entity or operation with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, so that include the process of a series of key element, method, article or equipment not only include those key elements, but also include other key elements being not expressly set out, or also include the key element intrinsic for this process, method, article or equipment.When there is no more restriction, statement " including ... " key element limited, it is not excluded that there is also other identical element in including the process of described key element, method, article or equipment.
Each embodiment in this specification all adopts relevant mode to describe, between each embodiment identical similar part mutually referring to, what each embodiment stressed is the difference with other embodiments.Especially for device embodiment, owing to it is substantially similar to embodiment of the method, so what describe is fairly simple, relevant part illustrates referring to the part of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method embodiment can be by the hardware that program carrys out instruction relevant and completes, described program can be stored in computer read/write memory medium, the storage medium obtained designated herein, as: ROM/RAM, magnetic disc, CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit protection scope of the present invention.All make within the spirit and principles in the present invention any amendment, equivalent replacement, improvement etc., be all contained in protection scope of the present invention.