Save
Save(string, int[], SaveFormat)
Saves specified slides of a presentation to a file with the specified format with page number keeping.
public void Save(string fname, int[] slides, SaveFormat format)
Parameter | Type | Description |
---|---|---|
fname | String | Path to the created file. |
slides | Int32[] | Array with slide positions, starting from 1. |
format | SaveFormat | Format of the exported data. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | When stream or slides parameter is null. |
ArgumentOutOfRangeException | When slides parameter contains wrong page numbers. |
InvalidOperationException | When an unsupported SaveFormat is used, e.g. PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, ODP. |
See Also
- enum SaveFormat
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(string, int[], SaveFormat, ISaveOptions)
Saves specified slides of a presentation to a file with the specified format with page number keeping.
public void Save(string fname, int[] slides, SaveFormat format, ISaveOptions options)
Parameter | Type | Description |
---|---|---|
fname | String | Path to the created file. |
slides | Int32[] | Array with slide positions, starting from 1. |
format | SaveFormat | Format of the exported data. |
options | ISaveOptions | Additional format options. |
See Also
- enum SaveFormat
- interface ISaveOptions
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(Stream, int[], SaveFormat)
Saves specified slides of a presentation to a stream in the specified format with page number keeping.
public void Save(Stream stream, int[] slides, SaveFormat format)
Parameter | Type | Description |
---|---|---|
stream | Stream | Output stream. |
slides | Int32[] | Array with slide positions, starting from 1. |
format | SaveFormat | Format of the exported data. |
See Also
- enum SaveFormat
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(Stream, int[], SaveFormat, ISaveOptions)
Saves specified slides of a presentation to a stream in the specified format with page number keeping.
public void Save(Stream stream, int[] slides, SaveFormat format, ISaveOptions options)
Parameter | Type | Description |
---|---|---|
stream | Stream | Output stream. |
slides | Int32[] | Array with slide positions, starting from 1. |
format | SaveFormat | Format of the exported data. |
options | ISaveOptions | Additional format options. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | When stream or slides parameter is null. |
ArgumentOutOfRangeException | When slides parameter contains wrong page numbers. |
InvalidOperationException | When an unsupported SaveFormat is used, e.g. PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, ODP. |
Examples
The following example shows how to convert PowerPoint to PNG.
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
for (var index = 0; index < pres.Slides.Count; index++)
{
ISlide slide = pres.Slides[index];
slide.GetThumbnail().Save($"slide_{index}.png", ImageFormat.Png);
}
}
The following example shows how to convert PowerPoint to PNG with custom dimensions.
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
float scaleX = 2f;
float scaleY = 2f;
for (var index = 0; index < pres.Slides.Count; index++)
{
ISlide slide = pres.Slides[index];
slide.GetThumbnail(scaleX, scaleY).Save($"slide_{index}.png", ImageFormat.Png);
}
}
The following example shows how to convert PowerPoint to PNG with custom size.
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
Size size = new Size(960, 720);
for (var index = 0; index < pres.Slides.Count; index++)
{
ISlide slide = pres.Slides[index];
slide.GetThumbnail(size).Save($"slide_{index}.png", ImageFormat.Png);
}
}
See Also
- enum SaveFormat
- interface ISaveOptions
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(string, SaveFormat)
Saves all slides of a presentation to a file with the specified format.
public void Save(string fname, SaveFormat format)
Parameter | Type | Description |
---|---|---|
fname | String | Path to the created file. |
format | SaveFormat | Format of the exported data. |
See Also
- enum SaveFormat
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(Stream, SaveFormat)
Saves all slides of a presentation to a stream in the specified format.
public void Save(Stream stream, SaveFormat format)
Parameter | Type | Description |
---|---|---|
stream | Stream | Output stream. |
format | SaveFormat | Format of the exported data. |
See Also
- enum SaveFormat
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(string, SaveFormat, ISaveOptions)
public void Save(string fname, SaveFormat format, ISaveOptions options)
See Also
- enum SaveFormat
- interface ISaveOptions
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(Stream, SaveFormat, ISaveOptions)
Saves all slides of a presentation to a stream in the specified format and with additional options.
public void Save(Stream stream, SaveFormat format, ISaveOptions options)
Parameter | Type | Description |
---|---|---|
stream | Stream | Output stream. |
format | SaveFormat | Format of the exported data. |
options | ISaveOptions | Additional format options. |
Exceptions
exception | condition |
---|---|
NotSupportedException | If you try to save encrypted file in none Office 2007-2010 format |
See Also
- enum SaveFormat
- interface ISaveOptions
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
Save(IXamlOptions)
Saves all slides of a presentation to a set of files representing XAML markup.
public void Save(IXamlOptions options)
Parameter | Type | Description |
---|---|---|
options | IXamlOptions | The XAML format options. |
Examples
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
pres.Save(new XamlOptions { ExportHiddenSlides = true });
}
See Also
- interface IXamlOptions
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides