I have the following 2 documents Doc2.ppt and Doc3.ppt
When I attempt to create a new presentation by combining Doc2.ppt and Doc3.ppt together, I find that the slides numbers appear on the first slide but not the 2nd? Why is this? What is it that actually controls the slide numbers? I'd like the slide numbers to appear, but for them to be consistent, that is to appear on all the slides or not appear at all on any slides.
My question is why do the slides number appear at all, and how can I control them, if at all? Is they anything about my documents that I am using?
How can I get rid of them or get all of them to appear?
Here is the code I am using, I have attached doc2.ppt and doc3.ppt and the object PowerPointHelper.cs as zip files
List filesToCombine = new List(); filesToCombine.Add("c:\Doc2.ppt"); filesToCombine.Add("c:\Doc3.ppt");
PowerPointHelper ph = new PowerPointHelper(); List filesToCombineStream = new List(); foreach (string file in filesToCombine) { Stream s = ToStream(file); filesToCombineStream.Add(s); }
//Merge all these slides together to create a new file Stream combined = ph.CombinePresentations(DocumentFormat.PowerPoint, filesToCombineStream); string destinationFile = "c:\Combined.ppt"; ToFile(combined, destinationFile);
private static Stream ToStream(string file) { byte[] fileBytes = File.ReadAllBytes(file); MemoryStream ms = new MemoryStream(fileBytes); return ms; }
Headers/footer/sl.numbers controlled by Master slide. If you combine 2 presentations then target ppt file has 2 MainMaster slides. So different slides controlled by own master. That is theory.
On practice, Slide.HeaderFooter.IsPageNumberVisible property is read-only in the Aspose.Slides and you can’t change it. I will investigate if we can give write access to these properties in short time.
You are saying that when combining 2 presentations, you will have 2 master slides (one for each presentation) that is fine, I understand that, but im still not sure why it is that the slide numbers sometimes appear, and sometimes they dont appear. in fact they always appear if I combine Doc2.ppt and Doc3.ppt to produce a new presentation, but when they appear, they appear for only the first slide. However if I now combine them in the reverse order I find that the slides numbers appear only for the 2nd slide, but not for the first. This leads me to believe that there is something special about the Doc2.ppt, but as far as I can see, there isnt.
Whats even more confusing is that when both documents were created in powerpoint 2003, the master slide has an option to insert slide numbers and that is set for both documents, so why do slide numbers only appear for Doc2.ppt, but not for Doc3.ppt when combined to produce a new document?
Im still at a loss to explain why this happens..., can you prodvide an explanation? I al looking forward to having control over slide numbers in a future release - do you know when this will be?
You can programmatically delete text frame with slide number on MainMaster. As I wrote, currently there is no another good solution. We will give possibility to control it in the future.
I have finally found, what is so special with Doc2.ppt that slide numbers appear on it but do not appear on Doc3.ppt. The reason is that Doc2.ppt had used Apply button in the header footer dialog to show slide number, while Doc3.ppt had used [Apply All] button.
Based on which button [Apply] or [Apply All] is used, slide numbers appear or disappear. In earlier case, they appear, while in later case they do not.
Please see the attached file which includes two sample presentation files and demo code which illustrates my point.
Write access has been given to HeaderFooter properties in Aspose.Slides 2.6.6.0. Now you can control slide numbers to appear/disappear by setting the Slide.HeaderFooter.IsPageNumberVisible property as true/false.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.