Hi,
i didn't find in Presentation.save the int[] slides parameter available in Presentation.SaveToPdf.
How can i save to pdf only specified slides ?
Thanks in advance for your help.
Hi,
i didn't find in Presentation.save the int[] slides parameter available in Presentation.SaveToPdf.
How can i save to pdf only specified slides ?
Thanks in advance for your help.
Hi Bottura,
public static void GenerateSlidePdf(Presentation pres, int SlideIndex){Presentation destPres = new Presentation();Slide slide = pres.GetSlideByPosition(SlideIndex);//Creating SortedList object that is used to store the temporary information//about the masters of PPT file. No value should be added to it.System.Collections.SortedList sList = new System.Collections.SortedList();//Cloning the selected slide at the end of another presentation filepres.CloneSlide(slide, destPres.Slides.LastSlidePosition + 1, pres, sList);//Rremoving defult empty slidedestPres.Slides.Remove(destPres.GetSlideByPosition(1));destPres.Save(“D:\Aspose Data\Slide_” + SlideIndex.ToString() + “.pdf”, SaveFormat.Pdf);}
Thanks a lot for your reply, that's exactly what i needed.
One question :
I am using Aspose in C++/CLI and i get a compilation warning :
warning C4996: 'Aspose::Slides::Slides::Remove': was declared deprecated
But in the help file, the function is not marked as obsolete ?
Hi Bottura,
I have observed the issues shared by you. I request you to please try using Aspose.Slides for .NET 7.8.1 on your end first. If there is still an issue then please provide the sample project with us that is reproducing the issue. We will verify the warning shared. Secondly. I suggest you to please use SlideCollection instead of Slides as this will be soon deprecated. I guess you are getting exception owing to this reason. Please try using the suggested option and in case the issue still prevails, please share the sample project with us.
Many Thanks,
Hi,
I tried using Slides for .NET v7.8.1 and I still get the warning.
Attached is the test project.
I don’t understand what you mean about the second point : i don’t use Slides : I use the Slides property of Presentation class, which is SlideCollection type … ?! But as SlideCollection inherits from Slides, the Presentation.Slides.Remove calls the Remove method from Slides Class, which was declared deprecated. Then I don’t see what I can do …
Thanks in advance for your help.
Hi Bottura,
Hi Bottura,
Hi,
your sample below no longer works with Aspose.Slides v14.x.
Can you tell me how to do to export to pdf only some pages from a presentation ?
Thanks in advance.
public static void GenerateSlidePdf(Presentation pres, int SlideIndex)
{
Presentation destPres = new Presentation();
Slide slide = pres.GetSlideByPosition(SlideIndex);
//Creating SortedList object that is used to store the temporary information
//about the masters of PPT file. No value should be added to it.
System.Collections.SortedList sList = new System.Collections.SortedList();
//Cloning the selected slide at the end of another presentation file
pres.CloneSlide(slide, destPres.Slides.LastSlidePosition + 1, pres, sList);
//Rremoving defult empty slide
destPres.Slides.Remove(destPres.GetSlideByPosition(1));
destPres.Save(“D:\Aspose Data\Slide_” + SlideIndex.ToString() + “.pdf”, SaveFormat.Pdf);
}
Hi Bottura,
I have observed the requirement shared by you. Please try using the following sample code on your end to serve the purpose.
public static void GenerateSlidePdf(Presentation pres, int SlideIndex)
{
Presentation destPres = new Presentation();
ISlide slide = pres.Slides[SlideIndex-1];
//Creating SortedList object that is used to store the temporary information
//about the masters of PPT file. No value should be added to it.
System.Collections.SortedList sList = new System.Collections.SortedList();
//Cloning the selected slide at the end of another presentation file
destPres.Slides.AddClone(slide);
//Rremoving defult empty slide
destPres.Slides.RemoveAt (0);
destPres.Save(“D:\Aspose Data\Slide_” + SlideIndex.ToString() + “.pdf”, SaveFormat.Pdf);
}
It works fine.
Thank you for your help.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan