Class Convert

Class Convert

Namespace: Aspose.Slides.LowCode
Assembly: Aspose.Slides.dll (25.12.0)

Represents a group of methods intended to convert Aspose.Slides.Presentation.

public static class Convert

Inheritance

object Convert

Examples

Convert.AutoByExtension("pres.pptx", "pres.pdf");

Methods

AutoByExtension(string, string)

Converts Aspose.Slides.Presentation using the passed output path extension to determine the required export format.

public static void AutoByExtension(string presPath, string outPath)

Parameters

presPath string

Path of the input presentation

outPath string

Output path

Examples

Aspose.Slides.LowCode.Convert.AutoByExtension("pres.pptx", "pres.pdf");

Exceptions

ArgumentOutOfRangeException

ToJpeg(Presentation, string)

Converts the input presentation to a set of JPEG format images.
If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.

public static void ToJpeg(Presentation pres, string outputFileName)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

Examples

using (var pres = new Presentation("pres.pptx"))
    Convert.ToJpeg(pres, "presImage.jpeg");

Exceptions

ArgumentException

ToJpeg(Presentation, string, Size)

Converts the input presentation to a set of JPEG format images.
If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.

public static void ToJpeg(Presentation pres, string outputFileName, Size imageSize)

Parameters

pres Presentation

The input presentation

outputFileName string

The output file name.

imageSize Size

The size of each generated image.

Examples

using (var pres = new Presentation("pres.pptx"))
    Convert.ToJpeg(pres, "presImage.jpeg", new Size(720, 540));

Exceptions

ArgumentException

ToJpeg(Presentation, string, float, IRenderingOptions)

Converts the input presentation to a set of JPEG format images.
If the output file name is given as “myPath/myFilename.jpeg”, the result will be saved as a set of “myPath/myFilename_N.jpeg” files, where N is a slide number.

public static void ToJpeg(Presentation pres, string outputFileName, float scale, IRenderingOptions options)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

scale float

The scaling factor applied to the output images relative to the original slide size.

options IRenderingOptions

The rendering options.

Examples

IRenderingOptions options = new RenderingOptions()
{
    SlidesLayoutOptions = new NotesCommentsLayoutingOptions()
    {
        NotesPosition = NotesPositions.BottomTruncated
    }
};

using (var pres = new Presentation("pres.pptx"))
    Convert.ToJpeg(pres, "presImage.jpeg", 2f, options);

Exceptions

ArgumentException

ToPdf(string, string)

Converts Aspose.Slides.Presentation to PDF.

public static void ToPdf(string presPath, string outPath)

Parameters

presPath string

Path of the input presentation

outPath string

Output path

Examples

Convert.ToPdf("pres.pptx", "pres.pdf");

ToPdf(string, string, IPdfOptions)

Converts Aspose.Slides.Presentation to PDF.

public static void ToPdf(string presPath, string outPath, IPdfOptions options)

Parameters

presPath string

Path of the input presentation

outPath string

Output path

options IPdfOptions

Output PDF options

Examples

Convert.ToPdf("pres.pptx", "pres.pdf", new PdfOptions{ Compliance = PdfCompliance.PdfUa });

ToPdf(Presentation, string)

Converts Aspose.Slides.Presentation to PDF.

public static void ToPdf(Presentation pres, string outPath)

Parameters

pres Presentation

Input presentation

outPath string

Output path

Examples

using (Presentation pres = new Presentation("input.pptx"))    
{
    Convert.ToPdf(pres, "output.pdf");
}

ToPdf(Presentation, string, IPdfOptions)

Converts Aspose.Slides.Presentation to PDF.

public static void ToPdf(Presentation pres, string outPath, IPdfOptions options)

Parameters

pres Presentation

Input presentation

outPath string

Output path

options IPdfOptions

Output PDF options

Examples

using (Presentation pres = new Presentation("input.pptx"))    
{
    Convert.ToPdf(pres, "output.pdf", new PdfOptions{ Compliance = PdfCompliance.PdfUa });
}

ToPng(Presentation, string)

Converts the input presentation to a set of PNG format images.
If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

Examples

using (var pres = new Presentation("pres.pptx"))
   Convert.ToPng(pres, "presImage.png");

Exceptions

ArgumentException

ToPng(Presentation, string, Size)

Converts the input presentation to a set of PNG format images.
If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName, Size imageSize)

Parameters

pres Presentation

The input presentation

outputFileName string

The output file name.

imageSize Size

The size of each generated image.

Examples

