We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Correct way to apply the template!

We’re trying to use Aspose.Slides (Java) for applying the template - specifically (POTX and PPTX) to the powerpoint presentation (PPTX).

We’ve learned a bit about the structure of PresentationML and trying to mimic to apply the template. We found that we need to apply Masters (slide, notes and handouts), themes, layouts, page-setup attributes from the template. Are we missing some more things while applying the template?

Do Aspose has built-in API to apply the template to PPTX?


Hi Praneeth,


I have observed your requirement and like to share Aspose.Slides allows you to apply the presentation template on your desired presentation. There are two possible options in this regard. First is that you start loading the template presentation and then work over that. In the end save the presentation to different name and format as per your requirement. Other options is to load the template presentation and copy the master slides from template presentation object to target presentation and apply the desired master slides on desired presentation. I suggest you to please visit this documentation link in this regard to see how to apply master on slides.

I hope this information will be helpful. Please share, if I may help you further in this regard.

Many Thanks,

Hi Mudassir,
Thanks for your reply and help on copying of master slides. I got few confusion over when someone say that - apply template to PPTX, what it consists of?

#2. Does applying the masters is enough?

#3. Don’t we need to delete the existing masters and replace from template masters?

#4. I think masters are associated with layouts, do we need to add/clone layouts as well? Next subsequent question is do we need to delete the layouts of destination PPTX before adding the cloned layouts as well?

#5. Don’t we need to apply Theme parts (which consists of <!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>JA</w:LidThemeAsian>
<w:LidThemeComplexScript>HI</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:11.0pt;line-height:115%;
font-family:“Calibri”,sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:Mangal;mso-bidi-theme-font:minor-bidi;color:black;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Colors,
Fonts, Effects<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-fareast-language:EN-US; mso-bidi-language:AR-SA;}

<![endif]–>)?

#6. Don’t we need to apply headers footers from template? Headers/footers may be associated with masters so may not be necessary to apply?

And the last main question is - if we change the masters does the content in destination PPTX will be changed depending upon the layouts (new layouts associated with new masters)?

Thanks.

Hi Praneeth,

I have observed the questions shared by you and will answer them separately.

PraneethS:
Hi Mudassir,

I got few confusion over when someone say that - apply template to PPTX, what it consists of?

#2. Does applying the masters is enough?


When you apply some master to a slide then the slide that use the particualr layout slide of selected master inherits the properties of changed master layout slide on its placeholders. If you have added any shape directly in slide and that is not inherited from layout slide then changing the master will not affect those shapes that have been added locally inside slide.

PraneethS:


#3. Don’t we need to delete the existing masters and replace from template masters?



Aspose.Slides offers to delete the unused master. If you are using a new master on all slides of presentation then you can remove the unused master using Aspose.Slides. Even if you don’t remove the unused master that has been replaced, its not going to affect presentation except the size of presentation that will be holding the unused master.

PraneethS:


#4. I think masters are associated with layouts, do we need to add/clone layouts as well? Next subsequent question is do we need to delete the layouts of destination PPTX before adding the cloned layouts as well?



You need to clone the master slide only. Cloning the master will automatically clone the layout slides in that master. You dont need to worry about this. Secondly, the layout slides are held inside the master. When you will remove the unused master, its layout slides will automatically get removed.

PraneethS:

#5. Don’t we need to apply Theme parts (which consists of Colors, Fonts, Effects)?


As far as your query concerning to applying theme parts is concerned, It has been requested by you in separate thread over following link.
How to apply Theme Part(s)?

PraneethS:

#6. Don’t we need to apply headers footers from template? Headers/footers may be associated with masters so may not be necessary to apply?

And the last main question is - if we change the masters does the content in destination PPTX will be changed depending upon the layouts (new layouts associated with new masters)?



If the header/footer are defined in your master slide then you only need to show them in your normal slides by using Presentation.getHeaderFooterManager() class instance.

As I shared with you in very first question of this post that if changing of master will affect those placeholders inside the target slide that have been inherited from layout slide of the selected master. Any local shapes added directly in slide will not be affected by new master.

I hope this will clarify. Please share if I may help you further in this regard.

Many Thanks,