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

Free Support Forum - aspose.com

How to add page number in each slide

Hi,


I am using licence version of Aspose slide and able to generate PPT presentation with C#. Net.
Kindly let me know how to add page number in each slide of presentation with ASPOSE slide.

Thanks,
Devanand

Hi Devanand,

I have observed your requirements and suggest you to please try using following sample code on your end to serve the purpose.

presentation.HeaderFooterManager.IsSlideNumberVisible = true;

Many Thanks,

Hi Thanks for the reply.


It works fine, Kindly let me know how to set position of the page number and format text.
For example: bottom left corner of page, Arial 10 pts, normal

Thanks,
Devnanad

Hi Devnanand,

I have observed the requirements shared by you and like to share that following sample code will be used in achieving the desired goal. However, it doesn’t seem to work for the time being and an issue with ID SLIDESNET-38255 has been created in our issue tracking system to further investigate and resolve the issue. We will share the feedback with you once the issue will be fixed.

public static void TestFooterFormatting()
{

Presentation pres = new Presentation(“C:\Aspose Data\TestSlide.pptx”);
IMasterSlide master = pres.Masters[0];
foreach(IShape shape in master.Shapes)
{
if(shape is IAutoShape)
{
IAutoShape ashp = (IAutoShape)shape;
if(ashp.Placeholder.Type==PlaceholderType.SlideNumber)
{
ITextFrame text = ashp.TextFrame;

IPortionFormat format = text.Paragraphs[0].Portions[0].PortionFormat;
IPortionFormatEffectiveData format2= text.Paragraphs[0].Portions[0].CreatePortionFormatEffective();
format.LatinFont = new FontData(“Arial”);
format.FontHeight = 24;
format.FillFormat.FillType = FillType.Solid;
format.FillFormat.SolidFillColor.Color = Color.Red;

}

}
}

pres.HeaderFooterManager.IsSlideNumberVisible = true;

pres.Save(“C:\Aspose Data\TestSlide2.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);
}

We are sorry for your inconvenience,

Ok Thanks,


I achieved pagination by some other way. Thanks for your help.

One more query I have regarding font formatting. I am generating slide with dynamic data based on user selection from screen and want to make some data bold at run time in slide from C#.net code,

For Ex. Address below first two lines are bold and rest are normal.
Adam Mak
100th Avenue
PO BOX 1022
SEATTLE WA 98104
USA

Could you please let me know best approach to get this done.

Thanks,
Devanand

Hi Devanand,

I have observed your requirements and like to share that Aspose.Slides for .NET allows you to set the fonts related properties on Portion level. If there is one paragraph, you can divide text based on different font properties in different portions. You will need to have a different portion in a paragraph collection when there is slight change in text related property (like bold, italic, underline, font, font height and color etc). You can please refer to this documentation link for more information about how to manage text in different portions based on changes in text formatting. You need to devise your own approach in this regard that which text you want to keep bold and which one to be normal. I hope the shared elaboration will be helpful.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-38255) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.