using (var pres = new Presentation("pres.pptx"))
    Convert.ToPng(pres, "presImage.png", new Size(720, 540));

Exceptions

ArgumentException

ToPng(Presentation, string, float, IRenderingOptions)

Converts the input presentation to a set of PNG format images.
If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName, float scale, IRenderingOptions options)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

scale float

The scaling factor applied to the output images relative to the original slide size.

options IRenderingOptions

The rendering options.

Examples

IRenderingOptions options = new RenderingOptions()
{
    SlidesLayoutOptions = new NotesCommentsLayoutingOptions()
    {
        NotesPosition = NotesPositions.BottomTruncated
    }
};

using (var pres = new Presentation("pres.pptx"))
   Convert.ToPng(pres, "presImage.png", 2f, options);

Exceptions

ArgumentException

ToSvg(string)

Converts Aspose.Slides.Presentation to SVG.

public static void ToSvg(string presPath)

Parameters

presPath string

Path of the input presentation

Examples

Convert.ToSvg("pres.pptx");

ToSvg(string, GetOutPathCallback)

Converts Aspose.Slides.Presentation to SVG.

public static void ToSvg(string presPath, Convert.GetOutPathCallback getOutPath)

Parameters

presPath string

Path of the input presentation

getOutPath Convert . GetOutPathCallback

Callback that returns the SVG output path for each slide in the presentation

Examples

Convert.ToSvg("pres.pptx", (slide, index) => $"pres_{index}-out.svg");

ToSvg(Presentation, GetOutPathCallback)

Converts Aspose.Slides.Presentation to SVG.

public static void ToSvg(Presentation pres, Convert.GetOutPathCallback getOutPath)

Parameters

pres Presentation

Input presentation

getOutPath Convert . GetOutPathCallback

Callback that returns the SVG output path for each slide in the presentation

Examples

using (Presentation pres = new Presentation("input.pptx"))    
{
    Convert.ToSvg(pres, (slide, index) => $"pres_{index}-out.svg");
}

ToSvg(Presentation, ISVGOptions)

Converts Aspose.Slides.Presentation to SVG.

public static void ToSvg(Presentation pres, ISVGOptions options)

Parameters

pres Presentation

Input presentation

options ISVGOptions

SVG export options

Examples

using (Presentation pres = new Presentation("input.pptx"))    
{
    Convert.ToSvg(pres, new SVGOptions { VectorizeText = true });
}

ToSvg(Presentation, GetOutPathCallback, ISVGOptions)

Converts Aspose.Slides.Presentation to SVG.

public static void ToSvg(Presentation pres, Convert.GetOutPathCallback getOutPath, ISVGOptions options)

Parameters

pres Presentation

Input presentation

getOutPath Convert . GetOutPathCallback

Callback that returns the SVG output path for each slide in the presentation

options ISVGOptions

SVG export options

Examples

using (Presentation pres = new Presentation("input.pptx"))    
{
    Convert.ToSvg(pres, (slide, index) => $"pres_{index}-out.svg", new SVGOptions { VectorizeText = true });
}

ToTiff(Presentation, string)

Converts the input presentation to a set of TIFF format images.
If the output file name is given as “myPath/myFilename.tiff”, the result will be saved as a set of “myPath/myFilename_N.tiff” files, where N is a slide number.

public static void ToTiff(Presentation pres, string outputFileName)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

Examples

using (var pres = new Presentation("pres.pptx"))
   Convert.ToTiff(pres, "presImage.tiff");

Exceptions

ArgumentException

ToTiff(Presentation, string, ITiffOptions, bool)

Converts the input presentation to TIFF format with custom options. If the output file name is given as “myPath/myFilename.tiff” and multipage is false, the result will be saved as a set of “myPath/myFilename_N.tiff” files, where N is a slide number. Otherwise, if multipage is true, the result will be a multi-page “myPath/myFilename.tiff” document.

public static void ToTiff(Presentation pres, string outputFileName, ITiffOptions options, bool multipage)

Parameters

pres Presentation

The input presentation.

outputFileName string

The output file name.

options ITiffOptions

The TIFF saving options.

multipage bool

Specifies whether the generated TIFF document should be a multi-page.

Examples

ITiffOptions options = new TiffOptions()
{
    CompressionType = TiffCompressionTypes.CCITT3,
    SlidesLayoutOptions = new NotesCommentsLayoutingOptions()
    {
        NotesPosition = NotesPositions.BottomTruncated
    }
};

using (var pres = new Presentation("pres.pptx"))
   Convert.ToTiff(pres, "pres.tiff", options, false);

Exceptions

ArgumentException